{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/nylas/refs/heads/main/json-schema/nylas-message-link-clicked.schema.json",
  "title": "Nylas message.link_clicked notification object",
  "description": "Sent when a participant clicks a link in a tracked message. This schema describes `data.object` inside the Nylas notification envelope.",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "description": "Always `message`.",
      "enum": [
        "message"
      ]
    },
    "grant_id": {
      "type": "string",
      "description": "The grant ID that owns the tracked message."
    },
    "message_id": {
      "type": "string",
      "description": "The ID of the tracked message containing the clicked link."
    },
    "label": {
      "type": "string",
      "description": "The tracking label you assigned when sending the message."
    },
    "link_data": {
      "type": "array",
      "description": "Aggregate click data per tracked link.",
      "items": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "description": "Total number of times this link was clicked."
          },
          "url": {
            "type": "string",
            "description": "The URL that was clicked."
          }
        }
      }
    },
    "recents": {
      "type": "array",
      "description": "Recent click events with client details.",
      "items": {
        "type": "object",
        "properties": {
          "click_id": {
            "type": "integer",
            "description": "Sequential click event ID."
          },
          "ip": {
            "type": "string",
            "description": "IP address of the clicker."
          },
          "link_index": {
            "type": "string",
            "description": "Index of the clicked link in the message."
          },
          "timestamp": {
            "type": "integer",
            "description": "Unix timestamp of this click event."
          },
          "user_agent": {
            "type": "string",
            "description": "User-Agent string of the clicker's client."
          }
        }
      }
    },
    "sender_app_id": {
      "type": "string",
      "description": "The Nylas application ID that sent the tracked message."
    },
    "timestamp": {
      "type": "integer",
      "description": "Unix timestamp of the click event."
    }
  },
  "required": [
    "message_id"
  ],
  "x-nylas-trigger": "message.link_clicked",
  "x-nylas-category": "Message Tracking",
  "x-provenance": {
    "method": "authored",
    "publisher": "Nylas",
    "source": "https://developer.nylas.com/docs/reference/notifications/message-tracking/message-link_clicked/",
    "derived_from": "nylas/developer.nylas.com@a7995fb6:src/_component-data/notification-schemas.json",
    "generated": "2026-09-28"
  },
  "examples": [
    {
      "object": "message",
      "grant_id": "<NYLAS_GRANT_ID>",
      "link_data": [
        {
          "count": 1,
          "url": "https://www.example.com"
        }
      ],
      "message_id": "18ac281f237c934b",
      "label": "Hey, just testing",
      "recents": [
        {
          "click_id": 0,
          "ip": "<IP ADDR>",
          "link_index": "0",
          "timestamp": 1695480422,
          "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
        },
        {
          "click_id": 1,
          "ip": "<IP ADDR>",
          "link_index": "0",
          "timestamp": 1695480422,
          "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
        },
        {
          "click_id": 2,
          "ip": "<IP ADDR>",
          "link_index": "0",
          "timestamp": 1695480422,
          "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
        }
      ],
      "sender_app_id": "<app id>",
      "timestamp": 1695480422
    }
  ]
}