Webhook-Signature header. You should verify this signature to confirm the request is authentic and hasn’t been tampered with before acting on it.
The signature is computed using HMAC-SHA256 over the delivery ID, timestamp, and raw request body.
Signature format
TheWebhook-Signature header contains one or more signatures in the format:
Verification steps
Extract the headers
Read the
Webhook-Signature, Webhook-Id, and Webhook-Timestamp headers from the incoming request.Prepare the signed payload
Concatenate the timestamp, the delivery ID, and the raw request body, separated by periods (
.):Compute the expected signature
Compute an HMAC-SHA256 using your webhook signing secret as the key and the prepared string as the message.
Use the raw request body when computing the HMAC. Parsing the JSON first and re-serializing it can silently alter the payload — for example, some languages round floating-point numbers or reorder keys — which will cause the signature check to fail.
Examples
Secret rotation
When we rotate a webhook signing secret, both the old and new secrets remain active during a transition period. During this window, we sign each delivery with all active secrets and include their signatures in theWebhook-Signature header, separated by spaces. For example:
- We’ll notify you that a rotation is starting.
- Both the old and new secrets become active — deliveries are signed with both.
- You have 48 hours to update your verification code to use the new secret.
- After 48 hours, the old secret is retired and only the new secret will be used to sign deliveries.
Rejecting stale webhooks
To protect against replay attacks, we recommend checking theWebhook-Timestamp header and rejecting any webhook where the timestamp is more than 5 minutes from your server’s current time.