{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logbrew/json-schema/logbrew-sdk-product-analytics-property-catalog-response-schema.json",
  "title": "SdkProductAnalyticsPropertyCatalogResponse",
  "description": "Complete bounded property-key catalog for humans and agents.",
  "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/SdkProductAnalyticsPropertyCatalogResponse",
  "properties": {
    "coverage": {
      "$ref": "#/$defs/SdkProductAnalyticsPropertyCoverageResponse",
      "description": "Capture, migration, privacy, and truncation receipts."
    },
    "detail": {
      "anyOf": [
        {
          "$ref": "#/$defs/SdkProductAnalyticsDetailResponse"
        },
        {
          "type": "null"
        }
      ],
      "description": "Version 3: the top captured values of every returned key, with sessions, the previous\nperiod, and example sessions per value."
    },
    "estimation": {
      "$ref": "#/$defs/SdkProductAnalyticsPropertyEstimationResponse",
      "description": "Accuracy semantics for approximate cardinalities."
    },
    "next_action": {
      "$ref": "#/$defs/SdkProductAnalyticsNextActionResponse",
      "description": "Stable recommended follow-up."
    },
    "properties": {
      "description": "Highest-volume safe property keys.",
      "items": {
        "$ref": "#/$defs/SdkProductAnalyticsPropertyDescriptorResponse"
      },
      "maxItems": 50,
      "type": "array"
    },
    "purpose": {
      "description": "Product-level explanation of the resource.",
      "type": "string"
    },
    "query": {
      "$ref": "#/$defs/SdkProductAnalyticsPropertyQueryResponse",
      "description": "Normalized effective scope."
    },
    "schema_version": {
      "description": "Stable response schema version.",
      "format": "uint8",
      "maximum": 255,
      "minimum": 0,
      "type": "integer"
    },
    "summary": {
      "$ref": "#/$defs/SdkProductAnalyticsPropertySummaryResponse",
      "description": "High-level property availability."
    }
  },
  "required": [
    "schema_version",
    "query",
    "purpose",
    "summary",
    "coverage",
    "estimation",
    "properties",
    "next_action"
  ],
  "type": "object",
  "$defs": {
    "SdkProductAnalyticsBreakdownValueResponse": {
      "description": "Exact property value that defines one breakdown group.",
      "properties": {
        "property_key": {
          "description": "Standard-context or `tag.`-prefixed property key.",
          "type": "string"
        },
        "value": {
          "description": "Exact captured value; absent for units that never carried the key.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "property_key"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsDetailGroupResponse": {
      "description": "One number of the result with its previous-period value and supporting units.",
      "properties": {
        "base_units": {
          "description": "Denominator of `rate` in the selected period, such as entered or eligible units.",
          "format": "uint64",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "breakdown": {
          "anyOf": [
            {
              "$ref": "#/$defs/SdkProductAnalyticsBreakdownValueResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Property value that defines this group when the result is broken down by a property."
        },
        "change": {
          "description": "`units` minus `previous_units`.",
          "format": "int64",
          "type": "integer"
        },
        "change_rate": {
          "description": "Relative change; absent when the previous value is zero.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "events": {
          "description": "Matching events behind this number, when events are counted separately from units.",
          "format": "uint64",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "key": {
          "description": "Stable machine key, unique inside the response.",
          "type": "string"
        },
        "label": {
          "description": "Short human-readable label.",
          "type": "string"
        },
        "previous_rate": {
          "description": "The same rate for the previous period.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "previous_units": {
          "description": "The same number for the previous period of equal length.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "rate": {
          "description": "`units` divided by `base_units`.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "rate_change_p_value": {
          "description": "Two-sided p-value of a two-proportion z-test of `rate` against `previous_rate`; absent\nwhen either period has no base units, a rate is above 1, or both rates are 0 or 1.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "rate_change_significant": {
          "description": "Whether `rate_change_p_value` is below 0.05.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "units": {
          "description": "Units behind this number in the selected period.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "key",
        "label",
        "units",
        "previous_units",
        "change",
        "examples"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsDetailResponse": {
      "description": "Previous-period comparison, sample size, and supporting units for one result.",
      "properties": {
        "evidence_hint": {
          "description": "How to read the actions, page views, and traces behind an example.",
          "type": "string"
        },
        "example_limit": {
          "description": "Most examples listed for one group.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "groups": {
          "description": "One entry for each number in the result.",
          "items": {
            "$ref": "#/$defs/SdkProductAnalyticsDetailGroupResponse"
          },
          "type": "array"
        },
        "previous_sample_size": {
          "description": "The same population in the previous period.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "previous_since": {
          "description": "Inclusive start of the previous period, which has the selected period's length.",
          "format": "date-time",
          "type": "string"
        },
        "previous_until": {
          "description": "Exclusive end of the previous period, equal to the selected `since`.",
          "format": "date-time",
          "type": "string"
        },
        "sample_size": {
          "description": "Units in the population behind the headline result.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "unit": {
          "$ref": "#/$defs/SdkProductAnalyticsUnit",
          "description": "Unit that every group counts and every example names."
        }
      },
      "required": [
        "unit",
        "previous_since",
        "previous_until",
        "sample_size",
        "previous_sample_size",
        "example_limit",
        "groups",
        "evidence_hint"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsExampleUnitResponse": {
      "description": "One unit behind a number, with links to its own evidence.",
      "properties": {
        "action_ids": {
          "description": "Up to three product action IDs of this unit inside the selected scope.",
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "type": "array"
        },
        "first_seen_at": {
          "description": "First classified event of this unit inside the selected scope.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "last_seen_at": {
          "description": "Last classified event of this unit inside the selected scope.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "trace_ids": {
          "description": "Up to three trace IDs of this unit inside the selected scope; page views live here.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "unit_id": {
          "description": "Opaque session ID or user-subject ID exactly as the application captured it.",
          "type": "string"
        }
      },
      "required": [
        "unit_id",
        "action_ids",
        "trace_ids"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsNextActionResponse": {
      "description": "Stable follow-up guidance for improving or investigating product analytics.",
      "properties": {
        "code": {
          "description": "Stable action code.",
          "type": "string"
        },
        "reason": {
          "description": "Why the follow-up is useful.",
          "type": "string"
        },
        "target": {
          "description": "API or capture resource to use next.",
          "type": "string"
        }
      },
      "required": [
        "code",
        "target",
        "reason"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsPropertyCountAccuracy": {
      "description": "Accuracy class for distinct property-key and value counts.",
      "oneOf": [
        {
          "const": "approximate",
          "description": "Cardinality uses a bounded estimator.",
          "type": "string"
        }
      ]
    },
    "SdkProductAnalyticsPropertyCoverageResponse": {
      "description": "Capture, migration, privacy, and result-bound receipts for the catalog.",
      "properties": {
        "complete_index_events": {
          "description": "Indexed events represented without malformed or truncated safe properties.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "events_with_properties": {
          "description": "Indexed events carrying at least one safe property.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "incomplete_index_events": {
          "description": "Indexed events with malformed, unsupported-version, or truncated safe context.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "index_coverage_rate": {
          "description": "Fraction of classified events processed by the current indexer.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "indexed_events": {
          "description": "Classified events processed by the current property indexer.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "limitations": {
          "description": "Material interpretation and privacy limitations.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "privacy_filtered_events": {
          "description": "Events where direct-identity or secret-like custom tags were intentionally excluded.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "properties_truncated": {
          "description": "Whether more property keys exist than the response limit.",
          "type": "boolean"
        },
        "property_capture_rate": {
          "description": "Fraction of classified events carrying at least one safe property.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "unindexed_events": {
          "description": "Historical or incompatible events without the current property index.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "values_returned": {
          "const": false,
          "description": "Always false: catalog discovery never returns custom property values.",
          "type": "boolean"
        }
      },
      "required": [
        "indexed_events",
        "unindexed_events",
        "complete_index_events",
        "incomplete_index_events",
        "privacy_filtered_events",
        "events_with_properties",
        "properties_truncated",
        "values_returned",
        "limitations"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsPropertyDescriptorResponse": {
      "additionalProperties": false,
      "description": "One bounded safe property key and aggregate availability receipt.",
      "properties": {
        "coverage_rate": {
          "description": "Fraction of classified events carrying this property.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "distinct_values": {
          "description": "Approximate distinct values without revealing the values themselves.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "events": {
          "description": "Exact events carrying this property.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "key": {
          "description": "Stable standard-context key or `tag.`-prefixed custom key.",
          "type": "string"
        },
        "source": {
          "$ref": "#/$defs/SdkProductAnalyticsPropertySource",
          "description": "Property source class."
        },
        "value_type": {
          "$ref": "#/$defs/SdkProductAnalyticsPropertyValueType",
          "description": "Exact scalar type accepted by segment filters."
        }
      },
      "required": [
        "key",
        "source",
        "value_type",
        "events",
        "distinct_values"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsPropertyEstimationResponse": {
      "description": "Accuracy contract for property catalog cardinalities.",
      "properties": {
        "count_accuracy": {
          "$ref": "#/$defs/SdkProductAnalyticsPropertyCountAccuracy",
          "description": "Accuracy class for available keys and per-key distinct values."
        },
        "description": {
          "description": "Human-readable accuracy boundary.",
          "type": "string"
        },
        "method": {
          "description": "Versioned estimation method; version 2 uses `approximate_distinct`.",
          "type": "string"
        }
      },
      "required": [
        "count_accuracy",
        "method",
        "description"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsPropertyQueryResponse": {
      "description": "Normalized scope echoed by the catalog.",
      "properties": {
        "environment": {
          "description": "Optional exact environment filter.",
          "type": [
            "string",
            "null"
          ]
        },
        "limit": {
          "description": "Maximum returned property keys.",
          "format": "uint8",
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        "project_id": {
          "description": "Exact project queried.",
          "format": "uuid",
          "type": "string"
        },
        "release": {
          "description": "Optional exact release filter.",
          "type": [
            "string",
            "null"
          ]
        },
        "service_name": {
          "description": "Optional exact service filter.",
          "type": [
            "string",
            "null"
          ]
        },
        "since": {
          "description": "Inclusive UTC lower bound.",
          "format": "date-time",
          "type": "string"
        },
        "until": {
          "description": "Exclusive UTC upper bound.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "project_id",
        "since",
        "until",
        "limit"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsPropertySource": {
      "description": "Stable source class for a safe analytics property.",
      "oneOf": [
        {
          "const": "standard_context",
          "description": "A bounded field from typed runtime, framework, OS, device, or application context.",
          "type": "string"
        },
        {
          "const": "custom_tag",
          "description": "A non-sensitive custom `context.tags` value.",
          "type": "string"
        }
      ]
    },
    "SdkProductAnalyticsPropertySummaryResponse": {
      "description": "High-level property availability in the selected window.",
      "properties": {
        "available_property_keys": {
          "description": "Approximate distinct safe property keys.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "classified_events": {
          "description": "Supported classified product events.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "returned_properties": {
          "description": "Property descriptors returned after the request limit.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "classified_events",
        "available_property_keys",
        "returned_properties"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsPropertyValueType": {
      "description": "Supported version-1 analytics property scalar type.",
      "oneOf": [
        {
          "const": "string",
          "description": "Exact bounded UTF-8 string.",
          "type": "string"
        }
      ]
    },
    "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"
        }
      ]
    }
  }
}