Rotate the secret
Send a POST request to the rotate endpoint with the desired grace period in seconds.gracePeriodSeconds field controls how long the old secret remains valid alongside the new one. Set it to 0 for an immediate cutover with no grace period.
How the grace period works
During the grace period, Off the Hook signs each delivery with both secrets. Thewebhook-signature header contains two space-separated v1, values:
Idempotency
Include anIdempotency-Key header on the rotation request to safely retry it without triggering a double rotation. If a request with the same key is already in flight, the API returns idempotency_in_flight. If a completed request with the same key is replayed, you receive the original response.
Rotation workflow
1
Rotate the secret
Call the rotate endpoint and save the new
whsec_... value returned in the response.2
Deploy the new secret
Update your environment variables or secrets manager with the new value and deploy your service. Your verification code does not need to change — the Svix library handles both signatures automatically during the grace period.
3
Confirm the grace period has elapsed
After the grace period expires, the old secret is no longer valid. Verify that your service is successfully processing deliveries signed only with the new secret.