Skip to main content

Webhook events

An event is the record of something that happened in the organization — a token created, a token revoked. When you register an endpoint, you select the events it wants to receive; each time one of them happens, Magic Dashboard sends a delivery to the endpoint.

Available events​

Today the events available for webhooks are those of API tokens:

EventWhen it happens
api_key.db.createdA token was created — including the new token of a rotation, which carries predecessor_id.
api_key.db.updatedA token's data changed: name, description, expiration, notice emails or status.
api_key.db.deletedA revoked token was removed from the list.
api_key.status_changedA token's status changed (active, disabled or revoked).
api_key.rotatedA token was rotated. It carries successor_id and grace_until, the end of the period during which the old token is still valid.
api_key.revokedA token was revoked.

These events happen when tokens are managed in Magic Dashboard itself (see API tokens). Tokens created in the Kobana Account don't generate events here.

Payload format​

Every event arrives in the same envelope, in JSON with snake_case fields:

{
"id": "9f8b2c14-3a5d-4e77-9b10-2c6e5f0a1d33",
"type": "api_key.status_changed",
"created_at": "2026-10-05T10:30:00.000Z",
"data": { },
"changes": {
"status": { "from": "active", "to": "disabled" }
},
"environment": "production",
"version": "2026-03-01"
}
FieldWhat it is
idThe event ID. Use it to avoid processing the same event twice.
typeThe event, such as api_key.status_changed.
created_atWhen the event happened, in ISO 8601 (UTC).
dataThe resource in its current state, in the same format as the API.
changesOnly in *.status_changed events: what changed, in the format {"field": {"from": old, "to": new}}.
environmentThe environment that sent it, such as production or sandbox.
versionThe payload format version. New fields may appear; treat them as optional.

The event sent by Test Webhook has type equal to test.webhook and a data with a test message. It is for checking the connection and the signature; don't treat it as a real event.

The full reference — headers, signature and code examples — is in the API webhooks reference.