> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixpanel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Insights Query

> Beta: run an Insights query that you describe in the request body, without a saved report.

> [!WARNING]
>
> **Beta.** This endpoint is in beta. Its request schema can change before general availability, including in ways that require you to update your requests.

Runs an Insights query that you describe in the request body and returns the results. You choose the metrics, the time range, and optional filters, breakdowns, and comparisons—the same building blocks as an Insights report. To get the results of a report you've already saved, use [Query Saved Report](https://docs.mixpanel.com/reference/insights-query.md) instead.

## API server URL

Send requests to the server URL for your project's data residency:

| Server | URL |
| - | - |
| Standard server | `https://mixpanel.com/api/query/insights/query` |
| EU Residency server | `https://eu.mixpanel.com/api/query/insights/query` |
| India Residency server | `https://in.mixpanel.com/api/query/insights/query` |

For more about residency, see [EU Data Residency](https://docs.mixpanel.com/docs/privacy/eu-residency.md) and [India Data Residency](https://docs.mixpanel.com/docs/privacy/in-residency.md).

## Authentication

Authenticate with a [service account](https://docs.mixpanel.com/reference/service-accounts.md), sending its username and secret with HTTP basic authentication. Pass these query parameters:

* `project_id`: the ID of the project to query. Required.
* `workspace_id`: the ID of the data view to query. Include it if your project uses [data views](https://docs.mixpanel.com/docs/data-governance/data-views-and-classification.md).

## Version

Set the `Mixpanel-Version` header to the API version your request is written for. A version is a release date, `YYYY-MM-DD`. A version that isn't released yet adds a preview channel: `YYYY-MM-DD.alpha` or `YYYY-MM-DD.beta`.

During the beta, the only version is `2026-10-23.beta`.

If you omit the header, the request uses the latest released version. While no version is released, it uses the oldest beta version.

An unknown, malformed, or retired version returns `400 Bad Request`. The error message names the latest version.

## Response format

The `Accept` header selects the response format:

| `Accept` | Response |
| - | - |
| Omitted, `application/json`, `application/*`, or `*/*` | JSON |
| `text/csv` | CSV (`Content-Type: text/csv`) |

## Request body

A request body has two required fields and four optional ones:

| Field | What it holds |
| - | - |
| `metrics` required | Up to 40 metrics to calculate: event, funnel, retention, cohort, or formula metrics. |
| `time` required | The time range, and optionally the unit that splits it into a time series. |
| `filters` optional | Up to 10 filters that apply to every metric. |
| `breakdowns` optional | Up to three breakdowns by property value or cohort membership. |
| `time_comparison` optional | An earlier period to run the same query over. |
| `lift_comparison` optional | Reports each result as a change against a baseline. |

The reference below describes every field.

## Example request

This request counts `Sign Up` events per day over the last 30 days:

```bash theme={"system"}
curl --request POST \
  --url 'https://mixpanel.com/api/query/insights/query?project_id=YOUR_PROJECT_ID' \
  --user 'YOUR_SERVICE_ACCOUNT_USERNAME:YOUR_SERVICE_ACCOUNT_SECRET' \
  --header 'Content-Type: application/json' \
  --header 'Mixpanel-Version: 2026-10-23.beta' \
  --data '{
    "metrics": [
      {
        "type": "event",
        "events": [{"event_type": "event", "name": "Sign Up"}],
        "measurement": {"type": "count", "calculation": "total_events"}
      }
    ],
    "time": {
      "start": {"unit": "day", "value": 30, "align_to_whole_unit": true},
      "unit": "day"
    }
  }'
```

## Limits

A request can have up to 40 metrics, three breakdowns, and 10 filters.

## OpenAPI spec

The reference below is generated from an OpenAPI 3.1 spec, which you can download to generate a client or to give to an AI tool: [insights.openapi.json](https://docs.mixpanel.com/openapi/insights.openapi.json).


## OpenAPI

````yaml openapi/insights.openapi.json POST /insights/query
openapi: 3.1.1
info:
  title: Insights API
  version: '2026-09-09'
servers:
  - url: https://{regionAndDomain}.com/api/query
    description: Mixpanel's calculated data API
    variables:
      regionAndDomain:
        enum:
          - mixpanel
          - eu.mixpanel
          - in.mixpanel
        default: mixpanel
        description: |
          The server location to be used:
            * `mixpanel` - The default (US) servers used for most projects
            * `eu.mixpanel` - EU servers if you are enrolled in EU Data Residency
            * `in.mixpanel` - India servers if you are enrolled in India Data Residency
security:
  - ServiceAccount: []
  - ProjectSecret: []
paths:
  /insights/query:
    post:
      parameters:
        - description: The ID of the project to query.
          required: true
          deprecated: false
          schema:
            type: integer
          name: project_id
          in: query
        - description: The ID of the workspace, if applicable.
          required: false
          deprecated: false
          schema:
            type: integer
          name: workspace_id
          in: query
        - description: >-
            The API version, as a release date (YYYY-MM-DD), optionally followed
            by a preview channel (.alpha or .beta). Omitted, the latest released
            version is used.
          required: false
          deprecated: false
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}(?:\.(?:alpha|beta))?$
          name: Mixpanel-Version
          in: header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InsightsQueryRequest'
        required: true
      deprecated: false
components:
  schemas:
    InsightsQueryRequest:
      properties:
        metrics:
          items:
            oneOf:
              - $ref: '#/components/schemas/EventMetric'
              - $ref: '#/components/schemas/FunnelMetric'
              - $ref: '#/components/schemas/RetentionMetric'
              - $ref: '#/components/schemas/CohortMetric'
              - $ref: '#/components/schemas/FormulaMetric'
            discriminator:
              propertyName: type
              mapping:
                cohort: '#/components/schemas/CohortMetric'
                event: '#/components/schemas/EventMetric'
                formula: '#/components/schemas/FormulaMetric'
                funnel: '#/components/schemas/FunnelMetric'
                retention: '#/components/schemas/RetentionMetric'
          type: array
          maxItems: 40
          minItems: 1
          title: Metrics
        time:
          $ref: '#/components/schemas/Time'
        filters:
          anyOf:
            - items:
                oneOf:
                  - $ref: '#/components/schemas/PropertyFilter'
                  - $ref: '#/components/schemas/CohortFilter'
                description: >-
                  Set `type` to `property` to filter on a property value, or
                  `cohort` to filter on cohort membership.
                discriminator:
                  propertyName: type
                  mapping:
                    cohort: '#/components/schemas/CohortFilter'
                    property: '#/components/schemas/PropertyFilter'
              type: array
              maxItems: 10
            - type: 'null'
          title: Filters
        breakdowns:
          anyOf:
            - items:
                oneOf:
                  - $ref: '#/components/schemas/PropertyBreakdown'
                  - $ref: '#/components/schemas/CohortBreakdown'
                discriminator:
                  propertyName: type
                  mapping:
                    cohort: '#/components/schemas/CohortBreakdown'
                    property: '#/components/schemas/PropertyBreakdown'
              type: array
              maxItems: 3
            - type: 'null'
          title: Breakdowns
        time_comparison:
          anyOf:
            - $ref: '#/components/schemas/TimeComparison'
            - type: 'null'
        lift_comparison:
          anyOf:
            - $ref: '#/components/schemas/LiftComparison'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - metrics
        - time
      title: InsightsQueryRequest
      description: |-
        An Insights query: metrics calculated over a time range, with optional
        filters, breakdowns, and comparisons.
    EventMetric:
      properties:
        display_name:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Display Name
        group_key:
          type: string
          minLength: 1
          title: Group Key
          description: >-
            The raw group key name, as shown in Project Settings—for example
            `$company_id`. `User` is the user profile and the default.
          default: User
        measurement:
          oneOf:
            - $ref: '#/components/schemas/EventCountMeasurement'
            - $ref: '#/components/schemas/EventPropertyMeasurement'
            - $ref: '#/components/schemas/EventFrequencyPerUserMeasurement'
            - $ref: '#/components/schemas/EventPropertyPerUserMeasurement'
          title: Measurement
          description: >-
            What the metric calculates. Set `type` to `count`, `property`,
            `frequency_per_user`, or `property_per_user`.
          discriminator:
            propertyName: type
            mapping:
              count: '#/components/schemas/EventCountMeasurement'
              frequency_per_user: '#/components/schemas/EventFrequencyPerUserMeasurement'
              property: '#/components/schemas/EventPropertyMeasurement'
              property_per_user: '#/components/schemas/EventPropertyPerUserMeasurement'
        type:
          type: string
          const: event
          title: Type
        events:
          items:
            oneOf:
              - $ref: '#/components/schemas/Event'
              - $ref: '#/components/schemas/CustomEvent'
            description: >-
              Set `event_type` to `event` for an event tracked into the project,
              or `custom_event` for a saved custom event.
            discriminator:
              propertyName: event_type
              mapping:
                custom_event: '#/components/schemas/CustomEvent'
                event: '#/components/schemas/Event'
          type: array
          minItems: 1
          title: Events
      additionalProperties: false
      type: object
      required:
        - measurement
        - type
        - events
      title: EventMetric
    FunnelMetric:
      properties:
        display_name:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Display Name
        group_key:
          type: string
          minLength: 1
          title: Group Key
          description: >-
            The raw group key name, as shown in Project Settings—for example
            `$company_id`. `User` is the user profile and the default.
          default: User
        measurement:
          oneOf:
            - $ref: '#/components/schemas/FunnelConversionRateMeasurement'
            - $ref: '#/components/schemas/FunnelCountMeasurement'
            - $ref: '#/components/schemas/FunnelTimeToConvertMeasurement'
            - $ref: '#/components/schemas/FunnelPropertyMeasurement'
          title: Measurement
          description: >-
            What the metric calculates. Set `type` to `conversion_rate`,
            `count`, `time_to_convert`, or `property`.
          discriminator:
            propertyName: type
            mapping:
              conversion_rate: '#/components/schemas/FunnelConversionRateMeasurement'
              count: '#/components/schemas/FunnelCountMeasurement'
              property: '#/components/schemas/FunnelPropertyMeasurement'
              time_to_convert: '#/components/schemas/FunnelTimeToConvertMeasurement'
        type:
          type: string
          const: funnel
          title: Type
        steps:
          items:
            $ref: '#/components/schemas/FunnelStep'
          type: array
          maxItems: 25
          minItems: 2
          title: Steps
          description: The funnel steps, first to last.
        conversion_window:
          $ref: '#/components/schemas/ConversionWindow'
          description: >-
            How long after the first step the funnel must complete: a span of
            time or up to 12 sessions. Defaults to 7 days. Measurements with the
            `total_sessions` calculation accept only one session.
          default:
            value: 7
            unit: day
        order:
          $ref: '#/components/schemas/FunnelOrder'
          description: >-
            ordered: steps in sequence, other events may occur between them.
            any: the steps after the first may happen in any order.
          default: ordered
      additionalProperties: false
      type: object
      required:
        - measurement
        - type
        - steps
      title: FunnelMetric
    RetentionMetric:
      properties:
        display_name:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Display Name
        group_key:
          type: string
          minLength: 1
          title: Group Key
          description: >-
            The raw group key name, as shown in Project Settings—for example
            `$company_id`. `User` is the user profile and the default.
          default: User
        measurement:
          oneOf:
            - $ref: '#/components/schemas/RetentionRateMeasurement'
            - $ref: '#/components/schemas/RetentionCountMeasurement'
            - $ref: '#/components/schemas/RetentionPropertyMeasurement'
          title: Measurement
          description: >-
            What the metric reports. Set `type` to `retention_rate`, `count`, or
            `property`.
          discriminator:
            propertyName: type
            mapping:
              count: '#/components/schemas/RetentionCountMeasurement'
              property: '#/components/schemas/RetentionPropertyMeasurement'
              retention_rate: '#/components/schemas/RetentionRateMeasurement'
        type:
          type: string
          const: retention
          title: Type
        start_event:
          oneOf:
            - $ref: '#/components/schemas/Event'
            - $ref: '#/components/schemas/CustomEvent'
          title: Start Event
          description: The event that starts an entity's retention clock.
          discriminator:
            propertyName: event_type
            mapping:
              custom_event: '#/components/schemas/CustomEvent'
              event: '#/components/schemas/Event'
        return_event:
          oneOf:
            - $ref: '#/components/schemas/Event'
            - $ref: '#/components/schemas/CustomEvent'
          title: Return Event
          description: The event that counts as returning.
          discriminator:
            propertyName: event_type
            mapping:
              custom_event: '#/components/schemas/CustomEvent'
              event: '#/components/schemas/Event'
        unit:
          $ref: '#/components/schemas/RetentionUnit'
          description: The size of each retention bucket after the start event.
          default: day
        bucket:
          type: integer
          minimum: 0
          title: Bucket
          description: >-
            Which retention bucket to report, in `unit`s after the start event:
            0 is the start bucket; with unit `day`, 7 is Day 7. Must be within
            the project's retention interval limit, 60 by default.
          default: 0
        criteria:
          $ref: '#/components/schemas/RetentionCriteria'
          description: >-
            When a return event counts toward the bucket: on that bucket only,
            on it or any later one, on it or any earlier one, or on every bucket
            up to it (streak).
          default: 'on'
      additionalProperties: false
      type: object
      required:
        - measurement
        - type
        - start_event
        - return_event
      title: RetentionMetric
    CohortMetric:
      properties:
        display_name:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Display Name
        group_key:
          type: string
          minLength: 1
          title: Group Key
          description: >-
            The raw group key name, as shown in Project Settings—for example
            `$company_id`. `User` is the user profile and the default.
          default: User
        measurement:
          $ref: '#/components/schemas/CohortCountMeasurement'
          default:
            type: count
            interval_aggregation: standard
        type:
          type: string
          const: cohort
          title: Type
        cohort_id:
          type: string
          minLength: 1
          title: Cohort Id
          description: Id of the saved cohort.
        filters:
          items:
            oneOf:
              - $ref: '#/components/schemas/PropertyFilter'
              - $ref: '#/components/schemas/CohortFilter'
            description: >-
              Set `type` to `property` to filter on a property value, or
              `cohort` to filter on cohort membership.
            discriminator:
              propertyName: type
              mapping:
                cohort: '#/components/schemas/CohortFilter'
                property: '#/components/schemas/PropertyFilter'
          type: array
          maxItems: 5
          title: Filters
          description: Profile property or cohort filters narrowing the members counted.
          default: []
      additionalProperties: false
      type: object
      required:
        - type
        - cohort_id
      title: CohortMetric
    FormulaMetric:
      properties:
        type:
          type: string
          const: formula
          title: Type
        display_name:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Display Name
        formula:
          type: string
          minLength: 1
          title: Formula
          description: >-
            Arithmetic over other metrics in this request, each named by its
            `display_name` in curly braces: `{Purchases} / {Signups} * 100`.
            Supports `+ - * / ^`, parentheses, and numbers. Formulas cannot
            reference other formulas.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
      additionalProperties: false
      type: object
      required:
        - type
        - formula
      title: FormulaMetric
    Time:
      properties:
        start:
          anyOf:
            - type: string
              pattern: ^\d{4}-\d{2}-\d{2}$
              description: >-
                Calendar date, YYYY-MM-DD, in the project's timezone. Covers the
                whole day.
            - type: string
              pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$
              description: >-
                Timestamp, YYYY-MM-DDTHH:mm, in the project's timezone. Covers
                the whole minute.
            - $ref: '#/components/schemas/RelativeDate'
          title: Start
          description: Inclusive. Relative hour and minute starts are limited to 336 hours.
        end:
          anyOf:
            - type: string
              pattern: ^\d{4}-\d{2}-\d{2}$
              description: >-
                Calendar date, YYYY-MM-DD, in the project's timezone. Covers the
                whole day.
            - type: string
              pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$
              description: >-
                Timestamp, YYYY-MM-DDTHH:mm, in the project's timezone. Covers
                the whole minute.
            - $ref: '#/components/schemas/RelativeDate'
            - type: 'null'
          title: End
          description: Inclusive. Omitted means now.
        unit:
          anyOf:
            - $ref: '#/components/schemas/TimeUnit'
            - type: 'null'
          description: >-
            The bucket size of the time series. When omitted, the query returns
            a single value for the whole range, and for a retention metric
            everyone who did the start event in the range forms one cohort.
            Rolling averages require a unit.
      additionalProperties: false
      type: object
      required:
        - start
      title: Time
    PropertyFilter:
      properties:
        type:
          type: string
          const: property
          title: Type
        property:
          oneOf:
            - $ref: '#/components/schemas/EventProperty'
            - $ref: '#/components/schemas/ProfileProperty'
            - $ref: '#/components/schemas/LookupProperty'
            - $ref: '#/components/schemas/EventCustomProperty'
            - $ref: '#/components/schemas/ProfileCustomProperty'
          title: Property
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
          discriminator:
            propertyName: source
            mapping:
              event: '#/components/schemas/EventProperty'
              event_custom: '#/components/schemas/EventCustomProperty'
              lookup: '#/components/schemas/LookupProperty'
              profile: '#/components/schemas/ProfileProperty'
              profile_custom: '#/components/schemas/ProfileCustomProperty'
        operator:
          $ref: '#/components/schemas/Operator'
        values:
          anyOf:
            - items:
                anyOf:
                  - type: string
                  - type: integer
                  - type: number
                  - type: boolean
              type: array
            - type: 'null'
          title: Values
          description: >-
            Operands. Omitted for `is set`, `is not set`, `is true`, `is false`;
            exactly two for `is between` / `is not between`; one for `contains`,
            `does not contain` and the other number operators; one or more for
            `equals` / `does not equal`, any of which may match.
        list_match:
          anyOf:
            - $ref: '#/components/schemas/ListMatch'
            - type: 'null'
          description: >-
            For list-valued properties, and for lookup columns whose join key is
            list-valued. Defaults to `any`.
        list_item_match:
          anyOf:
            - $ref: '#/components/schemas/ListMatch'
            - type: 'null'
          description: >-
            For `list[object]` properties whose `list_item` is list-valued:
            whether any or all elements of each object's list must pass.
            Defaults to `any`. `list_match` quantifies over the objects.
        keep_only_matching:
          type: boolean
          title: Keep Only Matching
          description: >-
            For list-valued properties with `list_match: any`: drop the list
            elements that did not match instead of keeping the whole list.
          default: false
      additionalProperties: false
      type: object
      required:
        - type
        - property
        - operator
      title: PropertyFilter
      description: Filters events or profiles by a property value.
    CohortFilter:
      properties:
        type:
          type: string
          const: cohort
          title: Type
        cohort_id:
          type: string
          minLength: 1
          title: Cohort Id
        operator:
          $ref: '#/components/schemas/CohortOperator'
          default: in
      additionalProperties: false
      type: object
      required:
        - type
        - cohort_id
      title: CohortFilter
      description: Keeps users who are, or are not, members of a saved cohort.
    PropertyBreakdown:
      properties:
        type:
          type: string
          const: property
          title: Type
        property:
          oneOf:
            - $ref: '#/components/schemas/EventProperty'
            - $ref: '#/components/schemas/ProfileProperty'
            - $ref: '#/components/schemas/LookupProperty'
            - $ref: '#/components/schemas/EventCustomProperty'
            - $ref: '#/components/schemas/ProfileCustomProperty'
          title: Property
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
          discriminator:
            propertyName: source
            mapping:
              event: '#/components/schemas/EventProperty'
              event_custom: '#/components/schemas/EventCustomProperty'
              lookup: '#/components/schemas/LookupProperty'
              profile: '#/components/schemas/ProfileProperty'
              profile_custom: '#/components/schemas/ProfileCustomProperty'
        datetime_unit:
          anyOf:
            - $ref: '#/components/schemas/DatetimeUnit'
            - type: 'null'
          description: Bucket for datetime properties. Omit for ISO-formatted breakdowns.
        numeric_buckets:
          anyOf:
            - $ref: '#/components/schemas/NumericBuckets'
            - type: 'null'
        string_groups:
          anyOf:
            - items:
                $ref: '#/components/schemas/StringGroup'
              type: array
              minItems: 1
            - type: 'null'
          title: String Groups
      additionalProperties: false
      type: object
      required:
        - type
        - property
      title: PropertyBreakdown
      description: |-
        Groups results by a property's values.

        The optional bucketing follows the property's type: `datetime_unit` for
        datetime, `numeric_buckets` for number, `string_groups` for string.
    CohortBreakdown:
      properties:
        type:
          type: string
          const: cohort
          title: Type
        cohort_ids:
          items:
            type: string
            minLength: 1
          type: array
          maxItems: 10
          minItems: 1
          title: Cohort Ids
      additionalProperties: false
      type: object
      required:
        - type
        - cohort_ids
      title: CohortBreakdown
      description: Groups results by membership in each of the given saved cohorts.
    TimeComparison:
      properties:
        offset:
          $ref: '#/components/schemas/ComparisonOffset'
      additionalProperties: false
      type: object
      required:
        - offset
      title: TimeComparison
      description: An earlier window to run the same query over.
    LiftComparison:
      properties:
        type:
          $ref: '#/components/schemas/LiftType'
      additionalProperties: false
      type: object
      required:
        - type
      title: LiftComparison
      description: |-
        Reports each result as a change against a baseline rather than an
        absolute value.
    EventCountMeasurement:
      properties:
        type:
          type: string
          const: count
          title: Type
          description: >-
            What the metric calculates. Set `type` to `count`, `property`,
            `frequency_per_user`, or `property_per_user`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          $ref: '#/components/schemas/CalculationType'
      additionalProperties: false
      type: object
      required:
        - type
        - calculation
      title: EventCountMeasurement
      description: Counts matching events, sessions, or users.
    EventPropertyMeasurement:
      properties:
        type:
          type: string
          const: property
          title: Type
          description: >-
            What the metric calculates. Set `type` to `count`, `property`,
            `frequency_per_user`, or `property_per_user`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          type: string
          enum:
            - sum
            - average
            - percentile
            - min
            - max
            - distinct_count
          title: Calculation
        percentile:
          anyOf:
            - type: number
              exclusiveMaximum: 100
              exclusiveMinimum: 0
            - type: 'null'
          title: Percentile
          description: >-
            The percentile to compute, strictly between 0 and 100; 50 is the
            median. Required for, and only for, calculation `percentile`.
        property:
          oneOf:
            - $ref: '#/components/schemas/EventProperty'
            - $ref: '#/components/schemas/ProfileProperty'
            - $ref: '#/components/schemas/LookupProperty'
            - $ref: '#/components/schemas/EventCustomProperty'
            - $ref: '#/components/schemas/ProfileCustomProperty'
          title: Property
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
          discriminator:
            propertyName: source
            mapping:
              event: '#/components/schemas/EventProperty'
              event_custom: '#/components/schemas/EventCustomProperty'
              lookup: '#/components/schemas/LookupProperty'
              profile: '#/components/schemas/ProfileProperty'
              profile_custom: '#/components/schemas/ProfileCustomProperty'
      additionalProperties: false
      type: object
      required:
        - type
        - calculation
        - property
      title: EventPropertyMeasurement
      description: |-
        A statistic over a property's values across all matching events.

        Every calculation except `distinct_count` needs a number property.
    EventFrequencyPerUserMeasurement:
      properties:
        type:
          type: string
          const: frequency_per_user
          title: Type
          description: >-
            What the metric calculates. Set `type` to `count`, `property`,
            `frequency_per_user`, or `property_per_user`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          type: string
          enum:
            - distribution
            - average
            - percentile
            - min
            - max
          title: Calculation
        percentile:
          anyOf:
            - type: number
              exclusiveMaximum: 100
              exclusiveMinimum: 0
            - type: 'null'
          title: Percentile
          description: >-
            The percentile to compute, strictly between 0 and 100; 50 is the
            median. Required for, and only for, calculation `percentile`.
      additionalProperties: false
      type: object
      required:
        - type
        - calculation
      title: EventFrequencyPerUserMeasurement
      description: A statistic over how many matching events each user performed.
    EventPropertyPerUserMeasurement:
      properties:
        type:
          type: string
          const: property_per_user
          title: Type
          description: >-
            What the metric calculates. Set `type` to `count`, `property`,
            `frequency_per_user`, or `property_per_user`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          type: string
          enum:
            - distribution
            - sum
            - average
            - percentile
            - min
            - max
          title: Calculation
        percentile:
          anyOf:
            - type: number
              exclusiveMaximum: 100
              exclusiveMinimum: 0
            - type: 'null'
          title: Percentile
          description: >-
            The percentile to compute, strictly between 0 and 100; 50 is the
            median. Required for, and only for, calculation `percentile`.
        property:
          oneOf:
            - $ref: '#/components/schemas/EventProperty'
            - $ref: '#/components/schemas/ProfileProperty'
            - $ref: '#/components/schemas/LookupProperty'
            - $ref: '#/components/schemas/EventCustomProperty'
            - $ref: '#/components/schemas/ProfileCustomProperty'
          title: Property
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
          discriminator:
            propertyName: source
            mapping:
              event: '#/components/schemas/EventProperty'
              event_custom: '#/components/schemas/EventCustomProperty'
              lookup: '#/components/schemas/LookupProperty'
              profile: '#/components/schemas/ProfileProperty'
              profile_custom: '#/components/schemas/ProfileCustomProperty'
        per_user:
          type: string
          enum:
            - sum
            - average
            - distinct_count
            - min
            - max
          title: Per User
          description: >-
            What is computed for each user (each `group_key` entity) before
            `calculation` runs across users.
      additionalProperties: false
      type: object
      required:
        - type
        - calculation
        - property
        - per_user
      title: EventPropertyPerUserMeasurement
      description: |-
        Aggregates a property for each user, then a statistic across users.

        `per_user` other than `distinct_count` needs a number property.
    Event:
      properties:
        filters:
          items:
            oneOf:
              - $ref: '#/components/schemas/PropertyFilter'
              - $ref: '#/components/schemas/CohortFilter'
            description: >-
              Set `type` to `property` to filter on a property value, or
              `cohort` to filter on cohort membership.
            discriminator:
              propertyName: type
              mapping:
                cohort: '#/components/schemas/CohortFilter'
                property: '#/components/schemas/PropertyFilter'
          type: array
          maxItems: 5
          title: Filters
          default: []
        filters_logical_operator:
          $ref: '#/components/schemas/LogicalOperators'
          default: AND
        name:
          type: string
          title: Name
          description: Name of the event as tracked, not its Lexicon display name.
        event_type:
          type: string
          const: event
          title: Event Type
          description: >-
            Set `event_type` to `event` for an event tracked into the project,
            or `custom_event` for a saved custom event.
      additionalProperties: false
      type: object
      required:
        - name
        - event_type
      title: Event
      description: An event tracked into the project.
    CustomEvent:
      properties:
        filters:
          items:
            oneOf:
              - $ref: '#/components/schemas/PropertyFilter'
              - $ref: '#/components/schemas/CohortFilter'
            description: >-
              Set `type` to `property` to filter on a property value, or
              `cohort` to filter on cohort membership.
            discriminator:
              propertyName: type
              mapping:
                cohort: '#/components/schemas/CohortFilter'
                property: '#/components/schemas/PropertyFilter'
          type: array
          maxItems: 5
          title: Filters
          default: []
        filters_logical_operator:
          $ref: '#/components/schemas/LogicalOperators'
          default: AND
        event_type:
          type: string
          const: custom_event
          title: Event Type
          description: >-
            Set `event_type` to `event` for an event tracked into the project,
            or `custom_event` for a saved custom event.
        id:
          type: string
          minLength: 1
          title: Id
          description: Id of the custom event.
      additionalProperties: false
      type: object
      required:
        - event_type
        - id
      title: CustomEvent
      description: A saved custom event, referenced by its id.
    FunnelConversionRateMeasurement:
      properties:
        type:
          type: string
          const: conversion_rate
          title: Type
          description: >-
            What the metric calculates. Set `type` to `conversion_rate`,
            `count`, `time_to_convert`, or `property`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          type: string
          enum:
            - unique_users
            - total_events
            - total_sessions
          title: Calculation
          description: >-
            Determines how conversions are counted: total users, events, or
            sessions. With `total_sessions`, the metric's `conversion_window`
            defaults to one session and accepts no other value.
          default: unique_users
      additionalProperties: false
      type: object
      required:
        - type
      title: FunnelConversionRateMeasurement
      description: >-
        The share of entities that complete the funnel, counted per
        `calculation`.
    FunnelCountMeasurement:
      properties:
        type:
          type: string
          const: count
          title: Type
          description: >-
            What the metric calculates. Set `type` to `conversion_rate`,
            `count`, `time_to_convert`, or `property`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          type: string
          enum:
            - unique_users
            - total_events
            - total_sessions
          title: Calculation
          description: >-
            Determines how conversions are counted: total users, events, or
            sessions. With `total_sessions`, the metric's `conversion_window`
            defaults to one session and accepts no other value.
      additionalProperties: false
      type: object
      required:
        - type
        - calculation
      title: FunnelCountMeasurement
      description: Counts the entities, events, or sessions that complete the funnel.
    FunnelTimeToConvertMeasurement:
      properties:
        type:
          type: string
          const: time_to_convert
          title: Type
          description: >-
            What the metric calculates. Set `type` to `conversion_rate`,
            `count`, `time_to_convert`, or `property`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          type: string
          enum:
            - average
            - percentile
            - min
            - max
          title: Calculation
        percentile:
          anyOf:
            - type: number
              exclusiveMaximum: 100
              exclusiveMinimum: 0
            - type: 'null'
          title: Percentile
          description: >-
            The percentile to compute, strictly between 0 and 100; 50 is the
            median. Required for, and only for, calculation `percentile`.
      additionalProperties: false
      type: object
      required:
        - type
        - calculation
      title: FunnelTimeToConvertMeasurement
      description: A statistic over how long converting entities took, in seconds.
    FunnelPropertyMeasurement:
      properties:
        type:
          type: string
          const: property
          title: Type
          description: >-
            What the metric calculates. Set `type` to `conversion_rate`,
            `count`, `time_to_convert`, or `property`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          type: string
          const: sum
          title: Calculation
          default: sum
        property:
          oneOf:
            - $ref: '#/components/schemas/EventProperty'
            - $ref: '#/components/schemas/ProfileProperty'
            - $ref: '#/components/schemas/LookupProperty'
            - $ref: '#/components/schemas/EventCustomProperty'
            - $ref: '#/components/schemas/ProfileCustomProperty'
          title: Property
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
          discriminator:
            propertyName: source
            mapping:
              event: '#/components/schemas/EventProperty'
              event_custom: '#/components/schemas/EventCustomProperty'
              lookup: '#/components/schemas/LookupProperty'
              profile: '#/components/schemas/ProfileProperty'
              profile_custom: '#/components/schemas/ProfileCustomProperty'
      additionalProperties: false
      type: object
      required:
        - type
        - property
      title: FunnelPropertyMeasurement
      description: >-
        The sum of a number property over the last-step event of each
        conversion.
    FunnelStep:
      properties:
        event:
          oneOf:
            - $ref: '#/components/schemas/Event'
            - $ref: '#/components/schemas/CustomEvent'
          title: Event
          description: >-
            Set `event_type` to `event` for an event tracked into the project,
            or `custom_event` for a saved custom event.
          discriminator:
            propertyName: event_type
            mapping:
              custom_event: '#/components/schemas/CustomEvent'
              event: '#/components/schemas/Event'
      additionalProperties: false
      type: object
      required:
        - event
      title: FunnelStep
      description: 'One funnel step: the event an entity performs at that position.'
    ConversionWindow:
      properties:
        value:
          type: integer
          exclusiveMinimum: 0
          title: Value
          description: >-
            Whole number of `unit`s, at most 31708800 seconds, 528480 minutes,
            8808 hours, 367 days, 52 weeks, 12 months, 12 sessions.
        unit:
          $ref: '#/components/schemas/ConversionWindowUnit'
          description: >-
            `session` counts sessions instead of time: with value N, the funnel
            must complete within the session of the first step or the N - 1
            sessions after it.
      additionalProperties: false
      type: object
      required:
        - value
        - unit
      title: ConversionWindow
      description: How long after the first step an entity has to complete the funnel.
    FunnelOrder:
      type: string
      enum:
        - ordered
        - any
      title: FunnelOrder
      description: |-
        `ordered`: steps in sequence, other events may occur between them.
        `any`: the steps after the first may happen in any order.
    RetentionRateMeasurement:
      properties:
        type:
          type: string
          const: retention_rate
          title: Type
          description: >-
            What the metric reports. Set `type` to `retention_rate`, `count`, or
            `property`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
      additionalProperties: false
      type: object
      required:
        - type
      title: RetentionRateMeasurement
      description: >-
        The share of entities that did the start event and returned in the
        bucket.
    RetentionCountMeasurement:
      properties:
        type:
          type: string
          const: count
          title: Type
          description: >-
            What the metric reports. Set `type` to `retention_rate`, `count`, or
            `property`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          type: string
          const: unique_users
          title: Calculation
          default: unique_users
      additionalProperties: false
      type: object
      required:
        - type
      title: RetentionCountMeasurement
      description: Counts the entities retained in the bucket.
    RetentionPropertyMeasurement:
      properties:
        type:
          type: string
          const: property
          title: Type
          description: >-
            What the metric reports. Set `type` to `retention_rate`, `count`, or
            `property`.
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
        calculation:
          type: string
          enum:
            - sum
            - average
          title: Calculation
        property:
          oneOf:
            - $ref: '#/components/schemas/EventProperty'
            - $ref: '#/components/schemas/ProfileProperty'
            - $ref: '#/components/schemas/LookupProperty'
            - $ref: '#/components/schemas/EventCustomProperty'
            - $ref: '#/components/schemas/ProfileCustomProperty'
          title: Property
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
          discriminator:
            propertyName: source
            mapping:
              event: '#/components/schemas/EventProperty'
              event_custom: '#/components/schemas/EventCustomProperty'
              lookup: '#/components/schemas/LookupProperty'
              profile: '#/components/schemas/ProfileProperty'
              profile_custom: '#/components/schemas/ProfileCustomProperty'
      additionalProperties: false
      type: object
      required:
        - type
        - calculation
        - property
      title: RetentionPropertyMeasurement
      description: >-
        A number property over the cohort's return events in the bucket: `sum`
        adds it

        up, `average` is the mean of each cohort member's sum, counting members
        who did not

        return as 0.
    RetentionUnit:
      type: string
      enum:
        - day
        - week
        - month
      title: RetentionUnit
    RetentionCriteria:
      type: string
      enum:
        - 'on'
        - on_or_after
        - on_or_before
        - streak
      title: RetentionCriteria
      description: >-
        When a return event counts toward a bucket: `on` that bucket only,

        `on_or_after` that bucket or any later one, `on_or_before` that bucket
        or

        any earlier one, `streak` every bucket up to and including it.
    CohortCountMeasurement:
      properties:
        type:
          type: string
          const: count
          title: Type
          default: count
        interval_aggregation:
          anyOf:
            - type: string
              enum:
                - standard
                - cumulative
            - $ref: '#/components/schemas/RollingAverage'
          title: Interval Aggregation
          default: standard
      additionalProperties: false
      type: object
      title: CohortCountMeasurement
    RollingAverage:
      properties:
        size:
          type: integer
          title: Size
          description: Number of time buckets to average over.
      additionalProperties: false
      type: object
      required:
        - size
      title: RollingAverage
      description: |-
        A rolling average over a number of time buckets. The request must set
        `time.unit`, which sizes each bucket.
    RelativeDate:
      properties:
        unit:
          $ref: '#/components/schemas/TimeUnit'
          description: Time unit.
        value:
          type: integer
          minimum: 0
          title: Value
          description: Whole non-negative number of units.
        align_to_whole_unit:
          type: boolean
          title: Align To Whole Unit
          description: >-
            false: `value` units before now. true: rounded to a whole `unit`.
            For example: start 2 weeks ago -> false: 14 days before today; true:
            the beginning of that calendar week. end 1 month ago -> false: 30
            days before today; true: the last day of the previous calendar
            month. 
      additionalProperties: false
      type: object
      required:
        - unit
        - value
        - align_to_whole_unit
      title: RelativeDate
    TimeUnit:
      type: string
      enum:
        - minute
        - hour
        - day
        - week
        - month
        - quarter
      title: TimeUnit
    EventProperty:
      properties:
        type:
          $ref: '#/components/schemas/PropertyType'
        path:
          anyOf:
            - items:
                type: string
                minLength: 1
              type: array
              minItems: 1
            - type: 'null'
          title: Path
          description: Key path into an object-valued property.
        list_item:
          anyOf:
            - $ref: '#/components/schemas/ListItem'
            - type: 'null'
          description: Required for, and only for, `list[object]`.
        source:
          type: string
          const: event
          title: Source
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
        name:
          type: string
          minLength: 1
          title: Name
      additionalProperties: false
      type: object
      required:
        - type
        - source
        - name
      title: EventProperty
      description: A property recorded on the event.
    ProfileProperty:
      properties:
        type:
          $ref: '#/components/schemas/PropertyType'
        path:
          anyOf:
            - items:
                type: string
                minLength: 1
              type: array
              minItems: 1
            - type: 'null'
          title: Path
          description: Key path into an object-valued property.
        list_item:
          anyOf:
            - $ref: '#/components/schemas/ListItem'
            - type: 'null'
          description: Required for, and only for, `list[object]`.
        source:
          type: string
          const: profile
          title: Source
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
        name:
          type: string
          minLength: 1
          title: Name
        group_key:
          type: string
          minLength: 1
          title: Group Key
          description: >-
            The raw group key name, as shown in Project Settings—for example
            `$company_id`. `User` is the user profile and the default.
          default: User
      additionalProperties: false
      type: object
      required:
        - type
        - source
        - name
      title: ProfileProperty
      description: |-
        A property on a user profile or a group profile (company, organization,
        ...), read as of query time.

        `group_key` names which profile.
    LookupProperty:
      properties:
        type:
          $ref: '#/components/schemas/PropertyType'
        path:
          anyOf:
            - items:
                type: string
                minLength: 1
              type: array
              minItems: 1
            - type: 'null'
          title: Path
          description: Key path into an object-valued property.
        list_item:
          anyOf:
            - $ref: '#/components/schemas/ListItem'
            - type: 'null'
          description: Required for, and only for, `list[object]`.
        source:
          type: string
          const: lookup
          title: Source
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
        join_key:
          oneOf:
            - $ref: '#/components/schemas/EventJoinKey'
            - $ref: '#/components/schemas/ProfileJoinKey'
            - $ref: '#/components/schemas/EventCustomJoinKey'
            - $ref: '#/components/schemas/ProfileCustomJoinKey'
          title: Join Key
          description: >-
            The property the lookup table is joined on. Set `source` to `event`,
            `profile`, `event_custom`, or `profile_custom`.
          discriminator:
            propertyName: source
            mapping:
              event: '#/components/schemas/EventJoinKey'
              event_custom: '#/components/schemas/EventCustomJoinKey'
              profile: '#/components/schemas/ProfileJoinKey'
              profile_custom: '#/components/schemas/ProfileCustomJoinKey'
        column:
          type: string
          minLength: 1
          title: Column
          description: >-
            Name of the column to read from the lookup table joined on
            `join_key`.
      additionalProperties: false
      type: object
      required:
        - type
        - source
        - join_key
        - column
      title: LookupProperty
      description: >-
        A column of a lookup table, reached through the property it is joined
        on.


        The table is not named: each join key maps to at most one lookup table,
        and

        a column name alone is ambiguous across tables. Group profiles are not

        lookup tables; their properties are `profile` properties with a
        `group_key`.
    EventCustomProperty:
      properties:
        type:
          $ref: '#/components/schemas/PropertyType'
        path:
          anyOf:
            - items:
                type: string
                minLength: 1
              type: array
              minItems: 1
            - type: 'null'
          title: Path
          description: Key path into an object-valued property.
        list_item:
          anyOf:
            - $ref: '#/components/schemas/ListItem'
            - type: 'null'
          description: Required for, and only for, `list[object]`.
        source:
          type: string
          const: event_custom
          title: Source
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
        id:
          type: string
          minLength: 1
          title: Id
      additionalProperties: false
      type: object
      required:
        - type
        - source
        - id
      title: EventCustomProperty
      description: A saved custom property computed on the event, by id.
    ProfileCustomProperty:
      properties:
        type:
          $ref: '#/components/schemas/PropertyType'
        path:
          anyOf:
            - items:
                type: string
                minLength: 1
              type: array
              minItems: 1
            - type: 'null'
          title: Path
          description: Key path into an object-valued property.
        list_item:
          anyOf:
            - $ref: '#/components/schemas/ListItem'
            - type: 'null'
          description: Required for, and only for, `list[object]`.
        source:
          type: string
          const: profile_custom
          title: Source
          description: >-
            Set `source` to `event` for a property recorded on the event,
            `profile` for a property on a user profile or a data group profile
            named by `group_key`, `event_custom` or `profile_custom` for a saved
            custom property computed on events or profiles, or `lookup` for a
            column of a lookup table.
        id:
          type: string
          minLength: 1
          title: Id
        group_key:
          type: string
          minLength: 1
          title: Group Key
          description: >-
            The raw group key name, as shown in Project Settings—for example
            `$company_id`. `User` is the user profile and the default.
          default: User
      additionalProperties: false
      type: object
      required:
        - type
        - source
        - id
      title: ProfileCustomProperty
      description: |-
        A saved custom property computed on a user or group profile, by id.

        `group_key` names which profile, as for `profile` properties.
    Operator:
      type: string
      enum:
        - is set
        - is not set
        - equals
        - does not equal
        - contains
        - does not contain
        - is equal to
        - is not equal to
        - is greater than
        - is at least
        - is less than
        - is at most
        - is between
        - is not between
        - is true
        - is false
      title: Operator
      description: |-
        The comparison a property filter applies.

        Which operators are valid depends on the property's `type`.
    ListMatch:
      type: string
      enum:
        - any
        - all
      title: ListMatch
      description: |-
        How a filter treats a list-valued property: match when any element
        passes, or only when all do.
    CohortOperator:
      type: string
      enum:
        - in
        - not in
      title: CohortOperator
    DatetimeUnit:
      type: string
      enum:
        - hour
        - day
        - week
        - month
        - quarter
        - year
        - hour_of_day
        - day_of_week
      title: DatetimeUnit
      description: |-
        Bucket for a datetime property. The first six are calendar units; the
        last two are cyclic.
    NumericBuckets:
      properties:
        min:
          type: number
          title: Min
        max:
          type: number
          title: Max
        bucket_size:
          type: number
          exclusiveMinimum: 0
          title: Bucket Size
        intervals:
          anyOf:
            - items:
                type: number
              type: array
              minItems: 1
            - type: 'null'
          title: Intervals
          description: Ascending breakpoints for uneven buckets; overrides `bucket_size`.
      additionalProperties: false
      type: object
      required:
        - min
        - max
        - bucket_size
      title: NumericBuckets
      description: Fixed-width buckets over a number property, or explicit `intervals`.
    StringGroup:
      properties:
        values:
          items:
            type: string
          type: array
          minItems: 1
          title: Values
          description: >-
            One or more values for `equals`, any of which may match; one for
            `contains`.
        match:
          $ref: '#/components/schemas/StringGroupMatch'
          default: equals
        name:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Name
      additionalProperties: false
      type: object
      required:
        - values
      title: StringGroup
      description: |-
        A named bucket of string values. `""` is a valid value: it groups the
        records whose property is the empty string.
    ComparisonOffset:
      properties:
        unit:
          type: string
          enum:
            - day
            - week
            - month
            - quarter
          title: Unit
        value:
          type: integer
          exclusiveMinimum: 0
          title: Value
          description: >-
            Number of periods back to compare against, up to 2 years: 730 days,
            104 weeks, 24 months, 8 quarters.
      additionalProperties: false
      type: object
      required:
        - unit
        - value
      title: ComparisonOffset
      description: How far back the comparison period sits from the queried window.
    LiftType:
      type: string
      enum:
        - overall
        - time
      title: LiftType
      description: |-
        What each result is expressed relative to: `overall` the total across
        breakdown values, `time` the request's earlier window.
    CalculationType:
      type: string
      enum:
        - total_events
        - total_sessions
        - unique_users
        - daily_active_users
        - monthly_active_users
        - weekly_active_users
      title: CalculationType
      description: >-
        The calculation a metric runs over its events or profiles.


        Separate from the interval aggregation, which rolls those calculated
        values

        up across time buckets.
    LogicalOperators:
      type: string
      enum:
        - AND
        - OR
      title: LogicalOperators
      description: >-
        How a list of filters is combined: `AND` keeps what matches every
        filter, `OR`

        what matches any of them.
    ConversionWindowUnit:
      type: string
      enum:
        - second
        - minute
        - hour
        - day
        - week
        - month
        - session
      title: ConversionWindowUnit
    PropertyType:
      type: string
      enum:
        - string
        - number
        - boolean
        - datetime
        - list[string]
        - list[number]
        - list[boolean]
        - list[datetime]
        - list[list]
        - list[object]
      title: PropertyType
      description: |-
        The type a property's value is interpreted as.

        Required, because the query does not look a property's type up.
        `list[object]` is only usable together with `list_item`, which picks one
        key out of each object.
    ListItem:
      properties:
        key_path:
          items:
            type: string
            minLength: 1
          type: array
          minItems: 1
          title: Key Path
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - datetime
            - list[string]
            - list[number]
            - list[boolean]
            - list[datetime]
            - list[list]
          title: Type
      additionalProperties: false
      type: object
      required:
        - key_path
        - type
      title: ListItem
      description: >-
        Reads one primitive key out of each object in a `list[object]` property,

        so the list can be filtered or broken down like a `list[<type>]`.


        `key_path` is the path from the object root to the leaf value: `["sku"]`
        for a

        top-level key, `["details", "sku"]` for a nested one.
    EventJoinKey:
      properties:
        source:
          type: string
          const: event
          title: Source
          description: >-
            The property the lookup table is joined on. Set `source` to `event`,
            `profile`, `event_custom`, or `profile_custom`.
        name:
          type: string
          minLength: 1
          title: Name
          description: Name of the event property.
      additionalProperties: false
      type: object
      required:
        - source
        - name
      title: EventJoinKey
      description: An event property a lookup table is attached to.
    ProfileJoinKey:
      properties:
        source:
          type: string
          const: profile
          title: Source
          description: >-
            The property the lookup table is joined on. Set `source` to `event`,
            `profile`, `event_custom`, or `profile_custom`.
        name:
          type: string
          minLength: 1
          title: Name
          description: Name of the user profile property.
      additionalProperties: false
      type: object
      required:
        - source
        - name
      title: ProfileJoinKey
      description: |-
        A user profile property a lookup table is attached to.

        A `profile` join key always means the `$user_id` profile.
    EventCustomJoinKey:
      properties:
        source:
          type: string
          const: event_custom
          title: Source
          description: >-
            The property the lookup table is joined on. Set `source` to `event`,
            `profile`, `event_custom`, or `profile_custom`.
        id:
          type: string
          minLength: 1
          title: Id
      additionalProperties: false
      type: object
      required:
        - source
        - id
      title: EventCustomJoinKey
      description: A saved event custom property a lookup table is attached to.
    ProfileCustomJoinKey:
      properties:
        source:
          type: string
          const: profile_custom
          title: Source
          description: >-
            The property the lookup table is joined on. Set `source` to `event`,
            `profile`, `event_custom`, or `profile_custom`.
        id:
          type: string
          minLength: 1
          title: Id
      additionalProperties: false
      type: object
      required:
        - source
        - id
      title: ProfileCustomJoinKey
      description: |-
        A saved user profile custom property a lookup table is attached to.

        A `profile_custom` join key always means the `$user_id` profile.
    StringGroupMatch:
      type: string
      enum:
        - contains
        - equals
      title: StringGroupMatch
  securitySchemes:
    ServiceAccount:
      type: http
      description: Service Account
      scheme: basic
    ProjectSecret:
      type: http
      description: Project Secret
      scheme: basic

````