Replace a webhook's signing secret
POST
/event-subscriptions/{id}/rotate-secret
const url = 'https://app.surveyrock.com/api/v1/event-subscriptions/example/rotate-secret';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Responses
Section titled “Responses”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