Guest WiFi REST API and Signed Webhooks Integration Guide

· Guest WiFi and Captive Portal

Automating Guest Wi-Fi Operations Through a Clean Developer Contract

As hospitality groups, multi-site retailers, and managed network providers scale across dozens of venues, exporting reports or creating credentials manually in a web dashboard quickly becomes a bottleneck. Hotspotly addresses programmatic integration through two complementary primitives: the /api/public/v1 REST API for scoped reads and mutations, and signed outbound webhooks for real-time event push. Both capabilities activate once your package includes the API access module and a per-minute request allowance.

Every endpoint schema, error payload, and interactive example is published in OpenAPI 3.1 format (/api/public/v1/openapi.json) on your panel's developer documentation page. Broader ecosystem workflows and supported connection patterns are also outlined on the Hotspotly integrations page.

Scoped API Keys and Least-Privilege Access Control

External software such as property management tools, CRMs, or BI pipelines authenticates without panel credentials using keys created only by the account owner in the API keys console. Plaintext keys are displayed once at creation while Hotspotly retains only a keyed cryptographic hash, and each key carries an explicit expiration of up to 365 days.

  • IP CIDR allowlisting: Restrict each key to up to 50 explicit IPv4 or IPv6 CIDR ranges; wildcard /0 entries are rejected so network boundaries stay verifiable.
  • Granular scopes: Separate permissions cover visit analytics, live sessions, session disconnection, voucher issuance, local user management, speed profile assignment, and session access-log exports—capped by design to the permissions held by the creator in the panel.
  • Tenant-level ownership: Keys belong to the tenant account rather than an individual user, so teams revoke and rotate shared integration keys whenever staff members depart.

Location Scoping Boundaries vs. Account-Wide Resources

Multi-branch organizations often deploy local integrations per property or store. Limiting an API key to a specific location subtree restricts queries to hotspots, devices, and reports under that location. Because archival access logs, guest consent histories, vouchers, and unmasked guest profiles are account-wide operational assets, location-scoped keys are denied access to those scopes with an explicit authorization error.

Audited Unmasking via a Separate Unmasked-PII Scope

By default, guest endpoints return masked phone numbers and email addresses to prevent casual exposure of personal records. Accessing cleartext contact fields uses a separate opt-in unmasked personal data scope—disabled by default, assignable only by the account owner, valid only while the creator remains the active owner, and enforced with an explicit justification reason logged to the audit trail on every unmask call.

Idempotency, Cursor Pagination, and Error Discipline

Network timeouts during batch voucher creation or user provisioning can tempt clients to retry blindly and trigger duplicate records. Mutating POST routes accept an Idempotency-Key header that preserves the initial response for 24 hours, ensuring safe retries without double execution. Collection endpoints default to 50 items per page and advance deterministically via cursor pagination tokens.

curl -X POST https://<your-api-host>/api/public/v1/vouchers   -H "Authorization: Bearer <your-api-key>"   -H "Idempotency-Key: hotel-erp-batch-20260822-01"   -H "Content-Type: application/json"

Client error handlers should distinguish three response classes: 401 for invalid, revoked, or expired credentials; 403 for IP_NOT_ALLOWED, SCOPE_DENIED, suspended accounts, disabled API modules, or expired-subscription write blocks; and 429 when per-minute quotas are exhausted, respecting the Retry-After header. Fourteen-day per-key telemetry in the panel tracks successful, rejected, and rate-limited volume.

Core Resource Endpoints and Scope Separation

Routes under /api/public/v1 cleanly separate reporting reads from operational mutations. Dashboards and occupancy monitors consume GET /reports/visits, GET /hotspots/{id}/occupancy, and GET /sessions/live, whereas operational bridges trigger POST /sessions/{id}/disconnect, POST /vouchers, or POST /local-users and assign speed profiles via PUT /local-users/{id}/profile. For dedicated access-log archives, POST /log5651/exports (an endpoint path named after Türkiye's access-logging baseline) initiates an asynchronous archive and POST /log5651/exports/{id}/link generates a single-use, five-minute download link restricted exclusively to the originating API key. Issuing distinct keys for read-only BI pipelines versus mutating front-desk services minimizes blast radius when a credential needs rotation.

Minimal-Payload Outbound Webhook Architecture

Rather than polling REST endpoints continuously, outbound webhooks notify your server immediately when guest sessions start or end, devices go offline, access log silence occurs, vouchers redeem, or PMS check-ins arrive. Webhook endpoints use public HTTPS URLs reachable over the internet; private IPv4/IPv6 ranges (10.x, 192.168.x, 172.16–31.x), loopback interfaces, CGNAT blocks, and cloud metadata endpoints are blocked at registration and re-validated after DNS resolution on every delivery to mitigate SSRF and DNS rebinding, with redirects disabled.

By design, webhook payloads omit personal guest attributes—guest names, phone numbers, emails, MAC addresses, and client IPs are not included in push notifications. Payloads supply only event identifiers, timestamps, tenant IDs, and resource UUIDs; receivers needing detailed attributes query the REST API using a properly scoped key.

HMAC-SHA256 Signatures and Replay Protection

When registering an endpoint, Hotspotly displays a whsec_... signing secret once so receivers can authenticate every incoming request. Each delivery includes a Hotspotly-Signature: t=<timestamp>,v1=<signature> header calculated as the HMAC-SHA256 digest of the timestamp concatenated with a period and the exact raw JSON body.

<timestamp>.<raw-json-body>  -->  HMAC-SHA256(<signing-secret>)  ==>  v1

Essential Verification Steps on the Receiver

Verifying receivers compute the digest over raw request bytes before JSON parsing or re-serialization, compare signatures using a constant-time equality check, and reject requests whose timestamp falls outside a 5-minute window to guard against replay attacks. Because at-least-once delivery means the same event may arrive more than once, receivers deduplicate on the payload's unique id field. If a secret is suspected compromised, rotating it in the panel immediately invalidates the prior secret.

Backoff Retries, Dead-Letter Queues, and 3-Day Auto-Disable

Any 2xx HTTP response marks delivery complete, while 3xx redirects, 4xx/5xx errors, TLS failures, and timeouts are treated as failures. Failed deliveries retry with exponential backoff plus jitter—starting at 30 seconds, 1, 2, and 4 minutes up to a 6-hour interval—for 24 hours before moving to the dead-letter list.

Operators can inspect individual attempt statuses and payloads in the delivery log, replay single deliveries, or bulk-requeue up to 500 dead-lettered items with their original event IDs. If an endpoint fails continuously without a single successful delivery for 3 days, Hotspotly automatically disables it, moves queued items to the dead-letter list, and alerts the account owner so offline destinations can be repaired, re-enabled, and replayed.

Test Pings, Secret Rotation, and Delivery Hygiene

Before enabling production workflows on a new receiver, triggering a webhook.ping event from the panel validates TLS connectivity, firewall allowlists, and HMAC verification without incrementing endpoint failure counters. When rotating a signing secret, remember that the previous whsec_ value becomes invalid immediately, so updating your receiver's secret store promptly prevents rejected deliveries. Monitoring per-attempt status codes, latency, and error codes in the delivery log lets teams catch slow downstream handlers or expiring receiver certificates well ahead of the three-day auto-disable threshold.

Access-logging and privacy rules vary by country (with Law 5651 in Türkiye serving as one regional example); this technical article covering REST API scopes, access-log export endpoints, and webhook HMAC verification does not constitute legal advice, so consult your own legal counsel and local legal advisor regarding log export governance and privacy rules.

All posts