API referenceWebhooks

Rotate the signing secret

POST
/webhooks/{id}/rotate-secret

Generates a new secret that signs the next deliveries and appears only in this response. The replaced secret keeps signing beside it for expires_in seconds, a day by default, so each delivery carries a v1 for both and a receiver still holding the old secret accepts it while it switches. Send expires_in: 0 to retire the old secret at once, as after a leak. A retry with the same Idempotency-Key answers the first rotation's secret and rotates nothing.

Authorization

apiKey
X-API-Key<token>

API key (prefix spk_test_ or spk_live_) or personal access token (prefix pat_)

In: header

Path Parameters

id*string

Subscription ID

Header Parameters

Idempotency-Key*string

Idempotency key that prevents processing a request twice. Use a unique UUID v4 per request.

Lengthlength <= 255

Request Body

application/json

expires_in?integer

Seconds the replaced secret keeps signing each delivery beside the new one, so a receiver can switch secrets without rejecting a delivery: 0 retires it at once; 86400 (a day) when absent; at most 604800 (7 days)

Formatint64
Range0 <= value <= 604800

Response Body

application/json

application/json

curl -X POST "https://example.com/webhooks/whs_abc123/rotate-secret" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{}'
{  "secret": "string"}