webhooks:manage scope.
Register an endpoint
Event types
Subscribe to what you act on. An endpoint may subscribe to between 1 and all 11 event types.
The envelope
Every delivery is a JSON body with a stable envelope:sequence orders events for a shipment. apiVersion identifies the payload contract.
Verifying the signature
Each request carries three headers:
The signed message is the delivery id, the timestamp, and the raw request body, joined with literal
. characters:
Compare in constant time, as above. Also reject deliveries whose
Webhook-Timestamp is far from your current clock — a valid signature on a very old request is a replay.Rotating the secret
previousSecretValidUntil on the endpoint. Until that moment both secrets produce valid signatures, so accept either during the overlap and drop the old one once it passes.
Responding to a delivery
Return a2xx quickly. Do the work afterwards — acknowledge receipt, then process asynchronously. A non-2xx or a timeout is treated as a failed attempt and retried.
Because retries exist, your handler must be idempotent: deduplicate on id, and ignore an event whose sequence you have already applied for that shipment.
Inspecting deliveries
GET /v2/external/webhook-deliveries/{deliveryId} to see its attempt history.
Replay
202 — it queues the delivery rather than performing it inline. A 409 means the delivery is not in a replayable state.
Testing an endpoint
Pausing
An endpoint isACTIVE or PAUSED. Pause it with a PATCH (carrying If-Match) while you deploy a change, rather than deleting and recreating it — deletion loses the secret and the delivery history.