POSTs a signed JSON event to an HTTPS endpoint you register, so you can update
your own database, notify a player, or kick off the next step in your product’s
logic.
Each delivery is signed with an Alakazam-Signature header you verify against
the raw request body, so you can trust that the event came from Alakazam and was
not tampered with in flight.
Register an endpoint
Webhook endpoints belong to an app and are managed with your Alakazam user session (the same token you use for app and key management), not an API key.POST the HTTPS url you want events delivered to, and optionally the list of
events to subscribe to. Omit events to register the default set of three:
world.generation.succeeded, world.generation.failed, and session.ended
(reserved: registered by default, but not yet delivered).
secret, prefixed whsec_. Use it to
verify every delivery from this endpoint.
List your endpoints
List the webhook endpoints registered for an app. The response is metadata-only: the signingsecret is never returned again after creation.
Delete an endpoint
Remove an endpoint to stop deliveries. Either verb works:DELETE, or POST
to the /delete sub-path for environments that can’t send DELETE.
Event types
Subscribe to any subset of these. Omittingevents registers the default set
of three: world.generation.succeeded, world.generation.failed, and
session.ended (reserved: registered by default, but not delivered yet).
Subscribe to * to also auto-enroll in new event types as they ship.
Generation events fire for async jobs: those you create with
async: true
on POST /v1/worlds and poll at GET /v1/jobs/{jobId}. A webhook lets you
skip the polling entirely.Event payload
Every delivery is aPOST with a JSON body in this envelope:
Respond with any
2xx status to acknowledge receipt. Any non-2xx, or a
network failure, is treated as a failed delivery and retried.
Verify the signature
Every request carries anAlakazam-Signature header:
tis the Unix timestamp (seconds) of the delivery.v1is the hex HMAC-SHA256, keyed by the endpoint’swhsec_signing secret, over the string`${t}.${rawBody}`: the timestamp, a literal., then the exact raw request body.
v1 with a constant-time comparison. Also check that t is recent (within, say,
five minutes) to reject replays.
Retries and ordering
Each event is attempted up to 3 times with exponential backoff per
endpoint. A delivery succeeds on any
2xx; anything else is retried until the
attempts are exhausted.- No ordering guarantee. Events may arrive out of order, and an occasional
duplicate is possible. Make your handler idempotent: key off the event’s
dataids (for examplejobIdorworldId) rather than assuming arrival order. - Acknowledge fast. Return
2xxas soon as you’ve verified and stored the event, then do slower work asynchronously, so a slow handler doesn’t trigger retries. - Per-endpoint signing. Each endpoint has its own
whsec_secret, so verify with the secret for the endpoint that received the request.
Where to get keys
Manage your apps and API keys from the developer dashboard. Webhook endpoints are registered through the API itself (POST /v1/apps/{id}/webhooks,
as above): the signing secret is returned once at registration.
