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 asecret to enable signature verification.
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.
Handling deliveries
Every delivery arrives as a JSONWebhookDeliveryEnvelope 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 onevent):
Per-event payload types
Each payload type is exported directly for cases where you want a narrow parameter type without aswitch:
WebhookEventPayloadMap:
Dispatching with a handler map
For larger codebases, a record of per-event handlers keeps each one typed without a giantswitch:
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.