> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openmail.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> OpenMail webhook event reference — event types, full payload structure, and field descriptions for inbound email and reputation lifecycle (inbox/pod suspension and reactivation) events.

OpenMail sends webhooks when inbound email is received, and when the reputation engine suspends or reactivates one of your inboxes or pods. Emails dropped by [sender rules](https://docs.openmail.sh/concepts/sender-rules.md) (a block rule, or allowlist mode with no match) do not trigger events; they are discarded before threading and show up in the Allow/Block List [history](https://docs.openmail.sh/concepts/sender-rules.md#history) instead.

## Events

| Event | Description |
| - | - |
| `message.received` | A new inbound email was delivered to an inbox |
| `inbox.suspended` | An inbox was suspended (sending blocked) by the reputation engine or an admin |
| `inbox.reactivated` | A previously suspended inbox was reactivated |
| `pod.suspended` | A pod was suspended — every inbox in it is blocked from sending |
| `pod.reactivated` | A previously suspended pod was reactivated |

`inbox.*` and `pod.*` are **reputation lifecycle** events: they let you react when one of your end-users is cut off (for example, pause that agent) without your whole account being affected. We handle suspension automatically; these events tell you when it happens. They are delivered to your webhook endpoints only (not over [WebSockets](https://docs.openmail.sh/concepts/websockets.md)). An endpoint receives them only if you select them in its **Events**.

## Use cases

* **Agent routing** - Use `inbox_id` to route inbound email to the right user or container.
* **Real-time replies** - Trigger your agent to process and reply within seconds of receipt.
* **Multi-tenant** - Each inbox maps to an agent; `inbox_id` in the payload tells you which one.

## Payload structure

```json theme={"theme":{"light":"github-light","dark":"dark-plus"}}
{
  "event": "message.received",
  "event_id": "3a1f9c2e-7b4d-4e8a-9c1f-2d5e6a7b8c9d",
  "occurred_at": "2024-03-21T10:05:00.000Z",
  "inbox_id": "inb_92ma...",
  "thread_id": "thr_xyz...",
  "message": {
    "id": "msg_...",
    "rfc_message_id": "<original@message.id>",
    "from": "sender@example.com",
    "to": "inbox@omail.sh",
    "header_to": "inbox@omail.sh",
    "delivery_role": "to",
    "cc": [],
    "address_names": { "sender@example.com": "Sam Sender" },
    "subject": "Email subject",
    "body_text": "Plain text body",
    "attachments": [
      {
        "filename": "document.pdf",
        "contentType": "application/pdf",
        "sizeBytes": 12345,
        "url": "https://api.openmail.sh/v1/attachments/msg_.../document.pdf",
        "parsedText": "Invoice #2847\nDate: March 15, 2026\nAmount: $1,250.00",
        "extractionMethod": "pdf"
      }
    ],
    "raw_url": "https://api.openmail.sh/v1/messages/msg_.../raw",
    "received_at": "2024-03-21T10:05:00.000Z",
    "category": "personal",
    "auto_replyable": true,
    "verdict": "clean",
    "spam_score": 0.4
  }
}
```

## Field descriptions

| Field | Description |
| - | - |
| `event` | Event type — e.g. `message.received` (see [Events](#events)) |
| `event_id` | Unique ID for this event. Same across retries and endpoints. Use for deduplication. |
| `occurred_at` | When the event happened. Use to sort if events arrive out of order. |
| `inbox_id` | The inbox that received the message |
| `thread_id` | Conversation thread. Use with the API to fetch or send messages. |
| `message.id` | Unique message ID |
| `message.from` | Sender email address |
| `message.to` | Envelope recipient address |
| `message.cc` | Cc addresses |
| `message.address_names` | Display names from the From, To, and Cc headers, keyed by address. `null` when none. |
| `message.subject` | Email subject line |
| `message.body_text` | Plain-text body |
| `message.attachments` | Array of attachments with `url`, `parsedText` (extracted content), and `extractionMethod`. See [Attachments](https://docs.openmail.sh/concepts/attachments.md). |
| `message.raw_url` | Link to the original message as `message/rfc822`. Fetch with your API key. `null` when not available. |
| `message.category` | `personal`, `automated`, `marketing`, `bounce`, `spam`, or `malicious` |
| `message.auto_replyable` | `false` for mail an agent should not auto-reply to (automated, bulk, bounces, spam) |

## Reputation lifecycle payload

`inbox.suspended`, `inbox.reactivated`, `pod.suspended`, and `pod.reactivated` share the structure below. They carry a `reason` instead of a `message`. For `pod.*` events, `inbox_id` and `inbox_address` are `null`.

```json theme={"theme":{"light":"github-light","dark":"dark-plus"}}
{
  "event": "inbox.suspended",
  "event_id": "8c2d4f6a-1b3e-4c5d-8e7f-9a0b1c2d3e4f",
  "occurred_at": "2024-03-21T10:05:00.000Z",
  "inbox_id": "inb_92ma...",
  "inbox_address": "agent@yourdomain.com",
  "pod_id": "pod_abc...",
  "reason": "high_bounce_rate"
}
```

| Field | Description |
| - | - |
| `inbox_id` | The affected inbox, or `null` for `pod.*` events |
| `inbox_address` | The affected inbox's email address, or `null` for `pod.*` events |
| `pod_id` | The affected pod (or the suspended inbox's pod), if any |
| `reason` | Why it was suspended (see below); `null` on `*.reactivated` events |

### Reason codes

| Code | Meaning |
| - | - |
| `high_bounce_rate` | Too many of the inbox's recipients bounced |
| `high_complaint_rate` | Too many recipients marked messages as spam |
| `abuse` | Phishing or abusive sending was detected |
| `pod_degraded` | The pod's overall sending health fell too far |
| `manual_review` | Suspended by OpenMail staff pending review |
| `other` | Suspended for another reason |

A suspended inbox or pod is blocked from sending until reactivated. The reputation engine never auto-recovers a suspension — reactivation is an explicit action, which is when the `*.reactivated` event fires.

## Headers

Every request has `Content-Type: application/json`. The other headers depend on the endpoint's authentication scheme:

| Scheme | Headers |
| - | - |
| OpenMail signature | `X-Timestamp`, `X-Signature`, `X-Event-Id` |
| Standard Webhooks | `webhook-id`, `webhook-timestamp`, `webhook-signature` |
| Bearer token | `Authorization`, `X-Event-Id` |

See [Verification](https://docs.openmail.sh/pages/webhooks/verification.md) for what each header means and how to check it.

## Browse events in the console

The **Event Catalog** tab on the [Webhooks](https://console.openmail.sh/webhooks) page lists every event type with its schema and an example payload.

> [card] [Verification](https://docs.openmail.sh/pages/webhooks/verification.md)
>
> Verify each authentication scheme.

> [card] [Setup](https://docs.openmail.sh/guides/webhooks.md)
>
> Full implementation guide.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.