Webhooks
Webhooks let IronWiFi push real-time event notifications to your application. Instead of polling the API for changes, your server receives an HTTP POST request whenever a relevant event occurs -- such as a user authenticating, a session starting, or account data changing.
Overview
Common use cases:
- Trigger a welcome email when a guest authenticates via captive portal
- Update your ticketing system when authentication fails repeatedly
- Sync session data to your analytics platform in real time
- Disable building access when a WiFi session ends
- Log events to a SIEM for security monitoring
Configuring Webhooks
Creating a webhook endpoint
- Log in to the IronWiFi Console
- Navigate to Account > Webhooks
- Click Add Webhook
- Configure:
| Setting | Description |
|---|---|
| URL | Your HTTPS endpoint that will receive the webhook payloads |
| Events | Select which event types to subscribe to |
| Secret | A shared secret for verifying webhook signatures |
| Status | Enable or disable the webhook |
- Click Save
Your webhook endpoint must use HTTPS. IronWiFi does not send webhooks to plain HTTP URLs to protect payload data in transit.
Endpoint requirements
Your webhook receiver must:
- Accept HTTP POST requests
- Return a status code within 10 seconds to acknowledge receipt
200 - Handle JSON payloads with
Content-Type: application/json - Be publicly accessible from IronWiFi's servers
Event Types
Authentication events
| Event | Trigger | Use Case |
|---|---|---|
| User successfully authenticates | Log successful access, trigger welcome flow |
| Authentication attempt rejected | Alert on repeated failures, security monitoring |
| RADIUS challenge issued | Track multi-step authentication flows |
Session events
| Event | Trigger | Use Case |
|---|---|---|
| New user session begins | Track occupancy, start billing |
| Interim accounting update received | Monitor bandwidth usage in real time |
| User session terminates | Stop billing, update access control |
User events
| Event | Trigger | Use Case |
|---|---|---|
| New user account created | Sync to external systems, send welcome email |
| User account modified | Propagate changes to integrated systems |
| User account removed | Revoke access in connected systems |
Voucher events
| Event | Trigger | Use Case |
|---|---|---|
| Voucher code used for authentication | Track voucher usage, update inventory |
| Voucher reaches expiration | Clean up expired access records |
Payload Format
All webhook payloads follow a consistent JSON structure:
Authentication event payload
Session event payload
User event payload
Signature Verification
Every webhook request includes a signature header that lets you verify the payload came from IronWiFi and was not tampered with.
How it works
- IronWiFi computes an HMAC-SHA256 hash of the raw request body using your webhook secret
- The hash is included in the header
X-IronWiFi-Signature - Your server computes the same hash and compares it
Verification examples
Python
Node.js
PHP
Always verify the webhook signature before processing the payload. Without verification, an attacker could send forged requests to your endpoint.
Retry Logic
IronWiFi retries failed webhook deliveries with exponential backoff:
| Attempt | Delay After Failure |
|---|---|
| 1st retry | 1 minute |
| 2nd retry | 5 minutes |
| 3rd retry | 30 minutes |
| 4th retry | 2 hours |
| 5th retry | 12 hours |
A delivery is considered failed if:
- Your endpoint does not respond within 10 seconds
- Your endpoint returns a non-2xx HTTP status code
- The connection cannot be established (DNS failure, network error)
After 5 failed retries, the webhook event is marked as failed and no further attempts are made.
Handling retries in your application
Your webhook handler should be idempotent -- processing the same event twice should not cause problems. Use the
id
Testing Webhooks
Using a test endpoint
During development, use a service like webhook.site or ngrok to inspect incoming webhook payloads:
- Get a temporary URL from webhook.site
- Configure it as your webhook endpoint in the IronWiFi Console
- Trigger an event (e.g., authenticate a test user)
- Inspect the received payload on webhook.site
Testing with cURL
Simulate a webhook delivery to test your handler locally:
Best Practices
- Respond quickly -- Return immediately and process the event asynchronously. Do not perform slow operations in the webhook handler itself.
200 - Verify signatures -- Always validate the header before processing.
X-IronWiFi-Signature - Handle duplicates -- Use the event to implement idempotent processing.
id - Log everything -- Log received payloads and processing results for debugging.
- Monitor delivery -- Check the webhook delivery status in the IronWiFi Console for failed deliveries.
- Use a queue -- For high-volume deployments, push incoming webhooks to a message queue (RabbitMQ, SQS, Redis) and process them asynchronously.
- Keep secrets secure -- Store your webhook secret in environment variables, not in source code.
Troubleshooting
Webhooks not received
- Verify the endpoint URL is correct and publicly accessible
- Check that the webhook is enabled in the IronWiFi Console
- Confirm your firewall allows inbound HTTPS connections
- Check if the event type you expect is selected in the webhook configuration
Signature verification failing
- Ensure you are comparing against the raw request body (not a parsed/re-serialized version)
- Verify the webhook secret matches exactly between IronWiFi and your code
- Check that you are reading the header correctly
X-IronWiFi-Signature
Events arriving late
- Check the retry history in the IronWiFi Console -- previous delivery attempts may have failed
- Verify your endpoint responds within 10 seconds
- If your server was temporarily down, events will arrive after the retry delay
Related Topics
- REST API -- API overview and authentication
- API Authentication -- API key management
- API Endpoints -- Complete endpoint reference
- Error Codes -- API error reference
- Reporting and Analytics -- Report data available via API
Was this page helpful?