{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/convalytics-dev/json-schema/convalytics-dev-ingest-event-schema.json",
  "title": "IngestEvent",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/convalytics-dev-openapi.yml#/components/schemas/IngestEvent",
  "type": "object",
  "required": [
    "writeKey",
    "name",
    "userId",
    "sessionId",
    "timestamp"
  ],
  "properties": {
    "writeKey": {
      "type": "string",
      "description": "Public write key identifying the project."
    },
    "name": {
      "type": "string",
      "description": "Event name. Use `page_view` for page views (free, not quota-counted); any other snake_case name records a custom product event."
    },
    "userId": {
      "type": "string",
      "description": "Stable user ID (anonymous UUID or your app's real user ID after identify())."
    },
    "sessionId": {
      "type": "string",
      "description": "Session ID (regenerated per browser session)."
    },
    "timestamp": {
      "type": "integer",
      "description": "Unix milliseconds."
    },
    "props": {
      "type": "object",
      "description": "Arbitrary event properties. Values must be string, number, or boolean. Keys starting with $ or _ are dropped.",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      }
    },
    "deploymentName": {
      "type": "string",
      "description": "Convex deployment slug. When present, environment is resolved via cached deployment metadata (dev → development, prod → production)."
    },
    "pageOrigin": {
      "type": "string",
      "description": "Page origin for browser events. Used to classify environment (localhost → development, else production)."
    },
    "userEmail": {
      "type": "string",
      "description": "Human-readable email shown in the dashboard (takes priority over userName and userId).",
      "maxLength": 200
    },
    "userName": {
      "type": "string",
      "description": "Human-readable name shown in the dashboard (fallback after userEmail).",
      "maxLength": 200
    }
  }
}