Signature headers
Each webhook POST includes three headers:Signing secret
When you create a webhook endpoint, the response includes asigning_secret field. This secret has the format whsec_<base64key> and is used to verify signatures.
Store it securely — treat it like a password. If compromised, rotate it via the API.
Verification algorithm
1
Extract the headers
Get
webhook-id, webhook-timestamp, and webhook-signature from the request headers.2
Validate the timestamp
Reject requests where the timestamp is more than 5 minutes from your server’s current time. This prevents replay attacks.
3
Build the signed content
Concatenate the webhook ID, timestamp, and raw request body with periods:
4
Compute the expected signature
- Strip the
whsec_prefix from your signing secret. - Base64-decode the remaining string to get the key bytes.
- Compute HMAC-SHA256 of the signed content using the key bytes.
- Base64-encode the result.
5
Compare signatures
The
webhook-signature header may contain multiple signatures separated by spaces (for secret rotation). Each has a v1, prefix. Compare your computed signature against each one. If any match, the signature is valid.Code examples
- Node.js
- Python
- Go