Choose events
An endpoint names the events it wants (
events), or * for all of them, including ones added later. Moving a sandbox between
nodes sends nothing: the sandbox lives on.
Read the payload
data is thin: ids, state, reason and time. Fetch the sandbox for anything more. The event id is stable for a state change:
the same change is never delivered under two ids, and a retry of one delivery carries the same webhook-id header. Deliveries
are at least once, so deduplicate on that id.
Manage endpoints
Endpoints belong to the account of the API key that creates them. An endpoint never receives another account’s events.
The URL must be
https.
Verify a delivery
Each request carrieswebhook-id, webhook-timestamp and webhook-signature. The signature is v1, plus the base64
HMAC-SHA256 of {id}.{timestamp}.{raw body}, keyed with the secret after its whsec_ prefix is base64-decoded. Verify the
raw bytes, before any JSON parsing, and refuse a timestamp more than five minutes old.
Retries and failures
Answer with any2xx within 15 seconds. Anything else is retried with growing waits (5 seconds, 5 minutes, 30 minutes, then
hours, ten attempts in all over about three days, each wait jittered). 410 Gone disables the endpoint, as does a long run of
failures; the delivery log says why. A failed delivery can be retried by hand from the log while its payload is kept (7 days).
Events are stored after the sandbox’s state change has been recorded, off the path of the sandbox call itself: a slow or
failing endpoint never slows a sandbox.