# Email events and suppressions

Canonical page: https://nightmail.dev/docs/email-events

What each email webhook event carries, how to match it to the email you sent, and which addresses Nightmail stops sending to.

## The payload

Every delivery is one JSON event, signed as [Verify webhook signatures](/docs/webhook-signatures) describes:

```json
{
  "id": "event_…",
  "type": "email.bounced",
  "createdAt": "2026-12-05T09:14:03.123+00:00",
  "workspaceId": "ws_…",
  "region": "us-east-2",
  "data": {
    "emailId": "email_…",
    "providerId": "0100019…",
    "simulated": false,
    "bounceType": "Permanent",
    "bounceSubType": "General",
    "diagnosticCode": "smtp; 550 5.1.1 <address>: user unknown"
  }
}
```

- `data.emailId` is the `id` that [sendEmail](/docs/api/sendEmail) or [sendEmailBatch](/docs/api/sendEmailBatch) returned. Match events to your sends with it. `id` is the event's own ID, not the email's.
- No event carries a recipient address. Read the email with [getEmail](/docs/api/getEmail) (`to`, `cc`, `bcc`) to see who it went to. On an email with several recipients, an event doesn't say which of them it is about, so send one recipient per email when you need to know.
- `data.providerId` is Amazon SES's message ID, there once SES accepted the email. `data.simulated` is true only on an installation that simulates SES instead of sending; mail to Amazon SES's mailbox simulator (`@simulator.amazonses.com`) goes through SES for real and has it false.
- `data.senderId` is there too when the workspace sends through child senders.

## Fields by event

Besides `emailId`, `simulated` and `providerId`, `data` has:

- `email.sent` (SES accepted the email): nothing else.
- `email.delivered` (the receiving server accepted it): nothing else.
- `email.bounced`: `bounceType`: `Permanent` (a hard bounce), `Transient` (a soft bounce), `Undetermined` or `Unknown`. `bounceSubType`, such as `General`, `NoEmail`, `Suppressed`, `MailboxFull` or `EmailValidationSuppressed`. `diagnosticCode`: the receiving server's reply, when it gave one. `suppressionReason`: `email_validation` when SES's address validation dropped the recipient before sending.
- `email.complained`: `complaintFeedbackType` (such as `abuse`), when the mailbox provider gave one. A report marked `not-spam` sends no event.
- `email.delivery_delayed`: `delayType` (such as `MailboxFull` or `TransientCommunicationFailure`), `expirationTime` (when SES stops retrying) and `diagnosticCode`.
- `email.rejected`: `code` when the send failed before SES accepted it (then without `providerId`). `status` too when Nightmail stopped the email itself (`rejected`, such as a content-screen refusal or a scheduled send that couldn't be released; `suppressed`, with `suppressionReason`; or `canceled`), or when the SES call's outcome was lost (`acceptance_unknown`: don't resend, SES may have accepted it). A rejection SES reports after accepting the email carries `providerId` and neither `code` nor `status`.
- `email.opened`, `email.clicked`: `isBotEvent`, and `link` for a click. Only with tracking on.

`diagnosticCode` is written by the receiving server: read it as untrusted text. In a webhook it is cut at 160 characters, with the addresses and IP addresses in it replaced by `<address>` and `<ip>`; [listEmailEvents](/docs/api/listEmailEvents) has it as SES reported it, up to 500 characters. A bounce SES made itself (its suppression list, its address validation) has none.

New webhooks get `email.sent`, `email.delivered`, `email.bounced`, `email.complained`, `email.rejected`, `email.rendering_failed` and `email.delivery_delayed`. Choose others, such as `email.opened`, `email.clicked` and `contact.subscription_changed`, when you create the webhook with [createWebhook](/docs/api/createWebhook) or in Settings → Webhooks.

## Suppressions

Nightmail stops sending to an address for the whole workspace after:

- a hard bounce (`bounceType` `Permanent`): reason `hard_bounce`;
- a complaint, unless it was marked `not-spam`: reason `complaint`;
- SES's address validation dropping it: reason `email_validation`.

Soft bounces and delays don't suppress.

A suppression applies to every email, transactional ones too (password resets, sign-in codes), and to marketing, campaigns and SMTP. There is no field that sends to a suppressed address anyway. A send that names one is refused with `422 RECIPIENT_INELIGIBLE`, and nothing in it is sent: `error.details` lists each address with its `reason`. An address suppressed after its email was queued gets that email's `email.rejected` event with `status` `suppressed`. The one exception is a transactional reply to someone who wrote to you in that conversation, when their address was suppressed only by address validation and they haven't unsubscribed.

A suppressed address is a contact with `suppressed` true and its `suppressionReason`: list them with [listContacts](/docs/api/listContacts) and `suppressed=true`. There is no API to lift a suppression. Hosted: once the person's mailbox works again, email support@nightmail.dev to lift a hard-bounce or validation suppression. A complaint suppression is never lifted.
