{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/casaintelligence-com-au/json-schema/casaintelligence-com-au-events-batch-request-schema.json",
  "title": "EventsBatchRequest",
  "description": "Batch of events from extension or dashboard.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/casaintelligence-com-au-events-api-openapi.yml#/components/schemas/EventsBatchRequest",
  "properties": {
    "events": {
      "items": {
        "$ref": "#/$defs/EventItem"
      },
      "type": "array",
      "maxItems": 100,
      "minItems": 1,
      "title": "Events"
    },
    "anonymous_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Anonymous Id",
      "description": "Extension installation ID for anonymous tracking"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Session Id",
      "description": "Groups events into sessions"
    }
  },
  "type": "object",
  "required": [
    "events"
  ],
  "$defs": {
    "EventItem": {
      "properties": {
        "event_type": {
          "type": "string",
          "title": "Event Type",
          "description": "Event type, e.g. 'property_view', 'ai_question'"
        },
        "event_category": {
          "type": "string",
          "title": "Event Category",
          "description": "Category: 'engagement', 'conversion', 'feature_use', 'navigation'",
          "default": "engagement"
        },
        "property_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Property Id",
          "description": "Property UUID if applicable"
        },
        "source": {
          "type": "string",
          "title": "Source",
          "description": "Source: 'extension', 'dashboard', 'api'",
          "default": "unknown"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Metadata",
          "description": "Event-specific data"
        }
      },
      "type": "object",
      "required": [
        "event_type"
      ],
      "title": "EventItem",
      "description": "A single trackable event."
    }
  }
}