API Reference
Portal analytics
Record a captive portal usage event.
POST /api/mikrotik/analytics/eventsAccess: Public
Portal use case
The portal sends view, payment, free-offer, and support events to feed zone analytics.
Request body
{
"eventType": "portal_view",
"companyReference": "readyzone-center-12345",
"macAddress": "AA:BB:CC:DD:EE:FF",
"portalTemplate": "model-4-template-1",
"page": "login",
"url": "http://192.168.88.1/login",
"metadata": {}
}Request attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
eventType | string | Yes | Event type accepted by the API. See the list below. |
companyReference | string | Yes | Public zone reference, maximum 64 characters. |
macAddress | string | Yes | MAC address observed by the portal, maximum 64 characters. |
portalTemplate | string | No | Template identifier, maximum 64 characters. |
page | string | No | Origin page or screen, maximum 64 characters. |
url | string | No | Page URL, maximum 512 characters. |
ipAddress | string | No | Client IP address, maximum 64 characters. |
routerIdentity | string | No | MikroTik router identity, maximum 128 characters. |
hotspotServerName | string | No | Hotspot server name, maximum 128 characters. |
metadata | object | No | Additional JSON data. Do not include secrets, passwords, or OTPs. |
eventType values
| Value | Meaning |
|---|---|
portal_view | Initial portal display. |
buy_plan_click | Click on the plan purchase action. |
news_click | Click on an announcement. |
services_click | Open or click on the services section. |
login_click | Portal login attempt. |
recover_credentials_click | Credential recovery request. |
powered_by_click | Click on the ReadyZone link. |
logout_click | Portal logout. |
plan_list_view | Plan list displayed. |
plan_detail_view | Plan details displayed. |
checkout_started | Checkout opened or payment started. |
payment_method_selected | Payment method selected. |
payment_started | Transaction initialized. |
payment_success | Payment successfully confirmed. |
payment_failed | Payment failed. |
otp_requested | OTP delivery requested. |
otp_verified | OTP verified. |
free_offer_activated | Free offer activated. |
support_contact_email_click | Support email button clicked. |
support_contact_phone_click | Support phone button clicked. |
support_contact_open | Support dialog opened. |
Collection rules
- The browser sends
Content-Type: application/jsonandAccept: application/json. - Collection is public and must not be used to transmit credentials or payment data.
metadatamust contain only data useful for analytics and stay within the API size limits.- The portal may skip an event when the zone reference or MAC address is unavailable.
Status codes
- 201 Created
- 400 Bad Request (invalid payload)
- 403 Forbidden (zone not authorized)