Skip to main content
The client.webhooks namespace wraps the webhook management API. Use it to register endpoints, adjust filters, rotate signing secrets, and verify deliveries in your handler. For the full event catalogue and payload shapes, see the Webhooks tab.

Create a webhook

Each webhook subscribes to a single event and delivers to one HTTPS endpoint. Pass optional filters to narrow the deliveries and a secret to enable signature verification.
The secret you provide (or one generated via rotateSecret) is returned once and never echoed back. Store it somewhere your handler can reach.

List webhooks

list supports limit, offset, and filtering by event or status. Pagination is offset-based, so walk pages by incrementing offset:

Fetch one webhook

Update a webhook

update is a partial update. Pass only the fields you want to change. You can pause or resume a webhook by setting status.

Test a webhook

test delivers a synthetic payload to the configured URL so you can confirm your handler is reachable and verifies signatures correctly. Use it any time you change the URL or the signing secret.

Rotate the signing secret

rotateSecret issues a new HMAC secret and invalidates the previous one immediately. The new value is returned once.

Delete a webhook

Discover available events

listEvents returns every event type you can subscribe to, along with the filter keys each one accepts. This is the source of truth for what to pass as event and filters.

Verifying deliveries

Every delivery includes two headers your handler should inspect: Recompute the HMAC over the raw bytes of the request body and compare with a constant-time check. Parsing the body to JSON before hashing will break the comparison.
Always hash the raw body bytes, not the parsed JSON. Middleware that parses JSON before your handler runs (for example, Express’s default body-parser) will make verification fail. Mount express.raw on the webhook route as shown above.

Handling deliveries

Every delivery arrives as a JSON WebhookDeliveryEnvelope wrapping the event-specific payload:
WebhookEvent is a discriminated union over every supported event, keyed on the event field. Each variant narrows data to the matching payload shape, so a single switch gives you full type safety across every event type you subscribe to.

Envelope

The fields on every delivery (before narrowing on event):

Per-event payload types

Each payload type is exported directly for cases where you want a narrow parameter type without a switch:
You can also map an event name to its payload with WebhookEventPayloadMap:

Dispatching with a handler map

For larger codebases, a record of per-event handlers keeps each one typed without a giant switch:

Ignoring test deliveries

Test deliveries carry the same payload shape but append _test to the event name. Drop the suffix when you want to route a test through the same handlers as the real event, or reject them outright when running in production.

Responding to deliveries

Return any 2xx status within 10 seconds to acknowledge a delivery. Non-2xx responses and timeouts trigger retries with exponential backoff. See Webhook Response Format for the full retry policy and payload envelope.
Last modified on June 16, 2026