Why verify?
Anyone who finds your webhook URL can send it fake requests. Verification proves the request came from OpenMail. Always verify in production.Pick your scheme
Each endpoint uses one scheme. OpenMail picks it from the Auth header or secret field when you add or edit the endpoint on the Webhooks page:
The endpoint page shows which scheme it uses under Authentication.
OpenMail signature
Leave the field empty and OpenMail generates a secret for the endpoint. Every request carries:Signature format
timestamp= value of theX-Timestampheaderraw_json_payload= raw request body as a string (do not parse the JSON first)
Verification steps
- Read the raw request body as a string.
- Get
X-TimestampandX-Signaturefrom the headers. - Compute
HMAC-SHA256(secret, timestamp + "." + body)as hex. - Compare it with
X-Signatureusing constant-time comparison (e.g.crypto.timingSafeEqualin Node.js,hmac.compare_digestin Python). - Check
X-Timestampis within 5 minutes of the current time (replay protection).
Getting your secret
Open the endpoint on the Webhooks page. Under Authentication, click the eye icon to reveal the signing secret, or the copy icon to copy it. Store it in an environment variable (e.g.OPENMAIL_WEBHOOK_SECRET) and never commit it to version control.
To replace it, open the endpoint’s actions menu and click Rotate secret. The old secret stops working immediately.
Standard Webhooks
Paste awhsec_ secret and OpenMail signs each request per the Standard Webhooks spec. Use this for receivers that already verify Standard Webhooks, such as Grok automations.
The part after whsec_ must be base64. Every request carries:
Signature format
Verification steps
- Read the raw request body as a string.
- Strip
whsec_from your secret and base64-decode the rest. This is the HMAC key. - Compute the signature over
{webhook-id}.{webhook-timestamp}.{body}. - Compare it with the value after
v1,inwebhook-signature, in constant time. - Check
webhook-timestampis within 5 minutes of the current time.
Getting your secret
You create thewhsec_ secret, or the receiving platform gives you one. To make your own:
Bearer token
Paste any other value and OpenMail sends it as a bearer token. You can paste the wholeAuthorization: Bearer … header or just the token. Every request carries:
The request is not signed and has no timestamp. Compare the token with the one you expect, in constant time:
Node.js
A bearer token proves who sent the request, but not that the body is unchanged, and it gives no replay protection. Use it for receivers that only accept a token, and only over HTTPS. Prefer a signature when your receiver supports one.
whsec_ secrets, OpenMail never shows the token again. Click Replace under Authentication to change it.
Troubleshooting
See Setup for full server examples and local development.