How email webhooks work (they're POST)

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.
