{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aiworkstation-cn/json-schema/aiworkstation-cn-analytics-collect-request-schema.json",
  "title": "AnalyticsCollectRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aiworkstation-cn-analytics-api-openapi.yml#/components/schemas/AnalyticsCollectRequest",
  "properties": {
    "client_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 128
        },
        {
          "type": "null"
        }
      ],
      "title": "Client Id"
    },
    "terminal": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 32
        },
        {
          "type": "null"
        }
      ],
      "title": "Terminal"
    },
    "invite_code": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "title": "Invite Code"
    },
    "page_hits": {
      "items": {
        "$ref": "#/$defs/AnalyticsCollectHitItem"
      },
      "type": "array",
      "title": "Page Hits"
    },
    "feature_events": {
      "items": {
        "$ref": "#/$defs/AnalyticsCollectFeatureItem"
      },
      "type": "array",
      "title": "Feature Events"
    }
  },
  "type": "object",
  "$defs": {
    "AnalyticsCollectFeatureItem": {
      "properties": {
        "feature_key": {
          "type": "string",
          "maxLength": 64,
          "minLength": 1,
          "title": "Feature Key"
        },
        "action": {
          "type": "string",
          "maxLength": 32,
          "minLength": 1,
          "title": "Action"
        },
        "event_id": {
          "type": "string",
          "maxLength": 64,
          "minLength": 8,
          "title": "Event Id"
        },
        "view": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "View"
        },
        "pane": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "Pane"
        },
        "ts": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ts"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra"
        }
      },
      "type": "object",
      "required": [
        "feature_key",
        "action",
        "event_id"
      ],
      "title": "AnalyticsCollectFeatureItem"
    },
    "AnalyticsCollectHitItem": {
      "properties": {
        "page": {
          "type": "string",
          "maxLength": 64,
          "minLength": 1,
          "title": "Page"
        },
        "event_type": {
          "type": "string",
          "enum": [
            "pageview",
            "presence"
          ],
          "title": "Event Type",
          "default": "pageview"
        },
        "event_id": {
          "type": "string",
          "maxLength": 64,
          "minLength": 8,
          "title": "Event Id"
        },
        "ts": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ts"
        }
      },
      "type": "object",
      "required": [
        "page",
        "event_id"
      ],
      "title": "AnalyticsCollectHitItem"
    }
  }
}