How signing works
- DeepSmith constructs the full JSON payload (envelope + data)
- The JSON string is signed using HMAC-SHA256 with your webhook’s
signing_secretas the key - The signature is sent in the
X-Webhook-Signatureheader, prefixed withsha256=
Verification steps
1
Extract the signature header
Read the
X-Webhook-Signature header from the incoming request.2
Compute the expected signature
Calculate
sha256= + HMAC-SHA256 of the raw request body using your signing secret.3
Compare using constant-time comparison
Use a timing-safe comparison function to prevent timing attacks.
Code examples
- Node.js
- Python
- PHP
- Go
HTTP headers
Every webhook delivery includes these headers:Idempotency
TheX-Webhook-Delivery header contains a unique UUID for each delivery attempt. Use this to deduplicate events if your endpoint receives the same delivery more than once (e.g., due to retries where your server processed the event but failed to return a 2xx response).
Security best practices
Always verify signatures
Never process a webhook without verifying the signature first.
Use HTTPS
Always use HTTPS endpoints. DeepSmith will deliver to HTTP URLs, but HTTPS prevents payload interception.
Use constant-time comparison
Avoid
== or === for signature comparison. Use timingSafeEqual, hmac.compare_digest, or hash_equals.Store secrets securely
Keep your signing secret in environment variables or a secrets manager, never in source code.