- Poll
GET /events. - Receive webhooks: register a webhook endpoint and Alex sends each event to it.
The event object
data holds the ids of what changed and the few fields needed to route the event. Fetch the object for its current state. By the time you read an event, the object may have changed again.
Event types
job.deleted fires once per job, whether it was deleted or deleted permanently. A permanent delete also removes the job’s applications and interviews, and emits no event for them: after a job.deleted, a 404 for one of the job’s applications or interviews means it was removed with the job.
stage and previous_stage are null when the application had no stage. Handoff events are emitted only when the handoff’s status actually changes.
New event types may be added. Ignore types you don’t recognize.
Polling events
GET /events lists events oldest first, filtered by type and created_since. Page through with cursor while has_more is true.
An event younger than 10 seconds is held back from the list, so one whose write committed late still appears after the pages you’ve read. GET /events/{id} returns an event at once.
As with every list, next_cursor is null on the last page. To resume on your next poll, save the id of the last event you handled and pass it as after:
next_cursor for the pages after that; after can’t be combined with cursor. An after that isn’t the id of one of your events from the last 30 days returns 400 parameter_invalid, as does a cursor that names an event older than 30 days: start again with created_since.
Webhook endpoints
Register an HTTPS URL with the event types it should receive, or"*" for every type:
secret, which starts with whsec_. It is shown only here and when you rotate it, so store it. An idempotent replay of either response has secret: null.
The URL must use https and its host must resolve only to public addresses; otherwise the request returns 400 parameter_invalid on url.
Receiving a webhook
Alex sends each event as aPOST with the event object as its JSON body and these headers:
Answer with any
2xx status within 5 seconds. Anything else, including a redirect, is a failed attempt. Do slow work after you answer.
Deliveries can arrive more than once and out of order. Use Alex-Event-Id to drop duplicates, and the event’s created_at, or a fresh read of the object, to decide what is current.
Verifying the signature
v1 is the hex HMAC-SHA256 of <t>.<raw request body>, keyed with the whole secret string, whsec_ included. Compute it over the raw bytes you received, before parsing the JSON:
Retries and disabling
A failed delivery is retried up to 8 attempts in all, about 1 minute, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and 6 hours apart: about 24 hours from the first attempt. When deliveries to an endpoint keep failing for 3 days, Alex disables it:enabled becomes false and disabled_reason becomes "failing". Events meant for a disabled endpoint are not sent. Fix the endpoint, then turn it back on with PATCH /webhook-endpoints/{id} and {"enabled": true}, and catch up on what you missed with GET /events.
Rotating the secret
POST /webhook-endpoints/{id}/rotate-secret returns a new secret. The old one stops at once, and deliveries already queued are signed with the new one, so update your receiver as soon as you rotate.
v1 webhooks
The v1 webhooks are separate and keep working. TheirreportId is the interview’s id in v2.