# message.updated

Source: https://developer.nylas.com/docs/reference/notifications/messages/message-updated/

Sent when a user modifies or updates a message.

> Payloads exceeding 1 MB are truncated: the type becomes `message.updated.truncated` and the `body` field is removed. Re-query the [Messages API](/docs/reference/api/messages/get-messages-id/) to get the full message. If you have [field customization](/docs/v3/notifications/#specify-fields-for-webhook-notifications) enabled, the type will be `message.updated.transformed`.

## data.object fields

- `id` (string) **(required)** - The Nylas message ID.
- `grant_id` (string) **(required)** - The grant ID that owns this message.
- `object` (string) **(required)** (message) - Always `message`.
- `thread_id` (string) - The thread this message belongs to.
- `subject` (string) - The message subject line.
- `from` (array) - Sender information.
  - `name` (string) - Display name of the sender.
  - `email` (string) - Email address of the sender.
- `to` (array) - Primary recipients.
  - `name` (string)
  - `email` (string)
- `cc` (array) - CC recipients.
  - `name` (string)
  - `email` (string)
- `date` (integer) - Unix timestamp when the message was sent.
- `body` (string) - The HTML body of the message.
- `snippet` (string) - A short plaintext preview of the message body.
- `starred` (boolean) - Whether the message is starred/flagged.
- `unread` (boolean) - Whether the message is unread.
- `folders` (array) - Folder names the message belongs to.
- `metadata` (object) - Custom key-value metadata attached to the message.

## Example payload

```json
{
  "specversion": "1.0",
  "type": "message.updated",
  "source": "/google/emails/realtime",
  "id": "<WEBHOOK_ID>",
  "time": 1723821985,
  "webhook_delivery_attempt": 1,
  "data": {
    "application_id": "<NYLAS_APPLICATION_ID>",
    "object": {
      "body": "<div dir=\"ltr\">Test with attachments</div>\r\n",
      "cc": [
        {
          "email": "nyla@example.com",
          "name": "Nyla"
        }
      ],
      "date": 1234567890,
      "folders": [
        "INBOX"
      ],
      "from": [
        {
          "email": "leyah@example.com",
          "name": "Leyah Miller"
        }
      ],
      "grant_id": "<NYLAS_GRANT_ID>",
      "id": "<MESSAGE_ID>",
      "metadata": {
        "key1": "all-meetings",
        "key2": "on-site"
      },
      "object": "message",
      "snippet": "This message has an attachment.",
      "starred": false,
      "subject": "Let's send an attachment",
      "thread_id": "<THREAD_ID>",
      "to": [
        {
          "email": "kaveh@example.com"
        }
      ],
      "unread": true
    }
  }
}
```
