cherami.
Guides

Receive webhook notifications

Get notified when mail arrives or a send is accepted, verify the delivery, then fetch the message through the API.

Read as Markdown ↗

Add a webhook and we POST to your https URL when a message arrives in an inbox (message.received) or a send is accepted (message.sent). Each notification carries the inbox and message IDs; fetch the message through the API. Set webhooks up in Account → Webhooks or with the API below.

A webhook needs something of yours listening at the URL, such as a server, a serverless function or a queue. An agent without one can poll instead.

Add a webhook

Choose the events and the inboxes. message.received fires when a received message is ready to read. message.sent fires when we accept a send for delivery; accepted is not delivered.

Leave out inbox_ids to cover every inbox in your account, including ones you create later, or list up to 10 inbox IDs:

curl --fail-with-body --silent --show-error \
  https://cherami.to/v1/webhooks \
  -H "Authorization: Bearer $CHERAMI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'EOF'
{
  "url": "https://example.com/hooks/cherami",
  "event_types": ["message.received"],
  "inbox_ids": ["INBOX_ID"]
}
EOF

The 201 response includes secret, the webhook's signing secret; you can retrieve it again later. Adding the same URL again creates a second webhook that receives the same events.

Use the final public https address: we refuse private addresses and don't follow redirects.

What a delivery contains

Every delivery is a POST with a JSON body like this:

{
  "id": "66666666-6666-4666-8666-666666666666",
  "type": "message.received",
  "timestamp": "2026-10-01T14:30:00.123Z",
  "data": {
    "inbox_id": "11111111-1111-4111-8111-111111111111",
    "message_id": "22222222-2222-4222-8222-222222222222"
  }
}

id is the event ID. timestamp is when the message became ready or the send was accepted. For message.received, data.message_id is a received message: read it with GET /v1/messages/{message_id}. For message.sent, it's a sent message: read it with GET /v1/sent/{message_id}.

Verify and acknowledge

Verify each delivery with a Standard Webhooks or Svix library and the webhook's secret; either works with these headers unmodified. Each delivery carries webhook-id, webhook-timestamp and webhook-signature, also sent as svix-id, svix-timestamp and svix-signature. To verify by hand:

  1. Build the signed string webhook-id.webhook-timestamp.body from the raw request body, exactly as received. Re-serializing parsed JSON changes whitespace and breaks the signature.
  2. Compute HMAC-SHA256 over that string with the secret, base64-decoded after removing its whsec_ prefix, and base64-encode the result.
  3. Accept if any space-separated v1,<signature> entry in webhook-signature matches, using a constant-time comparison. Several entries appear while a rotated secret is still signing.
  4. Reject a webhook-timestamp more than five minutes from your clock, to limit replays.

Respond with a 2xx within 15 seconds, once you've stored the event (in your queue or database), not after acting on it. A receiver that does the work first times out and gets the delivery again.

Delivery is at-least-once and unordered: deduplicate on the body's id, not the webhook-id header, and use timestamp for order.

Handle failures

While your receiver is down, mail is stored and readable through the API as usual. We retry each failed delivery for about a day, and disable a webhook whose deliveries keep failing; it then reads status: "disabled". Fix the receiver, set enabled: true, then poll for messages after the last event you handled. There is no resend.

See what was delivered

Delivery history shows what we sent and how your receiver answered, in Account → Webhooks and through the API. Use it to confirm an integration or find a missing notification:

  • Attempts for a webhook: each attempt to that URL, newest first, with its status, response code, duration, the event it carried and the start of your receiver's response.
  • Recent events: the events your account's mail produced, whichever webhooks they reached. Check here that an event exists before you debug the receiver.
  • One event by ID: the event and every attempt made for it across your webhooks. Start here when a receiver reports a duplicate or a gap.

Edit, rotate, delete

Change event types, inbox scoping or the enabled flag in Account → Webhooks or by updating the webhook. An event_types or inbox_ids array you send replaces the old one whole, and an empty inbox_ids returns the webhook to every inbox. The URL can't be edited: add a webhook for the new URL, confirm it receives, then delete the old one.

Custom headers are sent with every delivery, for a shared token your receiver checks alongside the signature, or for routing metadata. You can list header names later; values are never shown again.

Rotating the secret returns a new one. By default the old secret keeps signing for 24 hours alongside it, so you can update the receiver at your own pace; immediate: true retires the old secret at once.

Deleting a webhook stops its deliveries.

Agents and MCP hosts

MCP tools don't manage webhooks; use Account or the API. A webhook calls your URL, not the agent's conversation, so pair it with something that queues or starts the agent's work, or have the agent poll as the cookbooks do.

Webhook operations reference · Errors, limits and pagination

On this page