Skip to content

Rotate a webhook endpoint's secret

POST /v1/webhooks/{id}/rotate-secret

Gives the webhook endpoint a new signing secret.

Needs webhooks:write.

id string · uuid

The webhook endpoint’s ID.

overlap_hours integer

How long the old secret keeps signing. 0 stops it at once.

From 0 to 168. Default 24.

Idempotency-Key string

Makes this request safe to retry. See Retrying safely.

1 to 255 characters.

The old secret keeps signing for overlap_hours. Meanwhile every request carries both signatures in webhook-signature, separated by a space, so you can switch over without missing an event.

200 The new secret, shown this once, and when the old one stops signing.

secret string

The new signing secret, shown this once.

previous_secret_expires_at string · date-time · nullable

When the old secret stops signing; null when it already has.

Besides the ones every request can get:

422invalid_fieldThe overlap_hours is outside 0 to 168.
403scope_missingThe key lacks the read scope of an event the endpoint sends.
404not_foundThere is no webhook endpoint with this ID in your workspace.
409idempotency_in_progressA request with the same Idempotency-Key is still running.
422idempotency_mismatchThe Idempotency-Key was used before for a different request, or by another of your API keys.