{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logbrew/json-schema/logbrew-sdk-product-analytics-funnel-request-schema.json",
  "title": "SdkProductAnalyticsFunnelRequest",
  "description": "Bounded funnel request for one owned project.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/logbrew-product-analytics-api-openapi.yml#/components/schemas/SdkProductAnalyticsFunnelRequest",
  "additionalProperties": false,
  "properties": {
    "analysis_unit": {
      "anyOf": [
        {
          "$ref": "#/$defs/SdkProductAnalyticsUnit"
        },
        {
          "type": "null"
        }
      ],
      "description": "Unit used for ordering and counting; defaults to explicit sessions."
    },
    "breakdown_property": {
      "description": "Optional safe property key, such as `tag.utm_source`, that splits units by its first\ncaptured value; version 2 only.",
      "type": [
        "string",
        "null"
      ]
    },
    "conversion_window_seconds": {
      "description": "Maximum seconds allowed between the first and final matched steps.",
      "format": "uint32",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "environment": {
      "description": "Optional exact environment filter.",
      "type": [
        "string",
        "null"
      ]
    },
    "project_id": {
      "description": "Required project scope, optional only for actionable validation.",
      "format": "uuid",
      "type": "string"
    },
    "release": {
      "description": "Optional exact release filter.",
      "type": [
        "string",
        "null"
      ]
    },
    "response_version": {
      "description": "Optional response schema; version 2 adds previous-period change and example units.",
      "format": "uint8",
      "maximum": 255,
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "service_name": {
      "description": "Optional exact service filter.",
      "type": [
        "string",
        "null"
      ]
    },
    "since": {
      "description": "Required inclusive lower bound, as a duration or RFC 3339 timestamp.",
      "type": "string"
    },
    "steps": {
      "description": "Two through eight exact ordered steps.",
      "items": {
        "$ref": "#/$defs/SdkProductAnalyticsEventRequest"
      },
      "type": "array"
    },
    "until": {
      "description": "Optional exclusive RFC 3339 upper bound; defaults to request time.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "project_id",
    "since",
    "steps"
  ],
  "type": "object",
  "$defs": {
    "SdkProductAnalyticsEventKind": {
      "description": "Supported version-1 classified product-event kind.",
      "oneOf": [
        {
          "const": "page_view",
          "description": "Browser route view.",
          "type": "string"
        },
        {
          "const": "screen_view",
          "description": "Application-owned screen view.",
          "type": "string"
        },
        {
          "const": "interaction",
          "description": "Explicit application product action.",
          "type": "string"
        }
      ]
    },
    "SdkProductAnalyticsEventRequest": {
      "additionalProperties": false,
      "description": "One exact classified product-event selector.",
      "properties": {
        "event_name": {
          "description": "Stable route template, screen name, or bounded action name.",
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/SdkProductAnalyticsEventKind",
          "description": "Supported classified event kind."
        }
      },
      "required": [
        "kind",
        "event_name"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsUnit": {
      "description": "Explicit identity boundary used for aggregate analysis.",
      "oneOf": [
        {
          "const": "session",
          "description": "Count explicit application sessions.",
          "type": "string"
        },
        {
          "const": "identified_user",
          "description": "Count explicit opaque user-subject IDs without returning them.",
          "type": "string"
        }
      ]
    }
  }
}