Skip to content

Outbound Signature Verification

Signature verification lets your receiver confirm that a webhook request actually came from HookBridge and was not modified in transit.

Use it to:

  • block spoofed webhook requests
  • prevent payload tampering from being accepted
  • enforce a timestamp window to reduce replay risk

Each outbound delivery includes:

  • X-Webhook-Signature
  • X-Webhook-Timestamp

Signature format (single key):

X-Webhook-Signature: sha256=<hex>

During signing key rotation, both keys produce signatures in the same header:

X-Webhook-Signature: sha256=<hex1>,sha256=<hex2>

Your receiver should split on , and accept the request if any signature is valid.

Verification input:

timestamp + "." + raw_request_body

Important: use the raw request body bytes exactly as received.

  1. Open Endpoints and select your outbound endpoint.
  2. Copy the endpoint signing secret.
  3. In your receiver service, verify X-Webhook-Signature for every request.
  4. Reject invalid signatures with 401.
  5. If a secret is exposed, rotate it in endpoint settings and update your receiver.

API reference:

Terminal window
curl https://api.hookbridge.io/v1/endpoints/YOUR_ENDPOINT_ID \
-H "Authorization: Bearer YOUR_API_KEY"

See Signing Key Rotation for the full zero-downtime rotation workflow.

Terminal window
# Add new key
curl -X POST https://api.hookbridge.io/v1/endpoints/YOUR_ENDPOINT_ID/signing-keys \
-H "Authorization: Bearer YOUR_API_KEY"
# After updating your receiver, delete the old key
curl -X DELETE https://api.hookbridge.io/v1/endpoints/YOUR_ENDPOINT_ID/signing-keys/OLD_KEY_ID \
-H "Authorization: Bearer YOUR_API_KEY"

Use this to send a signed test request to your receiver endpoint and validate your verification logic.

Terminal window
TIMESTAMP=$(date +%s)
PAYLOAD='{"event":"order.created","order_id":"ord_123"}'
SIGNING_SECRET='YOUR_SIGNING_SECRET'
SIGNATURE_HEX=$(printf '%s.%s' "$TIMESTAMP" "$PAYLOAD" \
| openssl dgst -sha256 -hmac "$SIGNING_SECRET" -hex \
| sed 's/^.* //')
curl -X POST https://your-receiver.example/webhooks \
-H "Content-Type: application/json" \
-H "X-Webhook-Timestamp: $TIMESTAMP" \
-H "X-Webhook-Signature: sha256=$SIGNATURE_HEX" \
-d "$PAYLOAD"
  • Read raw body bytes (not parsed/re-serialized JSON).
  • Validate timestamp freshness (for example 5 minutes).
  • Compare signatures with constant-time comparison.
  • Return non-2xx for invalid signatures.
  • Monitor signature failures for possible secret/config issues.
Personalize Examples

Enter your credentials to populate code examples throughout the docs.