What arrives at an endpoint
The signature is
HMAC-SHA256 over {webhook-id}.{webhook-timestamp}.{body}, keyed with the endpoint’s secret. Custom endpoint headers are included in the request as configured, but the webhook-*, content-type, and user-agent headers cannot be overridden.
Secrets
Each endpoint has its own signing secret in the Standard Webhooks format,whsec_ followed by a base64 key. It is returned once when the endpoint is created. After that, it can be read over the API or revealed by the customer in the portal’s Secret tab:
Rotation
webhook-signature header, and Standard Webhooks verifiers accept a message when any of them matches. The consumer can switch to the new secret at their own pace inside the window without anything failing to verify.
Customers can rotate their own secrets in the portal. Read-only portal links hide secrets entirely.
What to tell your consumers
Verification is three checks, and Standard Webhooks libraries do all of them given the raw body, the three headers, and thewhsec_ secret:
- Recompute
HMAC-SHA256(secret, "{webhook-id}.{webhook-timestamp}.{raw body}")and compare it against each offered signature, in constant time. - Reject stale
webhook-timestampvalues. Libraries default to a few minutes of tolerance. - Dedupe on
webhook-id, since delivery is at-least-once.
Continue
Customer portal
Where customers reveal and rotate these secrets themselves.
Delivery & retries
The pipeline every signed request travels through.
Customers & endpoints
Endpoint creation, where each secret starts.