# message.link_clicked.legacy

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

Legacy format for link clicked 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 click event.
  - `object` (string) - Always `metadata`.
  - `type` (string) - The delta type, always `message.link_clicked`.
  - `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 link data and recents.
      - `link_data` (array) - Aggregate click data per link.
        - `count` (integer) - Total clicks on this link.
        - `url` (string) - The clicked URL.
      - `message_id` (string) - The v2 message ID.
      - `payload` (string) - Custom payload set when creating link tracking.
      - `recents` (array) - Recent click events.
        - `id` (integer) - Sequential click ID.
        - `ip` (string) - IP address of the clicker.
        - `link_index` (integer) - Index of the clicked link.
        - `timestamp` (integer) - Unix timestamp of the click.
        - `user_agent` (string) - User-Agent string.
      - `timestamp` (integer) - Unix timestamp of the first click.

## Example payload

```json
{
  "specversion": "1.0",
  "type": "message.link_clicked.legacy",
  "source": "/com/nylas/v2/webhooks",
  "id": "<WEBHOOK_ID>",
  "time": 1733261173,
  "webhook_delivery_attempt": 1,
  "data": {
    "application_id": "<V3_NYLAS_APPLICATION_ID>",
    "grant_id": "<V3_NYLAS_GRANT_ID>",
    "object": {
      "deltas": [
        {
          "date": 1733261158,
          "object": "metadata",
          "object_data": {
            "account_id": "<V2_NYLAS_ACCOUNT_ID>",
            "id": "<V2_WEBHOOK_ID>",
            "metadata": {
              "link_data": [
                {
                  "count": 8,
                  "url": "client_url"
                }
              ],
              "message_id": "<V2_MESSAGE_ID>",
              "payload": "Hello world",
              "recents": [
                {
                  "id": 0,
                  "ip": "ip_address",
                  "link_index": 0,
                  "timestamp": 1733163188,
                  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
                }
              ],
              "timestamp": 1733163166
            },
            "namespace_id": "<V2_NAMESPACE_ID>",
            "object": "metadata"
          },
          "type": "message.link_clicked"
        }
      ],
      "grant_id": "<V3_NYLAS_GRANT_ID>",
      "object": "message"
    }
  }
}
```
