Why verify?
Without verification, anyone who discovers your webhook URL could send fake requests, potentially triggering actions on spoofed events or exhausting your resources. Always verify in production.Signature format
timestamp= value ofX-Timestampheaderraw_json_payload= raw request body as string (do not parse JSON first)
Verification steps
- Read the raw request body as a string.
- Get
X-TimestampandX-Signaturefrom headers. - Compute
HMAC-SHA256(secret, timestamp + "." + body). - Compare with
X-Signatureusing constant-time comparison (e.g.crypto.timingSafeEqualin Node.js,hmac.compare_digestin Python). - Verify
X-Timestampis within 5 minutes of current time (replay protection).
Example (Node.js)
Example (Python)
Getting your secret
Your webhook secret is shown in the Dashboard when you configure your webhook URL. Store it in an environment variable (e.g.OPENMAIL_WEBHOOK_SECRET) and never commit it to version control.
Troubleshooting
See Setup for full server examples and local development.