# message.rejected

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

Sent when an email was rejected because one or more attachments contained a virus.

> This notification fires only for Agent Account grants (`provider: "nylas"`). Connected grants on other email providers do not emit it.

## data.object fields

- `message` (object) **(required)** - The original message that was rejected.
  - `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.
- `rejected_at` (integer) **(required)** - Unix timestamp when the message was rejected.

## Example payload

```json
{
  "specversion": "1.0",
  "type": "message.rejected",
  "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"
        }
      },
      "rejected_at": 1234567890
    }
  }
}
```
