Skip to main content

Rotate the webhook signing secret

POST 

/v1/webhooks/:webhook_id/rotate-secret

Register a new signing secret for a subscription and schedule when it takes over. Requires the connector:webhooks:rotate-secret scope and an Idempotency-Key header.

Like the initial secret, the new secret is chosen by your bank, is write-only and is never returned. Give it a new secret_version label (1 to 64 printable ASCII characters without spaces) so you can tell the secrets apart.

How the switch works. Every delivery is signed with exactly one secret, the active one, and names it in the X-DAN-Secret-Version header.

  • Before activate_at, deliveries keep using the current secret.
  • From activate_at (a time in the past or now means immediately) the new secret becomes active. The platform checks for due secrets about every 10 seconds and caches the active secret for up to 30 seconds, so deliveries signed with the previous version can still arrive for up to about a minute after activate_at. Retries of older events are re-signed with whichever secret is active at the time of the attempt.
  • The previous secret is kept as retiring for grace_period_seconds after activation and then expires. Send 0 to use the platform default of 86400 seconds (24 hours). Negative values are rejected.

Zero-downtime rotation. Deploy the new secret to your verifier first, keyed by its secret_version, while still accepting the old one. Then call this endpoint. Choose the secret by the X-DAN-Secret-Version header of each request, and remove the old secret once you no longer receive deliveries signed with it.

Request​

Responses​

Accepted. The new secret version is stored and activates at activate_at.