{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentanalytics-sh/json-schema/agentanalytics-sh-track-request-schema.json",
  "title": "TrackRequest",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/agentanalytics-sh-api-openapi.yml#/components/schemas/TrackRequest",
  "type": "object",
  "required": [
    "token",
    "event"
  ],
  "properties": {
    "token": {
      "type": "string",
      "description": "Project token (`aat_*`)"
    },
    "event": {
      "type": "string",
      "description": "Event name (max 256 chars)"
    },
    "properties": {
      "type": [
        "object",
        "null"
      ],
      "description": "Arbitrary key-value properties (max 8KB JSON). The tracker auto-populates `path`, `url`, `hostname`, `title`, `referrer`, `screen`, `browser`, `browser_version`, `os`, `device`, `language`, `timezone` (IANA), `utm_*` params, `session_count`, `days_since_first_visit`, and `first_utm_*` (first-touch attribution)."
    },
    "user_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Anonymous user identifier (max 256 chars). The tracker auto-generates one via localStorage."
    },
    "session_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Session identifier (max 256 chars). The tracker auto-generates one via sessionStorage with 30-min inactivity timeout."
    },
    "timestamp": {
      "type": [
        "number",
        "null"
      ],
      "description": "Unix timestamp in milliseconds. Defaults to `Date.now()`. Must be within 30 days ago to 5 minutes in the future."
    }
  }
}