# message.opened.legacy

Source: https://developer.nylas.com/docs/reference/notifications/message-tracking/message-opened-legacy/

Legacy format for message opened tracking notifications.

> The `deltas` array and nested `object_data` fields may be `null` rather than absent.

## data.object fields

- `grant_id` (string) **(required)** - The v3 grant ID.
- `object` (string) **(required)** (message) - Always `message`.
- `deltas` (array) **(required)** - Array of delta change objects in v2 format.
  - `date` (integer) - Unix timestamp of the open event.
  - `object` (string) - Always `metadata`.
  - `type` (string) - The delta type, always `message.opened`.
  - `object_data` (object) - The v2-format tracking data.
    - `account_id` (string) - The v2 account ID.
    - `id` (string) - The v2 webhook ID.
    - `namespace_id` (string) - The v2 namespace ID.
    - `object` (string) - Always `metadata`.
    - `attributes` (any, nullable) - Legacy attributes field. Always `null`.
    - `metadata` (object) - Tracking metadata including open count and recents.
      - `count` (integer) - Total number of opens.
      - `message_id` (string) - The v2 message ID.
      - `payload` (string) - Custom payload set when creating the tracking pixel.
      - `recents` (array) - Recent open events.
        - `id` (integer) - Sequential open ID.
        - `ip` (string) - IP address of the opener.
        - `timestamp` (integer) - Unix timestamp of the open.
        - `user_agent` (string) - User-Agent string.
      - `timestamp` (integer) - Unix timestamp of the first open.

## Example payload

```json
{
  "specversion": "1.0",
  "type": "message.opened.legacy",
  "source": "/com/nylas/v2/webhooks",
  "id": "<WEBHOOK_ID>",
  "time": 1733261181,
  "webhook_delivery_attempt": 1,
  "data": {
    "application_id": "<V3_NYLAS_APPLICATION_ID>",
    "grant_id": "<V3_NYLAS_GRANT_ID>",
    "object": {
      "deltas": [
        {
          "date": 1733261154,
          "object": "metadata",
          "object_data": {
            "account_id": "<V2_NYLAS_ACCOUNT_ID>",
            "id": "<V2_WEBHOOK_ID>",
            "metadata": {
              "count": 1,
              "message_id": "<V2_MESSAGE_ID>",
              "payload": "Hello world",
              "recents": [
                {
                  "id": 0,
                  "ip": "ip_address",
                  "timestamp": 1733163186,
                  "user_agent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
                }
              ],
              "timestamp": 1733261154
            },
            "namespace_id": "<V2_NAMESPACE_ID>",
            "object": "metadata"
          },
          "type": "message.opened"
        }
      ],
      "grant_id": "<V3_NYLAS_GRANT_ID>",
      "object": "message"
    }
  }
}
```
