Before you can create a product, you need to know which Hotspot profiles are configured on your MikroTik router. These two endpoints connect in real time to the physical router via the MikroTik API protocol and return the profiles that exist on the device, or verify that the connection itself is working. All endpoints requireDocumentation 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.
Authorization: Bearer <session_token> for a cliente_admin user.
These endpoints establish a live connection to the physical MikroTik router at request time. Response times depend on the router’s network latency. Ensure the router is online and its API port (default
8728) is reachable from the API server before calling these endpoints.GET /api/v1/admin/routers//mikrotik-profiles
Connects to the specified MikroTik router and returns all configured Hotspot profiles. The returned profile IDs (e.g."*003") and names are what you need to supply when creating a product.
Pre-flight checks performed before connecting:
- The router must exist and belong to the authenticated company.
- The router must have
activo = true. - The router must have
host,usuario, andpassword_encryptedset.
cURL
Path Parameters
The router ID to connect to, e.g.
RTR_A1B2C3D4. Must belong to the authenticated company.Response
Returns an array ofPerfilMikrotikResponse objects. An empty array ([]) is returned if the router has no Hotspot profiles configured.
MikroTik internal profile identifier. This is the
.id field from the RouterOS Hotspot profile resource, formatted as "*XXX" (e.g. "*003"). Use this value as perfil_mikrotik_id when creating products.Human-readable profile name as configured on the router (e.g.
"1_Semana_tiempo_corrido", "1_Dia"). Use this value as perfil_mikrotik_nombre when creating products.Maximum session duration. MikroTik time format, e.g.
"7d" (7 days), "1d" (1 day), "2h" (2 hours). null if not set on the profile.Duration of inactivity before the session is terminated, e.g.
"10m". null if not set.How long the router waits for keepalive pings before dropping the session.
null if not set.Interval for the captive portal status page to auto-refresh, e.g.
"1m". null if not set.Maximum simultaneous logins allowed per user account on this profile.
null if not restricted.Bandwidth limit in MikroTik format:
"RX/TX", e.g. "10M/10M" (10 Mbps download / 10 Mbps upload). null if no limit is configured.MikroTik address list this profile’s users are added to.
null if not set.Duration for MAC address cookie validity, e.g.
"3d". null if not set.Example Response
Error Responses
| Status | Detail |
|---|---|
400 | "El router está inactivo. Actívalo primero desde el panel." |
400 | "El router no tiene credenciales configuradas completas (host, usuario, contraseña)" |
404 | "Router no encontrado o no pertenece a tu empresa" |
500 | "Error al conectar con el router MikroTik: <error detail>" — the router is unreachable, credentials are wrong, or the API port is blocked |
GET /api/v1/admin/routers//test-connection
Tests the MikroTik API connection for the specified router without requiring the router to beactivo. Returns connection success/failure status, the number of Hotspot profiles found, and the router’s identity name as reported by RouterOS.
This endpoint is intended for troubleshooting and for the router configuration UI to confirm credentials are valid before saving.
cURL
Path Parameters
The router ID to test, e.g.
RTR_A1B2C3D4. Must belong to the authenticated company.Response
This endpoint always returns HTTP 200 — connection failures are reported in the response body rather than as HTTP error codes.true if the MikroTik API connection was established successfully, false otherwise.Human-readable summary:
"Conexión exitosa" or "Error de conexión".Number of Hotspot profiles returned by the router.
0 if the connection failed or no profiles exist.The RouterOS system identity name (e.g.
"MikroTik-Lobby"). Only present on successful connections.Error detail string when
success is false. null on success.Server-side timestamp of when the test was performed.
Successful Connection
Failed Connection