Webhooks are available on Pro and Enterprise plans. WebSocket subscriptions
provide similar functionality for real-time client applications.
Setting Up Webhooks
1. Create a Webhook Endpoint
Create an HTTPS endpoint on your server to receive webhook events:2. Register the Webhook
Register your endpoint in the Admin Console or via API:Webhook Events
Player Events
| Event | Description |
|---|---|
player.created | New player identified |
player.updated | Player data changed |
player.level_up | Player reached new level |
player.badge_earned | Player earned a badge |
Quest Events
| Event | Description |
|---|---|
quest.started | Player started a quest |
quest.progress | Quest progress updated |
quest.completed | Player completed a quest |
Adventure Events
| Event | Description |
|---|---|
adventure.started | Player started an adventure |
adventure.completed | Player completed an adventure |
Leaderboard Events
| Event | Description |
|---|---|
leaderboard.rank_changed | Player’s rank changed significantly |
leaderboard.new_leader | New #1 on leaderboard |
Lobby Events
| Event | Description |
|---|---|
lobby.created | New lobby created |
lobby.started | Lobby game started |
lobby.ended | Lobby closed |
Webhook Payload
All webhook payloads follow this structure:| Field | Description |
|---|---|
id | Unique event ID (for idempotency) |
type | Event type |
projectId | Your project ID |
createdAt | ISO 8601 timestamp |
data | Event-specific payload |
Security
Signature Verification
All webhooks include a signature header for verification:Best Practices
Always verify signatures
Always verify signatures
Never process webhooks without verifying the signature first.
Use HTTPS
Use HTTPS
Always use HTTPS endpoints for webhooks.
Respond quickly
Respond quickly
Return 200 within 30 seconds. Process events asynchronously.
Handle duplicates
Handle duplicates
Use event IDs to deduplicate. Webhooks may be retried.
Retry Policy
Failed webhooks are retried with exponential backoff:| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 1 minute |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
Managing Webhooks
List Webhooks
Update Webhook
Delete Webhook
Test Webhook
Send a test event to verify your endpoint:Webhook Logs
View webhook delivery logs in the Admin Console:- Delivery status (success, failed, pending)
- Response code and body
- Retry count
- Event payload