Rotate webhook secrets
Who this is for: admins who manage webhooks, for example after a secret leaked or on a regular schedule.
Before you start: you must be signed in as a person with the Manage webhooks permission. AI assistants and API tokens cannot rotate secrets, and nobody can show one later.
Rotating makes a new signing secret and shows it to you once. The previous secret keeps working for a grace period, so you have time to give the new one to the sender. No event is lost if you update the sender before the grace period ends.
Rotating is also how you get a secret to copy when nobody copied it when the webhook was made, for example when your AI assistant made the webhook.
- Open Webhooks and select the webhook.
- Under Signing secret, select Rotate secret.
- Set Grace period in hours: 0 to 168. The default is 24. 0 stops the previous secret at once: use it when the old secret leaked.
- Select Rotate. The page shows the new secret with Copy this secret now. It won’t be shown again, not even to an admin., and until when the previous secret still works.
- Select Copy the secret and put it into the sender (its settings, or its secret store).
- Select I’ve copied it. The secret disappears from the page and nobody can show it again.
- Send a test event to check it. See Check that it works.
If you close the page before you copied the secret, rotate again.
During the grace period
Section titled “During the grace period”- Liitora accepts events signed with either secret.
- A sender that uses the Liitora scheme may send both signatures in one header while it switches:
X-Liitora-Signature: sha256=<new>,sha256=<old>. Up to 5 signatures are allowed and one must match. - For webhooks checked with A token in each request or A username and password in each request, both the old and the new secret are accepted as the token or password.
- It can take up to about 10 seconds before the webhook receiver uses the new secret.
When the grace period ends
Section titled “When the grace period ends”Events signed with the previous secret get 401 with the code unauthorized. The sender must use the new secret. If you missed it, rotate again: there is no way to bring the old secret back.
Stripe webhooks
Section titled “Stripe webhooks”Stripe creates the signing secret of a Stripe webhook, so Rotate secret does not apply to it (the error is provider_managed_secret).
- In the Stripe Dashboard, open the webhook endpoint and roll its signing secret. Stripe can keep the old secret valid for a while.
- Copy the new secret.
- In Liitora, open Secrets, find the webhook’s secret and select Rotate. Paste the new value.
With the API
Section titled “With the API”People can also rotate through the API while signed in: POST /api/v1/webhook-endpoints/{id}/rotate-secret with {"grace_hours": 24}. The answer carries the new secret once, in signing_secret, and is never cached. API tokens are refused.