The auto-reconnect endpoint re-authenticates a customer who has already paid and holds valid hotspot credentials, but whose device MAC address has changed since they originally connected. This happens frequently on modern mobile devices that randomize their WiFi MAC address (RANDMAC) on each reconnection. The endpoint handles MAC-cookie injection, optional RANDMAC user cloning, and MikroTik version detection — all in a single API call initiated by the captive portal JavaScript when a returning visitor is detected viaDocumentation 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.
localStorage.
RANDMAC support: Up to 15 MAC clones can be created per base user. When a returning user connects with a new MAC address, the endpoint checks whether any existing
_RANDMAC* clone already holds that MAC. If found, it logs in with that clone. If not, a new clone (e.g., AB3C9D_RANDMAC3) is created with the current MAC and used for the session. This allows a single paid account to seamlessly roam across MAC changes without re-purchasing.Request
Method:POSTPath:
/api/v1/hotspot/auto-reconnectContent-Type:
application/json
Headers
Router API Key in the format
jwt_<token>. Identifies the company and the MikroTik router where the user’s hotspot account resides.Body
The hotspot username as stored in
localStorage on the client device. This is the value from usuario_hotspot.usuario returned by the original payment endpoint. May also be a _RANDMAC*-suffixed clone name if the user was previously reconnected.URL-encoded values are automatically decoded by the server.The hotspot password as stored in
localStorage. Pass an empty string "" for PIN-type users (where the password is empty). The server automatically detects the user type and ignores this field for PIN users.The previous MAC address stored in
localStorage from the last successful connection. Used as a reference to look up the correct user clone. Optional — if not provided, the server falls back to searching by username only.The device’s current MAC address as seen on the captive portal network. This is the new MAC that triggered the reconnect flow. URL-encoded values are automatically decoded.Format:
"AA:BB:CC:DD:EE:FF" (colons or hyphens, upper or lower case — all formats accepted).The device’s current IP address on the hotspot network. Passed to MikroTik’s cookie injection call to target the correct active lease. Highly recommended for reliable auto-connection.
The SSID the device is currently connected to. Optional informational field — not used in the connection logic but available for logging.
Response
true if the reconnection attempt completed without a fatal error (note: success: true does not necessarily mean the user is connected — check auto_conexion).High-level status of the user account check. Possible values:
| Value | Meaning |
|---|---|
"activo" | User account was found and the connection was attempted. |
"expirado" | User account was not found on MikroTik, or the username field contains a MAC address (expired/invalid session). |
"empresa_inactiva" | The company associated with the API Key is deactivated. |
"router_inactivo" | The router associated with the API Key is deactivated. |
"error" | An unexpected server-side error occurred. |
Result of the MikroTik connection attempt. Either
"conectado" (login succeeded and was verified in active sessions) or "no_conectado" (login not attempted or failed).MikroTik user or session data returned from the router. Contains the raw fields from
/ip/hotspot/user or the active session entry. null if no session data was retrieved. Structure depends on MikroTik version and profile.The
current_mac value as processed by the server (normalized to uppercase colon-separated format). Returned so the frontend can update its localStorage entry.Accumulated uptime for the user account, if available from MikroTik (e.g.,
"00:45:12"). May be null if not reported by the router.Remaining session time, if the MikroTik profile has a time limit configured. May be
null if the profile has no limit or the router does not report it.ISO 8601 timestamp of the user’s first connection. May be
null if not tracked.Human-readable message describing the connection outcome. Display this to the user when
auto_conexion is "no_conectado".Technical error details for debugging. Only present when
estado is "error". Do not display to end users.ISO 8601 UTC datetime of the server’s response (e.g.,
"2024-07-01T17:00:00.000000").Reconnect Flow
Examples
cURL
Response — Connected 200 OK
Response — Expired user 200 OK
Response — Inactive company 200 OK
This endpoint always returns
HTTP 200 regardless of the connection outcome. Check the estado and auto_conexion fields to determine the actual result. A success: false response with estado: "expirado" is the normal case for a user whose access period has ended — direct them to the payment page to purchase a new session.