How email webhooks work (they're POST)

An email event sent as a signed JSON POST to a webhook URL on your server

An email webhook is an HTTP POST. When something happens to a message (delivered, bounced, opened, clicked, complained), your provider sends a signed JSON body to a URL you registered. You verify the signature, return a 2xx quickly and do slow work afterwards. Reading a mailbox over IMAP or polling an API is a different job.

Unitpost ·

Email webhooks work the way Stripe's and GitHub's do. Something happens to a message, and the provider sends an HTTP POST about it to a URL you registered. No mailbox is involved.

What gets POSTed

A JSON envelope with the event type, the message id and enough fields to update your own records. Unitpost's envelope is { type, source, created_at, event_id, workspace_id, data }. You don't fetch anything over IMAP: you sent the message, and the webhook tells you what happened to it.

On Unitpost, webhooks are signed with HMAC-SHA256, retried on failure, and kept in a delivery log for 30 days.

Verify, then 2xx

Check the signature against the raw request body. If you parse the JSON and serialize it again, the bytes change and the HMAC won't match. Unitpost signs with svix-compatible headers (svix-id, svix-timestamp, svix-signature), and the Node SDK's verifyWebhook() does the check for you.

Return a 2xx as soon as the event is stored somewhere durable, and do the slow work after you respond. Unitpost waits 10 seconds for an answer. A timeout counts as a failure, so the same POST comes back later. Timeouts, 408, 429 and 5xx responses are retried; a permanent answer such as 400, 401 or 404 is not.

Inbound mail to your app runs through the same pipeline: an email.received event, delivered as a POST like every other event.

Frequently asked questions

Are email webhooks GET or POST?

POST. The provider pushes each event to your URL. If you were sending GET requests to the provider to ask what happened, that would be polling, and it isn't a webhook.

What if my endpoint is down?

The provider should retry with backoff and eventually stop. Unitpost retries 7 times over about 19 hours, suspends the endpoint after 20 deliveries in a row fail, and emails your workspace owners and admins when it does. Events that arrive while it's suspended are kept. Re-enable the endpoint once it's fixed, then replay or flush the missed deliveries from the log.

How do I avoid handling the same event twice?

Dedupe on the delivery id in the signature headers (svix-id on Unitpost), which stays the same across retries and replays. Write the handler so a repeat does nothing, because a slow response looks like a failure and the same POST arrives again.

Free to start

Start sending for free

$0/ mo

  • 5,000 emails / mo — no credit card
  • Your domain with DKIM, SPF & DMARC
  • REST API, SMTP & official SDKs
  • Visual editor + code templates
  • Open & click tracking + signed webhooks
  • 10,000 contacts · automatic suppression