2026-04-19
Webhook secret rotation with dual-signature grace window
featuresecurity
Webhook secret rotation was previously a breaking change — rotating meant every consumer had to update simultaneously. Now it’s a two-stage flow:
- Call
POST /api/webhooks/:id/rotate-secret. Rungate generates a new secret and enters a grace window (default 7 days, configurable). - During the grace window, outbound deliveries are signed with both secrets. Consumers can verify against either.
- After the window closes, only the new secret signs. Consumers that haven’t updated fail verification.
API: POST /api/webhooks/:id/rotate-secret accepts { grace_period_days: number }. Returns the new secret in the response body (only time it’s visible).
Migration: existing webhooks are unaffected. Migration 035 adds the rotated_secret_hash and rotation_expires_at columns.
Closes issue #109.