Skip to main content
Every webhook POST from Botdog includes an X-Webhook-Signature header. Verifying it lets your endpoint reject forged requests and replays.

Header format

The secret is shown once when the webhook is created in the dashboard. Store it securely — typically in an env var or secret manager. You can rotate it from the same screen.

Verification algorithm

  1. Read the X-Webhook-Signature header and split on , to get t=… and s=….
  2. Read the raw request body as a string. Do not re-serialize it — even reordering keys will change the bytes and break the signature.
  3. Compute HMAC-SHA256(secret, "{t}.{rawBody}") and hex-encode the result.
  4. Compare the computed value with s using a constant-time comparison (e.g. crypto.timingSafeEqual).
  5. Optionally reject requests where t is older than a few minutes to defeat replay attacks.

Examples

Node.js (Express)

Capture the raw body before JSON parsing so the bytes match what Botdog signed.

Python (Flask)

Ruby (Sinatra)

Common verification failures

Rotating the secret

If a secret may have been exposed, rotate it from the Webhooks dashboard. Update your endpoint with the new value as soon as possible — deliveries signed with the old secret will fail verification after rotation.