Webhook Signatures
Every webhook request includes a signature that you should verify to ensure the request came from JetEmail and hasn’t been tampered with.Signature Headers
Each webhook request includes these headers:Verifying Signatures
The signature is computed using HMAC-SHA256 with your webhook secret and the raw request body.- Node.js
- Python
- PHP
- Go
- Ruby
Security Best Practices
Always Verify Signatures
Never process webhook events without verifying the signature first. This prevents attackers from sending fake events to your endpoint.
Use HTTPS
Always use HTTPS for your webhook endpoint to ensure the payload is encrypted in transit.
Use Timing-Safe Comparison
Use constant-time string comparison functions to prevent timing attacks when verifying signatures.
Handle Duplicate Events
Use the
X-Webhook-ID header to detect and handle duplicate events. Store processed event IDs and skip duplicates.Replay Prevention
To prevent replay attacks, you can verify that the timestamp is recent:Rotating Secrets
If you need to rotate your webhook secret:- Generate a new secret in Dashboard → Webhooks
- Update your application to accept both the old and new secrets
- Once all events are using the new secret, remove the old one from your code