Skip to content

Replace a webhook's signing secret

POST
/event-subscriptions/{id}/rotate-secret
curl --request POST \
--url https://app.surveyrock.com/api/v1/event-subscriptions/example/rotate-secret \
--header 'Authorization: Bearer <token>'

Generates a new secret and returns it once in data.secret. The previous secret keeps signing for 24 hours alongside the new one (the webhook-signature header carries both), so a receiver can switch without missing a delivery; previous_secret_expires_at says when. Rotating again inside that window drops the older secret. Not covered by Idempotency-Key, because that would store the secret.

The workspace’s owners and admins are emailed.

id
required
string

data.secret is the new signing secret, shown once

The plan does not include webhooks (feature_locked), or the token lacks events:write

subscription_not_found

subscription_is_pull: an event feed has no secret