# message.bounced

Source: https://developer.nylas.com/docs/reference/notifications/agent-accounts/message-bounced/

Sent when an email was not delivered due to a hard bounce.

> This notification fires only for Agent Account grants (`provider: "nylas"`). For connected grants on other email providers, watch [`message.bounce_detected`](/docs/reference/notifications/messages/message-bounce_detected/) instead.

## data.object fields

- `message` (object) **(required)** - The original message that bounced.
  - `id` (string) - The Nylas message ID.
  - `subject` (string) - The message subject line.
  - `from` (string) - Sender email address.
  - `to` (array) - Primary recipient email addresses.
  - `cc` (array) - CC recipient email addresses. Omitted if none were specified.
  - `bcc` (array) - BCC recipient email addresses. Omitted if none were specified.
  - `sent_at` (integer) - Unix timestamp when the message was sent.
  - `metadata` (object) - Custom key-value metadata attached when sending. Omitted if none were provided.
- `bounce` (object) **(required)** - Bounce details.
  - `bounced_at` (integer) - Unix timestamp when the bounce occurred.
  - `type` (string) - Bounce type (e.g. `MailboxFull`).
  - `recipients` (array) - Recipients that bounced.
    - `email` (string) **(required)** - Email address that bounced.
    - `diagnostic_code` (string) - SMTP diagnostic code from the receiving server.

## Example payload

```json
{
  "specversion": "1.0",
  "type": "message.bounced",
  "source": "/nylas/send",
  "id": "<WEBHOOK_ID>",
  "time": 1723821985,
  "webhook_delivery_attempt": 1,
  "data": {
    "application_id": "<NYLAS_APPLICATION_ID>",
    "grant_id": "<NYLAS_GRANT_ID>",
    "object": {
      "message": {
        "id": "<MESSAGE_ID>",
        "subject": "Your order has shipped",
        "from": "notifications@example.com",
        "to": [
          "jordan.taylor@example.com"
        ],
        "cc": [
          "sam.lee@example.com"
        ],
        "bcc": [
          "alex.johnson@example.com"
        ],
        "sent_at": 1234567890,
        "metadata": {
          "campaign": "welcome-email"
        }
      },
      "bounce": {
        "bounced_at": 1234567890,
        "type": "MailboxFull",
        "recipients": [
          {
            "email": "john@example.com"
          },
          {
            "email": "jane@example.com",
            "diagnostic_code": "smtp; 550 user unknown"
          }
        ]
      }
    }
  }
}
```
