The Pagos Hotspot API communicates directly with MikroTik routers over the RouterOS API protocol (port 8728 for plain TCP, port 8729 for SSL/TLS). After a card payment is approved, the API callsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sistemashm24/pagos_hotspot_api/llms.txt
Use this file to discover all available pages before exploring further.
POST /ip/hotspot/user/add on the router to create a Hotspot user with a generated username and password (or PIN), then returns those credentials to the paying customer so they can connect to the WiFi portal immediately. Each router is registered in the database with the connection details needed to establish that live session.
Required router data
Each router record (Router model) stores the following connection fields:
| Field | Type | Description |
|---|---|---|
nombre | string | Human-readable label for this router |
host | string | IP address or hostname reachable from the API server |
puerto | integer | RouterOS API port (default: 8728) |
usuario | string | RouterOS API username |
password_encrypted | string | RouterOS API password (encrypted at rest) |
ubicacion | string | Optional physical location note |
Port 8728 (plain TCP) or 8729 (SSL/TLS) must be reachable from the
server running the Pagos Hotspot API. If your MikroTik is behind NAT or a
firewall, open the appropriate port or set up a VPN tunnel between the server
and the router.
Enabling the RouterOS API service
Before registering a router, make sure the API service is enabled on the MikroTik device.Creating a dedicated API user on MikroTik
Creating a router record (super admin)
Super admins can create router records for any company. This is typically done during onboarding.The ID of the company this router belongs to (e.g.
EMP_ABC1234567).A descriptive label for this router (e.g.
"Sucursal Centro").IP address or hostname of the MikroTik router as reachable from the API
server.
RouterOS API port. Use
8728 for plain TCP or 8729 for SSL/TLS.RouterOS username with API access.
RouterOS password. Stored encrypted in the database.
Optional physical location description (e.g.
"Piso 2, sala de espera").Updating a router (client admin)
Company admins can update any router that belongs to their own company.UUID of the router to update. The router must belong to the authenticated
admin’s company.
puerto is not provided it defaults to 8728.
Testing the connection
Use this endpoint to verify that the API server can reach the router and authenticate successfully. This is useful after creating or updating router credentials.Listing Hotspot profiles
This endpoint connects to the live router, retrieves all configured Hotspot User Profiles, and returns their details. The profile names returned here are the values you must use when creating products (perfil_mikrotik_nombre).
/ip/hotspot/user/profile/print:
| Field | RouterOS key | Description |
|---|---|---|
session_timeout | session-timeout | Maximum session duration before forced logout |
idle_timeout | idle-timeout | Inactivity timeout |
rate_limit | rate-limit | Download/upload bandwidth cap (e.g. 5M/5M) |
shared_users | shared-users | Max concurrent logins with the same credentials |
mac_cookie_timeout | mac-cookie-timeout | Duration of the MAC cookie set for auto-reconnect |