Skip to main content
Every webhook request includes a cryptographic signature so you can verify it came from Allo. Without verification, an attacker could send fake events to your endpoint.

Signature headers

Each webhook POST includes three headers:

Signing secret

When you create a webhook endpoint, the response includes a signing_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

  1. Strip the whsec_ prefix from your signing secret.
  2. Base64-decode the remaining string to get the key bytes.
  3. Compute HMAC-SHA256 of the signed content using the key bytes.
  4. 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.
Always use the raw request body for verification. If your framework parses JSON and re-serializes it, the signature will not match.

Code examples

Always verify signatures in production. Skipping verification exposes your application to spoofed webhook events.