{
  "openapi": "3.1.0",
  "info": {
    "title": "Mixpanel Platform API",
    "version": "1",
    "description": ""
  },
  "servers": [
    {
      "url": "https://platform-us.mixpanel.com",
      "description": "US"
    },
    {
      "url": "https://platform-eu.mixpanel.com",
      "description": "EU"
    },
    {
      "url": "https://platform-in.mixpanel.com",
      "description": "IN"
    }
  ],
  "paths": {
    "/v1/projects/{project_id}/data-definitions": {
      "get": {
        "operationId": "list_project_data_definitions",
        "summary": "List Project Data Definitions",
        "parameters": [
          {
            "in": "query",
            "name": "page_size",
            "schema": {
              "default": 100,
              "description": "Items per page.",
              "maximum": 1000,
              "minimum": 1,
              "title": "Page Size",
              "type": "integer"
            },
            "required": false,
            "description": "Items per page."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Previous or next cursor used to paginate.",
              "title": "Cursor"
            },
            "required": false,
            "description": "Previous or next cursor used to paginate."
          },
          {
            "in": "query",
            "name": "order",
            "schema": {
              "default": "asc",
              "description": "Sort order by name: 'asc' or 'desc'.",
              "enum": [
                "asc",
                "desc"
              ],
              "title": "Order",
              "type": "string"
            },
            "required": false,
            "description": "Sort order by name: 'asc' or 'desc'."
          },
          {
            "in": "query",
            "name": "name",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Case-insensitive substring of the definition name.",
              "title": "Name"
            },
            "required": false,
            "description": "Case-insensitive substring of the definition name."
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "description": "Only definitions of these types.",
              "items": {
                "enum": [
                  "event",
                  "custom_event",
                  "event_property",
                  "custom_property",
                  "metric",
                  "behavior",
                  "cohort"
                ],
                "type": "string"
              },
              "title": "Type",
              "type": "array"
            },
            "required": false,
            "description": "Only definitions of these types."
          },
          {
            "in": "query",
            "name": "event_name",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only properties of this event.",
              "title": "Event Name"
            },
            "required": false,
            "description": "Only properties of this event."
          },
          {
            "in": "query",
            "name": "hidden",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition is hidden.",
              "title": "Hidden"
            },
            "required": false,
            "description": "Whether the definition is hidden."
          },
          {
            "in": "query",
            "name": "blocked",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition is blocked. Types that cannot be blocked are never blocked.",
              "title": "Blocked"
            },
            "required": false,
            "description": "Whether the definition is blocked. Types that cannot be blocked are never blocked."
          },
          {
            "in": "query",
            "name": "tag",
            "schema": {
              "description": "Only definitions carrying one of these tags.",
              "items": {
                "type": "string"
              },
              "title": "Tag",
              "type": "array"
            },
            "required": false,
            "description": "Only definitions carrying one of these tags."
          },
          {
            "in": "query",
            "name": "owner_user_id",
            "schema": {
              "description": "Only definitions owned by one of these users.",
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "title": "Owner User Id",
              "type": "array"
            },
            "required": false,
            "description": "Only definitions owned by one of these users."
          },
          {
            "in": "query",
            "name": "owner_team_id",
            "schema": {
              "description": "Only definitions owned by one of these teams.",
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "title": "Owner Team Id",
              "type": "array"
            },
            "required": false,
            "description": "Only definitions owned by one of these teams."
          },
          {
            "in": "query",
            "name": "has_description",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition has a description.",
              "title": "Has Description"
            },
            "required": false,
            "description": "Whether the definition has a description."
          },
          {
            "in": "query",
            "name": "has_owner",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition has an owner.",
              "title": "Has Owner"
            },
            "required": false,
            "description": "Whether the definition has an owner."
          },
          {
            "in": "query",
            "name": "verified",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition is verified.",
              "title": "Verified"
            },
            "required": false,
            "description": "Whether the definition is verified."
          },
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDataDefinitionsResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "List the project's data definitions, ordered by name.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "post": {
        "operationId": "create_project_data_definition",
        "summary": "Create Project Data Definition",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "discriminator": {
                    "mapping": {
                      "behavior": "#/components/schemas/BehaviorDataDefinitionResponse",
                      "cohort": "#/components/schemas/CohortDataDefinitionResponse",
                      "custom_event": "#/components/schemas/CustomEventDataDefinitionResponse",
                      "custom_property": "#/components/schemas/CustomPropertyDataDefinitionResponse",
                      "event": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "event_property": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "metric": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DataDefinitionWithoutBodyResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomEventDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomPropertyDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BehaviorDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CohortDataDefinitionResponse"
                    }
                  ],
                  "title": "Response"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Create a data definition in the project.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "discriminator": {
                  "mapping": {
                    "behavior": "#/components/schemas/CreateBehaviorDataDefinitionRequest",
                    "cohort": "#/components/schemas/CreateCohortDataDefinitionRequest",
                    "custom_event": "#/components/schemas/CreateCustomEventDataDefinitionRequest",
                    "custom_property": "#/components/schemas/CreateCustomPropertyDataDefinitionRequest",
                    "event": "#/components/schemas/CreateDataDefinitionWithoutBodyRequest",
                    "event_property": "#/components/schemas/CreateDataDefinitionWithoutBodyRequest",
                    "metric": "#/components/schemas/CreateMetricDataDefinitionRequest"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CreateDataDefinitionWithoutBodyRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateCustomEventDataDefinitionRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateCustomPropertyDataDefinitionRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateBehaviorDataDefinitionRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateMetricDataDefinitionRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateCohortDataDefinitionRequest"
                  }
                ],
                "title": "Payload"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner",
          "Admin"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge> <Badge size=\"sm\">Admin</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/projects/{project_id}/data-definitions/merge": {
      "post": {
        "operationId": "merge_project_data_definition",
        "summary": "Merge Project Data Definition",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergeDataDefinitionResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Merge source events or properties into one canonical in the project.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeDataDefinitionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "merge_events_properties",
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">merge_events_properties</Badge> <Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/projects/{project_id}/data-definitions/unmerge": {
      "post": {
        "operationId": "unmerge_project_data_definition",
        "summary": "Unmerge Project Data Definition",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnmergeDataDefinitionResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Unmerge source events or properties out of one canonical in the project. Leave the sources\nout to unmerge every definition merged into the canonical.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnmergeDataDefinitionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "merge_events_properties",
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">merge_events_properties</Badge> <Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/projects/{project_id}/data-definitions/{definition_id}": {
      "get": {
        "operationId": "get_project_data_definition",
        "summary": "Get Project Data Definition",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "schema": {
              "title": "Definition Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "discriminator": {
                    "mapping": {
                      "behavior": "#/components/schemas/BehaviorDataDefinitionResponse",
                      "cohort": "#/components/schemas/CohortDataDefinitionResponse",
                      "custom_event": "#/components/schemas/CustomEventDataDefinitionResponse",
                      "custom_property": "#/components/schemas/CustomPropertyDataDefinitionResponse",
                      "event": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "event_property": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "metric": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DataDefinitionWithoutBodyResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomEventDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomPropertyDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BehaviorDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CohortDataDefinitionResponse"
                    }
                  ],
                  "title": "Response"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Get one of the project's data definitions, including its type-specific definition.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "delete": {
        "operationId": "delete_project_data_definition",
        "summary": "Delete Project Data Definition",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "schema": {
              "title": "Definition Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteDataDefinitionResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Delete one of the project's saved data definitions. Deleting an event or event property\nresets its definition: the name stays listed while it has tracked data. An event with\nevent-specific property definitions needs them deleted first. A\ndefinition flagged sensitive, dropped, or merged can't be deleted.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "patch": {
        "operationId": "patch_project_data_definition",
        "summary": "Patch Project Data Definition",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "schema": {
              "title": "Definition Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "discriminator": {
                    "mapping": {
                      "behavior": "#/components/schemas/BehaviorDataDefinitionResponse",
                      "cohort": "#/components/schemas/CohortDataDefinitionResponse",
                      "custom_event": "#/components/schemas/CustomEventDataDefinitionResponse",
                      "custom_property": "#/components/schemas/CustomPropertyDataDefinitionResponse",
                      "event": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "event_property": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "metric": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DataDefinitionWithoutBodyResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomEventDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomPropertyDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BehaviorDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CohortDataDefinitionResponse"
                    }
                  ],
                  "title": "Response"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Update fields of one of the project's data definitions. Fields left out are unchanged.\nEvery field's permission is checked before anything is written.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchDataDefinitionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      }
    },
    "/v1/projects/{project_id}/data-definition-tags": {
      "get": {
        "operationId": "list_project_data_definition_tags",
        "summary": "List Project Data Definition Tags",
        "parameters": [
          {
            "in": "query",
            "name": "page_size",
            "schema": {
              "default": 100,
              "description": "Items per page.",
              "maximum": 1000,
              "minimum": 1,
              "title": "Page Size",
              "type": "integer"
            },
            "required": false,
            "description": "Items per page."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Previous or next cursor used to paginate.",
              "title": "Cursor"
            },
            "required": false,
            "description": "Previous or next cursor used to paginate."
          },
          {
            "in": "query",
            "name": "order",
            "schema": {
              "default": "asc",
              "description": "Sort order: 'asc' or 'desc'.",
              "enum": [
                "asc",
                "desc"
              ],
              "title": "Order",
              "type": "string"
            },
            "required": false,
            "description": "Sort order: 'asc' or 'desc'."
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "default": "name",
              "description": "Sort by tag name, or by entity count with ties broken by name.",
              "enum": [
                "name",
                "entity_count"
              ],
              "title": "Sort",
              "type": "string"
            },
            "required": false,
            "description": "Sort by tag name, or by entity count with ties broken by name."
          },
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDataDefinitionTagsResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "List the project's data definition tags.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "post": {
        "operationId": "create_project_data_definition_tag",
        "summary": "Create Project Data Definition Tag",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDefinitionTagResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Create a data definition tag in the project.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDataDefinitionTagRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner",
          "Admin"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge> <Badge size=\"sm\">Admin</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/projects/{project_id}/data-definition-tags/{tag_id}": {
      "get": {
        "operationId": "get_project_data_definition_tag",
        "summary": "Get Project Data Definition Tag",
        "parameters": [
          {
            "in": "path",
            "name": "tag_id",
            "schema": {
              "title": "Tag Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDefinitionTagResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Get one of the project's data definition tags.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "patch": {
        "operationId": "rename_project_data_definition_tag",
        "summary": "Rename Project Data Definition Tag",
        "parameters": [
          {
            "in": "path",
            "name": "tag_id",
            "schema": {
              "title": "Tag Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDefinitionTagResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Rename one of the project's data definition tags. Definitions carrying the tag keep it.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDataDefinitionTagRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner",
          "Admin"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge> <Badge size=\"sm\">Admin</Badge></p>\n  </div>\n</div>"
        }
      },
      "delete": {
        "operationId": "delete_project_data_definition_tag",
        "summary": "Delete Project Data Definition Tag",
        "parameters": [
          {
            "in": "path",
            "name": "tag_id",
            "schema": {
              "title": "Tag Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteDataDefinitionTagResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Delete one of the project's data definition tags and remove it from every definition\ncarrying it. The definitions are otherwise unchanged.",
        "tags": [
          "Projects",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner",
          "Admin"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge> <Badge size=\"sm\">Admin</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/workspaces/{workspace_id}/data-definitions": {
      "get": {
        "operationId": "list_workspace_data_definitions",
        "summary": "List Workspace Data Definitions",
        "parameters": [
          {
            "in": "query",
            "name": "page_size",
            "schema": {
              "default": 100,
              "description": "Items per page.",
              "maximum": 1000,
              "minimum": 1,
              "title": "Page Size",
              "type": "integer"
            },
            "required": false,
            "description": "Items per page."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Previous or next cursor used to paginate.",
              "title": "Cursor"
            },
            "required": false,
            "description": "Previous or next cursor used to paginate."
          },
          {
            "in": "query",
            "name": "order",
            "schema": {
              "default": "asc",
              "description": "Sort order by name: 'asc' or 'desc'.",
              "enum": [
                "asc",
                "desc"
              ],
              "title": "Order",
              "type": "string"
            },
            "required": false,
            "description": "Sort order by name: 'asc' or 'desc'."
          },
          {
            "in": "query",
            "name": "name",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Case-insensitive substring of the definition name.",
              "title": "Name"
            },
            "required": false,
            "description": "Case-insensitive substring of the definition name."
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "description": "Only definitions of these types.",
              "items": {
                "enum": [
                  "event",
                  "custom_event",
                  "event_property",
                  "custom_property",
                  "metric",
                  "behavior",
                  "cohort"
                ],
                "type": "string"
              },
              "title": "Type",
              "type": "array"
            },
            "required": false,
            "description": "Only definitions of these types."
          },
          {
            "in": "query",
            "name": "event_name",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only properties of this event.",
              "title": "Event Name"
            },
            "required": false,
            "description": "Only properties of this event."
          },
          {
            "in": "query",
            "name": "hidden",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition is hidden.",
              "title": "Hidden"
            },
            "required": false,
            "description": "Whether the definition is hidden."
          },
          {
            "in": "query",
            "name": "blocked",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition is blocked. Types that cannot be blocked are never blocked.",
              "title": "Blocked"
            },
            "required": false,
            "description": "Whether the definition is blocked. Types that cannot be blocked are never blocked."
          },
          {
            "in": "query",
            "name": "tag",
            "schema": {
              "description": "Only definitions carrying one of these tags.",
              "items": {
                "type": "string"
              },
              "title": "Tag",
              "type": "array"
            },
            "required": false,
            "description": "Only definitions carrying one of these tags."
          },
          {
            "in": "query",
            "name": "owner_user_id",
            "schema": {
              "description": "Only definitions owned by one of these users.",
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "title": "Owner User Id",
              "type": "array"
            },
            "required": false,
            "description": "Only definitions owned by one of these users."
          },
          {
            "in": "query",
            "name": "owner_team_id",
            "schema": {
              "description": "Only definitions owned by one of these teams.",
              "items": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              "title": "Owner Team Id",
              "type": "array"
            },
            "required": false,
            "description": "Only definitions owned by one of these teams."
          },
          {
            "in": "query",
            "name": "has_description",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition has a description.",
              "title": "Has Description"
            },
            "required": false,
            "description": "Whether the definition has a description."
          },
          {
            "in": "query",
            "name": "has_owner",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition has an owner.",
              "title": "Has Owner"
            },
            "required": false,
            "description": "Whether the definition has an owner."
          },
          {
            "in": "query",
            "name": "verified",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether the definition is verified.",
              "title": "Verified"
            },
            "required": false,
            "description": "Whether the definition is verified."
          },
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDataDefinitionsResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "List the data definitions of the workspace's project, ordered by name.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "post": {
        "operationId": "create_workspace_data_definition",
        "summary": "Create Workspace Data Definition",
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "discriminator": {
                    "mapping": {
                      "behavior": "#/components/schemas/BehaviorDataDefinitionResponse",
                      "cohort": "#/components/schemas/CohortDataDefinitionResponse",
                      "custom_event": "#/components/schemas/CustomEventDataDefinitionResponse",
                      "custom_property": "#/components/schemas/CustomPropertyDataDefinitionResponse",
                      "event": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "event_property": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "metric": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DataDefinitionWithoutBodyResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomEventDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomPropertyDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BehaviorDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CohortDataDefinitionResponse"
                    }
                  ],
                  "title": "Response"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Create a data definition in the workspace's project.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "discriminator": {
                  "mapping": {
                    "behavior": "#/components/schemas/CreateBehaviorDataDefinitionRequest",
                    "cohort": "#/components/schemas/CreateCohortDataDefinitionRequest",
                    "custom_event": "#/components/schemas/CreateCustomEventDataDefinitionRequest",
                    "custom_property": "#/components/schemas/CreateCustomPropertyDataDefinitionRequest",
                    "event": "#/components/schemas/CreateDataDefinitionWithoutBodyRequest",
                    "event_property": "#/components/schemas/CreateDataDefinitionWithoutBodyRequest",
                    "metric": "#/components/schemas/CreateMetricDataDefinitionRequest"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CreateDataDefinitionWithoutBodyRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateCustomEventDataDefinitionRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateCustomPropertyDataDefinitionRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateBehaviorDataDefinitionRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateMetricDataDefinitionRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CreateCohortDataDefinitionRequest"
                  }
                ],
                "title": "Payload"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner",
          "Admin"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge> <Badge size=\"sm\">Admin</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/workspaces/{workspace_id}/data-definitions/merge": {
      "post": {
        "operationId": "merge_workspace_data_definition",
        "summary": "Merge Workspace Data Definition",
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergeDataDefinitionResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Merge source events or properties into one canonical in the workspace's project.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeDataDefinitionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "merge_events_properties",
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">merge_events_properties</Badge> <Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/workspaces/{workspace_id}/data-definitions/unmerge": {
      "post": {
        "operationId": "unmerge_workspace_data_definition",
        "summary": "Unmerge Workspace Data Definition",
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnmergeDataDefinitionResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Unmerge source events or properties out of one canonical in the workspace's project. Leave\nthe sources out to unmerge every definition merged into the canonical.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnmergeDataDefinitionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "merge_events_properties",
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">merge_events_properties</Badge> <Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/workspaces/{workspace_id}/data-definitions/{definition_id}": {
      "get": {
        "operationId": "get_workspace_data_definition",
        "summary": "Get Workspace Data Definition",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "schema": {
              "title": "Definition Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "discriminator": {
                    "mapping": {
                      "behavior": "#/components/schemas/BehaviorDataDefinitionResponse",
                      "cohort": "#/components/schemas/CohortDataDefinitionResponse",
                      "custom_event": "#/components/schemas/CustomEventDataDefinitionResponse",
                      "custom_property": "#/components/schemas/CustomPropertyDataDefinitionResponse",
                      "event": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "event_property": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "metric": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DataDefinitionWithoutBodyResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomEventDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomPropertyDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BehaviorDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CohortDataDefinitionResponse"
                    }
                  ],
                  "title": "Response"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Get one of the workspace project's data definitions, including its type-specific\ndefinition.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "delete": {
        "operationId": "delete_workspace_data_definition",
        "summary": "Delete Workspace Data Definition",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "schema": {
              "title": "Definition Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteDataDefinitionResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Delete one of the workspace project's saved data definitions. Deleting an event or event\nproperty resets its definition: the name stays listed while it has tracked data. An event\nwith event-specific property definitions needs them deleted first. A\ndefinition flagged sensitive, dropped, or merged can't be deleted.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "patch": {
        "operationId": "patch_workspace_data_definition",
        "summary": "Patch Workspace Data Definition",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "schema": {
              "title": "Definition Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "discriminator": {
                    "mapping": {
                      "behavior": "#/components/schemas/BehaviorDataDefinitionResponse",
                      "cohort": "#/components/schemas/CohortDataDefinitionResponse",
                      "custom_event": "#/components/schemas/CustomEventDataDefinitionResponse",
                      "custom_property": "#/components/schemas/CustomPropertyDataDefinitionResponse",
                      "event": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "event_property": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                      "metric": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DataDefinitionWithoutBodyResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomEventDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CustomPropertyDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BehaviorDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/MetricDataDefinitionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CohortDataDefinitionResponse"
                    }
                  ],
                  "title": "Response"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Update fields of one of the workspace project's data definitions. Fields left out are unchanged.\nEvery field's permission is checked before anything is written.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchDataDefinitionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      }
    },
    "/v1/workspaces/{workspace_id}/data-definition-tags": {
      "get": {
        "operationId": "list_workspace_data_definition_tags",
        "summary": "List Workspace Data Definition Tags",
        "parameters": [
          {
            "in": "query",
            "name": "page_size",
            "schema": {
              "default": 100,
              "description": "Items per page.",
              "maximum": 1000,
              "minimum": 1,
              "title": "Page Size",
              "type": "integer"
            },
            "required": false,
            "description": "Items per page."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Previous or next cursor used to paginate.",
              "title": "Cursor"
            },
            "required": false,
            "description": "Previous or next cursor used to paginate."
          },
          {
            "in": "query",
            "name": "order",
            "schema": {
              "default": "asc",
              "description": "Sort order: 'asc' or 'desc'.",
              "enum": [
                "asc",
                "desc"
              ],
              "title": "Order",
              "type": "string"
            },
            "required": false,
            "description": "Sort order: 'asc' or 'desc'."
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "default": "name",
              "description": "Sort by tag name, or by entity count with ties broken by name.",
              "enum": [
                "name",
                "entity_count"
              ],
              "title": "Sort",
              "type": "string"
            },
            "required": false,
            "description": "Sort by tag name, or by entity count with ties broken by name."
          },
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDataDefinitionTagsResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "List the data definition tags of the workspace's project.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "post": {
        "operationId": "create_workspace_data_definition_tag",
        "summary": "Create Workspace Data Definition Tag",
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDefinitionTagResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Create a data definition tag in the workspace's project.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDataDefinitionTagRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner",
          "Admin"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge> <Badge size=\"sm\">Admin</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/workspaces/{workspace_id}/data-definition-tags/{tag_id}": {
      "get": {
        "operationId": "get_workspace_data_definition_tag",
        "summary": "Get Workspace Data Definition Tag",
        "parameters": [
          {
            "in": "path",
            "name": "tag_id",
            "schema": {
              "title": "Tag Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDefinitionTagResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Get one of the data definition tags of the workspace's project.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>"
        }
      },
      "patch": {
        "operationId": "rename_workspace_data_definition_tag",
        "summary": "Rename Workspace Data Definition Tag",
        "parameters": [
          {
            "in": "path",
            "name": "tag_id",
            "schema": {
              "title": "Tag Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDefinitionTagResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Rename one of the workspace project's data definition tags. Definitions carrying the tag keep it.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDataDefinitionTagRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner",
          "Admin"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge> <Badge size=\"sm\">Admin</Badge></p>\n  </div>\n</div>"
        }
      },
      "delete": {
        "operationId": "delete_workspace_data_definition_tag",
        "summary": "Delete Workspace Data Definition Tag",
        "parameters": [
          {
            "in": "path",
            "name": "tag_id",
            "schema": {
              "title": "Tag Id",
              "type": "string"
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/WorkspaceIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteDataDefinitionTagResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Delete one of the data definition tags of the workspace's project and remove it from\nevery definition carrying it, including definitions outside the workspace's data view. The\ndefinitions are otherwise unchanged.",
        "tags": [
          "Workspaces",
          "Data Definitions"
        ],
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "write_data_definitions"
        ],
        "x-roles": [
          "Owner",
          "Admin"
        ],
        "x-release-stage": "closed-beta",
        "x-mint": {
          "content": "<Warning>\n  <b>Closed Beta</b><br />\n  Available to a limited set of invited customers. Contact your account team to join.\n  The request and response contract may change before general availability (GA).\n</Warning>\n\n<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">write_data_definitions</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge> <Badge size=\"sm\">Admin</Badge></p>\n  </div>\n</div>"
        }
      }
    },
    "/v1/organizations/{organization_id}/audit-logs/query": {
      "post": {
        "operationId": "query_organization_audit_logs",
        "summary": "Query Organization Audit Logs",
        "parameters": [
          {
            "in": "query",
            "name": "page_size",
            "schema": {
              "default": 100,
              "description": "Items per page.",
              "maximum": 100,
              "minimum": 1,
              "title": "Page Size",
              "type": "integer"
            },
            "required": false,
            "description": "Items per page."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Previous or next cursor used to paginate.",
              "title": "Cursor"
            },
            "required": false,
            "description": "Previous or next cursor used to paginate."
          },
          {
            "in": "query",
            "name": "order",
            "schema": {
              "default": "desc",
              "description": "Sort order of results: 'asc' for oldest first, 'desc' for newest first.",
              "enum": [
                "asc",
                "desc"
              ],
              "title": "Order",
              "type": "string"
            },
            "required": false,
            "description": "Sort order of results: 'asc' for oldest first, 'desc' for newest first."
          },
          {
            "$ref": "#/components/parameters/OrganizationIdPathParameter"
          },
          {
            "$ref": "#/components/parameters/MixpanelVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryAuditLogResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/RequestValidationError"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Query an organization's audit logs.",
        "tags": [
          "Organizations",
          "Audit Log"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryAuditLogRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ServiceAccountAuth": []
          }
        ],
        "x-permissions": [
          "view_audit_logs"
        ],
        "x-roles": [
          "Owner",
          "Admin"
        ],
        "x-mint": {
          "content": "<div class=\"pb-3\">\n  <h4 class=\"font-bold w-full border-b pb-2.5\">Permissions</h4>\n  <div class=\"prose-sm\">\n    <p>The permissions required to access this endpoint. See <a href=\"https://docs.mixpanel.com/reference/permissions\">Permissions Reference</a> for what each role grants.</p>\n    <p><b>Required Permissions: </b><Badge size=\"sm\" className=\"font-mono\">view_audit_logs</Badge></p>\n    <p><b>Granted By Role: </b><Badge size=\"sm\">Owner</Badge> <Badge size=\"sm\">Admin</Badge></p>\n  </div>\n</div>"
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CursorPaginationResponse": {
        "description": "Response model for cursor-based pagination, containing the cursors for the next and previous pages.",
        "properties": {
          "previous_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cursor for the previous page.",
            "title": ""
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cursor for the next page.",
            "title": ""
          }
        },
        "title": "CursorPaginationResponse",
        "type": "object"
      },
      "AuditLog": {
        "properties": {
          "project_id": {
            "description": "ID of the project the audited action occurred in.",
            "title": "Project Id",
            "type": "string"
          },
          "organization_id": {
            "description": "ID of the organization the audited action occurred in.",
            "title": "Organization Id",
            "type": "string"
          },
          "service": {
            "description": "The Mixpanel service the audited action came from, shown as Origin in the audit log UI. Values, with their UI labels: `webapp` (API), `mcp` (MCP), `cron` (Scheduled Job), `webapp_worker` (Background Worker), `export_server` (Export API).",
            "title": "Service",
            "type": "string"
          },
          "event_category": {
            "description": "High-level category describing the type of audited event.",
            "title": "Event Category",
            "type": "string"
          },
          "organization_name": {
            "description": "Name of the organization at the time the audited action occurred.",
            "title": "Organization Name",
            "type": "string"
          },
          "ttl_timestamp": {
            "description": "UTC timestamp at which the audit log entry expires and may be deleted.",
            "format": "date-time",
            "title": "Ttl Timestamp",
            "type": "string"
          },
          "client_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "IP address of the client that initiated the audited action. On MCP tool call entries, this is the calling server's address (typically your AI provider's), not the user's.",
            "title": "Client Ip"
          },
          "http_method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP method of the request that triggered the audited action (e.g. GET, POST).",
            "title": "Http Method"
          },
          "http_request_headers": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP request headers from the request that triggered the audited action.",
            "title": "Http Request Headers"
          },
          "http_request_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Size of the HTTP request body in bytes.",
            "title": "Http Request Size"
          },
          "http_response_headers": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP response headers returned for the request that triggered the audited action.",
            "title": "Http Response Headers"
          },
          "http_response_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Size of the HTTP response body in bytes.",
            "title": "Http Response Size"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP status code returned for the request that triggered the audited action.",
            "title": "Http Status"
          },
          "http_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "URL of the request that triggered the audited action.",
            "title": "Http Url"
          },
          "http_user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User-Agent header from the request that triggered the audited action.",
            "title": "Http User Agent"
          },
          "project_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the project at the time the audited action occurred.",
            "title": "Project Name"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Email of the user who performed the audited action.",
            "title": "User Email"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the user who performed the audited action.",
            "title": "User Id"
          },
          "user_roles": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Comma-separated list of roles held by the user at the time of the audited action.",
            "title": "User Roles"
          },
          "created": {
            "description": "UTC timestamp when the audit log entry was created.",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for the audit log entry.",
            "title": "Id",
            "type": "string"
          },
          "was_impersonated_by_staff": {
            "description": "Whether the action was performed by a Mixpanel staff member acting on behalf of your organization.",
            "title": "Was Impersonated By Staff",
            "type": "boolean"
          },
          "entity": {
            "$ref": "#/components/schemas/AuditLogEntity",
            "description": "The entity that was acted upon, including its type, action, and action-specific payload."
          }
        },
        "required": [
          "project_id",
          "organization_id",
          "service",
          "event_category",
          "organization_name",
          "ttl_timestamp",
          "created",
          "id",
          "was_impersonated_by_staff",
          "entity"
        ],
        "title": "AuditLog",
        "type": "object"
      },
      "AuditLogEntity": {
        "description": "The target entity of an audit log entry.",
        "properties": {
          "entity_id": {
            "description": "Unique identifier for the entity targeted by the audit log entry.",
            "title": "Entity Id",
            "type": "string"
          },
          "entity_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the entity targeted by the audit log entry.",
            "title": "Entity Name"
          },
          "payload": {
            "$ref": "#/components/schemas/AuditLogPayload",
            "description": "The payload of the audit log entry, which contains the details of the action performed."
          },
          "action": {
            "description": "Action performed on the entity targeted by the audit log entry.",
            "title": "Action",
            "type": "string"
          },
          "entity_type": {
            "description": "Type of the entity targeted by the audit log entry.",
            "title": "Entity Type",
            "type": "string"
          },
          "type": {
            "description": "The type of the audit log entry, which is a combination of the entity type and action.",
            "readOnly": true,
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "entity_id",
          "entity_name",
          "payload",
          "action",
          "entity_type",
          "type"
        ],
        "title": "AuditLogEntity",
        "type": "object"
      },
      "AuditLogPayload": {
        "additionalProperties": true,
        "properties": {},
        "title": "AuditLogPayload",
        "type": "object"
      },
      "QueryAuditLogResponse": {
        "description": "Response model for an audit log query.",
        "properties": {
          "results": {
            "description": "List of items for the current page.",
            "items": {
              "$ref": "#/components/schemas/AuditLog"
            },
            "title": "Results",
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPaginationResponse",
            "description": "Pagination cursors to navigate through the results."
          }
        },
        "required": [
          "results",
          "pagination"
        ],
        "title": "QueryAuditLogResponse",
        "type": "object"
      },
      "BehaviorBetween": {
        "properties": {
          "type": {
            "const": "between",
            "title": "Type",
            "type": "string"
          },
          "start": {
            "anyOf": [
              {
                "description": "Calendar date, YYYY-MM-DD, in the project's timezone. Covers the whole day.",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "description": "Timestamp, YYYY-MM-DDTHH:mm, in the project's timezone. Covers the whole minute.",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
                "type": "string"
              }
            ],
            "description": "Inclusive.",
            "title": "Start"
          },
          "end": {
            "anyOf": [
              {
                "description": "Calendar date, YYYY-MM-DD, in the project's timezone. Covers the whole day.",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "description": "Timestamp, YYYY-MM-DDTHH:mm, in the project's timezone. Covers the whole minute.",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
                "type": "string"
              }
            ],
            "description": "Inclusive.",
            "title": "End"
          }
        },
        "required": [
          "type",
          "start",
          "end"
        ],
        "title": "BehaviorBetween",
        "type": "object"
      },
      "BehaviorCriterion": {
        "description": "A user matches when their measurement of the event over the date range compares as\n``operator`` to ``values``. A count that `is equal to` 0 matches users who did not do\nthe event.",
        "properties": {
          "event": {
            "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
            "discriminator": {
              "mapping": {
                "custom_event": "#/components/schemas/CustomEvent",
                "event": "#/components/schemas/Event"
              },
              "propertyName": "event_type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/Event"
              },
              {
                "$ref": "#/components/schemas/CustomEvent"
              }
            ],
            "title": "Event"
          },
          "measurement": {
            "description": "`count` counts each user's events. `property` takes a statistic of an event property over each user's events.",
            "discriminator": {
              "mapping": {
                "count": "#/components/schemas/BehaviorEventCount",
                "property": "#/components/schemas/BehaviorPropertyStatistic"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/BehaviorEventCount"
              },
              {
                "$ref": "#/components/schemas/BehaviorPropertyStatistic"
              }
            ],
            "title": "Measurement"
          },
          "operator": {
            "$ref": "#/components/schemas/Operator",
            "description": "A number operator: `is equal to`, `is not equal to`, `is greater than`, `is at least`, `is less than`, `is at most`, `is between`, `is not between`"
          },
          "values": {
            "description": "Two values for a range operator, one for the others.",
            "items": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "number"
                }
              ]
            },
            "title": "Values",
            "type": "array"
          },
          "date_range": {
            "description": "When the events must have happened.",
            "discriminator": {
              "mapping": {
                "between": "#/components/schemas/BehaviorBetween",
                "in_the_last": "#/components/schemas/BehaviorInTheLast",
                "since": "#/components/schemas/BehaviorSince"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/BehaviorInTheLast"
              },
              {
                "$ref": "#/components/schemas/BehaviorSince"
              },
              {
                "$ref": "#/components/schemas/BehaviorBetween"
              }
            ],
            "title": "Date Range"
          }
        },
        "required": [
          "event",
          "measurement",
          "operator",
          "values",
          "date_range"
        ],
        "title": "BehaviorCriterion",
        "type": "object"
      },
      "BehaviorDataDefinitionResponse": {
        "properties": {
          "id": {
            "description": "Opaque definition ID, stable across renames.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The definition's name.",
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name shown in the UI.",
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "hidden": {
            "description": "Whether the definition is hidden in the UI.",
            "title": "Hidden",
            "type": "boolean"
          },
          "blocked": {
            "description": "Whether the definition's incoming data is dropped at ingest. Types that cannot be blocked always report `false`.",
            "title": "Blocked",
            "type": "boolean"
          },
          "verified": {
            "description": "Whether the definition is verified.",
            "title": "Verified",
            "type": "boolean"
          },
          "last_verified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the definition was last verified.",
            "title": "Last Verified At"
          },
          "last_verified_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionVerifier"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who last verified the definition."
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionOwner"
            },
            "title": "Owners",
            "type": "array"
          },
          "merged_into": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition this one is merged into."
          },
          "first_tracked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When data for the definition was first seen.",
            "title": "First Tracked At"
          },
          "created_at": {
            "description": "When the definition was created.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "updated_at": {
            "description": "When the definition was last updated.",
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "type": {
            "const": "behavior",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "anyOf": [
              {
                "description": "Set `type` to `event` for events counted as they happen, `funnel` for ordered steps, or `retention` for a start event and a return event.",
                "discriminator": {
                  "mapping": {
                    "event": "#/components/schemas/EventBehavior",
                    "funnel": "#/components/schemas/FunnelBehavior",
                    "retention": "#/components/schemas/RetentionBehavior"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/EventBehavior"
                  },
                  {
                    "$ref": "#/components/schemas/FunnelBehavior"
                  },
                  {
                    "$ref": "#/components/schemas/RetentionBehavior"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The behavior's query clause. Null when the stored definition cannot be expressed in this schema. Optional fields that are null or empty are left out of the definition.",
            "title": "Definition"
          }
        },
        "required": [
          "id",
          "name",
          "event_name",
          "display_name",
          "description",
          "hidden",
          "blocked",
          "verified",
          "last_verified_at",
          "last_verified_by",
          "tags",
          "owners",
          "merged_into",
          "first_tracked_at",
          "created_at",
          "updated_at",
          "type",
          "definition"
        ],
        "title": "BehaviorDataDefinitionResponse",
        "type": "object"
      },
      "BehaviorEventCount": {
        "properties": {
          "type": {
            "const": "count",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "title": "BehaviorEventCount",
        "type": "object"
      },
      "BehaviorInTheLast": {
        "properties": {
          "type": {
            "const": "in_the_last",
            "title": "Type",
            "type": "string"
          },
          "value": {
            "description": "Whole non-negative number of units before now.",
            "minimum": 0,
            "title": "Value",
            "type": "integer"
          },
          "unit": {
            "$ref": "#/components/schemas/TimeUnit"
          }
        },
        "required": [
          "type",
          "value",
          "unit"
        ],
        "title": "BehaviorInTheLast",
        "type": "object"
      },
      "BehaviorPropertyStatistic": {
        "properties": {
          "type": {
            "const": "property",
            "title": "Type",
            "type": "string"
          },
          "statistic": {
            "description": "The statistic of each user's values.",
            "enum": [
              "sum",
              "average",
              "distinct_count",
              "min",
              "max"
            ],
            "title": "Statistic",
            "type": "string"
          },
          "property": {
            "description": "The event property the statistic is taken of.",
            "discriminator": {
              "mapping": {
                "event": "#/components/schemas/EventProperty",
                "event_custom": "#/components/schemas/EventCustomProperty",
                "lookup": "#/components/schemas/LookupProperty",
                "profile": "#/components/schemas/ProfileProperty",
                "profile_custom": "#/components/schemas/ProfileCustomProperty"
              },
              "propertyName": "source"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileProperty"
              },
              {
                "$ref": "#/components/schemas/LookupProperty"
              },
              {
                "$ref": "#/components/schemas/EventCustomProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileCustomProperty"
              }
            ],
            "title": "Property"
          }
        },
        "required": [
          "type",
          "statistic",
          "property"
        ],
        "title": "BehaviorPropertyStatistic",
        "type": "object"
      },
      "BehaviorSince": {
        "properties": {
          "type": {
            "const": "since",
            "title": "Type",
            "type": "string"
          },
          "start": {
            "anyOf": [
              {
                "description": "Calendar date, YYYY-MM-DD, in the project's timezone. Covers the whole day.",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "description": "Timestamp, YYYY-MM-DDTHH:mm, in the project's timezone. Covers the whole minute.",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
                "type": "string"
              }
            ],
            "description": "Inclusive.",
            "title": "Start"
          }
        },
        "required": [
          "type",
          "start"
        ],
        "title": "BehaviorSince",
        "type": "object"
      },
      "CalculationType": {
        "description": "The calculation a metric runs over its events or profiles.\n\nSeparate from the interval aggregation, which rolls those calculated values\nup across time buckets.",
        "enum": [
          "total_events",
          "total_sessions",
          "unique_users",
          "daily_active_users",
          "monthly_active_users",
          "weekly_active_users"
        ],
        "title": "CalculationType",
        "type": "string"
      },
      "CohortCountMeasurement": {
        "properties": {
          "type": {
            "const": "count",
            "default": "count",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          }
        },
        "title": "CohortCountMeasurement",
        "type": "object"
      },
      "CohortDataDefinitionResponse": {
        "properties": {
          "id": {
            "description": "Opaque definition ID, stable across renames.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The definition's name.",
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name shown in the UI.",
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "hidden": {
            "description": "Whether the definition is hidden in the UI.",
            "title": "Hidden",
            "type": "boolean"
          },
          "blocked": {
            "description": "Whether the definition's incoming data is dropped at ingest. Types that cannot be blocked always report `false`.",
            "title": "Blocked",
            "type": "boolean"
          },
          "verified": {
            "description": "Whether the definition is verified.",
            "title": "Verified",
            "type": "boolean"
          },
          "last_verified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the definition was last verified.",
            "title": "Last Verified At"
          },
          "last_verified_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionVerifier"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who last verified the definition."
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionOwner"
            },
            "title": "Owners",
            "type": "array"
          },
          "merged_into": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition this one is merged into."
          },
          "first_tracked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When data for the definition was first seen.",
            "title": "First Tracked At"
          },
          "created_at": {
            "description": "When the definition was created.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "updated_at": {
            "description": "When the definition was last updated.",
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "type": {
            "const": "cohort",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CohortDefinition"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who the cohort's members are. Null when the stored definition cannot be expressed in this schema. Optional fields that are null or empty are left out of the definition."
          }
        },
        "required": [
          "id",
          "name",
          "event_name",
          "display_name",
          "description",
          "hidden",
          "blocked",
          "verified",
          "last_verified_at",
          "last_verified_by",
          "tags",
          "owners",
          "merged_into",
          "first_tracked_at",
          "created_at",
          "updated_at",
          "type",
          "definition"
        ],
        "title": "CohortDataDefinitionResponse",
        "type": "object"
      },
      "CohortDefinition": {
        "properties": {
          "groups": {
            "items": {
              "$ref": "#/components/schemas/CohortGroup"
            },
            "minItems": 1,
            "title": "Groups",
            "type": "array"
          },
          "groups_logical_operator": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LogicalOperators"
              }
            ],
            "default": "AND"
          }
        },
        "required": [
          "groups"
        ],
        "title": "CohortDefinition",
        "type": "object"
      },
      "CohortFilter": {
        "description": "Keeps users who are, or are not, members of a saved cohort.",
        "properties": {
          "type": {
            "const": "cohort",
            "title": "Type",
            "type": "string"
          },
          "cohort_id": {
            "minLength": 1,
            "title": "Cohort Id",
            "type": "string"
          },
          "operator": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CohortOperator"
              }
            ],
            "default": "in"
          }
        },
        "required": [
          "type",
          "cohort_id"
        ],
        "title": "CohortFilter",
        "type": "object"
      },
      "CohortGroup": {
        "description": "Users who match the group's filters and its behaviors.",
        "properties": {
          "cohort_id": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Only members of this cohort. Null means all users.",
            "title": "Cohort Id"
          },
          "filters": {
            "default": [],
            "description": "Profile property and cohort membership filters.",
            "items": {
              "discriminator": {
                "mapping": {
                  "cohort": "#/components/schemas/CohortFilter",
                  "property": "#/components/schemas/CohortGroupPropertyFilter"
                },
                "propertyName": "type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/CohortGroupPropertyFilter"
                },
                {
                  "$ref": "#/components/schemas/CohortFilter"
                }
              ]
            },
            "title": "Filters",
            "type": "array"
          },
          "filters_logical_operator": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LogicalOperators"
              }
            ],
            "default": "AND"
          },
          "behaviors": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/BehaviorCriterion"
            },
            "title": "Behaviors",
            "type": "array"
          },
          "behaviors_logical_operator": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LogicalOperators"
              }
            ],
            "default": "AND"
          }
        },
        "title": "CohortGroup",
        "type": "object"
      },
      "CohortGroupPropertyFilter": {
        "properties": {
          "type": {
            "const": "property",
            "title": "Type",
            "type": "string"
          },
          "property": {
            "discriminator": {
              "mapping": {
                "profile": "#/components/schemas/ProfileProperty",
                "profile_custom": "#/components/schemas/ProfileCustomProperty"
              },
              "propertyName": "source"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/ProfileProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileCustomProperty"
              }
            ],
            "title": "Property"
          },
          "operator": {
            "description": "The comparison to apply. Which operators are valid depends on the property's `type`. The datetime operators apply to datetime properties only.",
            "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",
              "is on",
              "is not on",
              "is before",
              "is on or after",
              "is in the last",
              "is not in the last",
              "is before the last",
              "is in the next"
            ],
            "title": "Operator",
            "type": "string"
          },
          "values": {
            "anyOf": [
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "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. For a datetime property: one calendar date for `is on`, `is not on`; one date or timestamp for `is before`, `is on or after`; two dates or two timestamps (not one of each), both inclusive, for `is between` / `is not between`; one whole number of at least 1 for the relative operators. A date is `YYYY-MM-DD` or `YYYY-MM-DDTHH:mm`, in the project's timezone.",
            "title": "Values"
          },
          "list_match": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListMatch"
              },
              {
                "type": "null"
              }
            ],
            "description": "For list-valued properties, and for lookup columns whose join key is list-valued (`join_key.is_list`). 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": {
            "default": false,
            "description": "For list-valued properties with `list_match: any`: drop the list elements that did not match instead of keeping the whole list. Not supported for lookup properties.",
            "title": "Keep Only Matching",
            "type": "boolean"
          },
          "unit": {
            "anyOf": [
              {
                "enum": [
                  "minute",
                  "hour",
                  "day",
                  "week",
                  "month"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The unit of the window of a relative datetime operator (`is in the last`, `is not in the last`, `is before the last`, `is in the next`). Required for those, and not allowed for any other operator.",
            "title": "Unit"
          }
        },
        "required": [
          "type",
          "property",
          "operator"
        ],
        "title": "CohortGroupPropertyFilter",
        "type": "object"
      },
      "CohortMetric": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "group_key": {
            "default": "User",
            "description": "The raw group key name, as shown in Project Settings—for example `$company_id`. `User` is the user profile and the default.",
            "minLength": 1,
            "title": "Group Key",
            "type": "string"
          },
          "measurement": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CohortCountMeasurement"
              }
            ],
            "default": {
              "type": "count",
              "interval_aggregation": "standard"
            }
          },
          "type": {
            "const": "cohort",
            "description": "Set `type` to `event` to measure events, `funnel` for conversion through ordered steps, `retention` for how often users return after a start event, `cohort` for the members of a saved cohort, or `formula` to combine other metrics in this request.",
            "title": "Type",
            "type": "string"
          },
          "cohort_id": {
            "description": "Id of the saved cohort.",
            "minLength": 1,
            "title": "Cohort Id",
            "type": "string"
          },
          "filters": {
            "default": [],
            "description": "Profile property or cohort filters narrowing the members counted.",
            "items": {
              "description": "Set `type` to `property` to filter on a property value, or `cohort` to filter on cohort membership.",
              "discriminator": {
                "mapping": {
                  "cohort": "#/components/schemas/CohortFilter",
                  "property": "#/components/schemas/PropertyFilter"
                },
                "propertyName": "type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/PropertyFilter"
                },
                {
                  "$ref": "#/components/schemas/CohortFilter"
                }
              ]
            },
            "title": "Filters",
            "type": "array"
          }
        },
        "required": [
          "type",
          "cohort_id"
        ],
        "title": "CohortMetric",
        "type": "object"
      },
      "CohortOperator": {
        "enum": [
          "in",
          "not in"
        ],
        "title": "CohortOperator",
        "type": "string"
      },
      "ConversionWindow": {
        "description": "How long after the first step an entity has to complete the funnel.",
        "properties": {
          "value": {
            "description": "Whole number of `unit`s, at most 31708800 seconds, 528480 minutes, 8808 hours, 367 days, 52 weeks, 12 months, 12 sessions.",
            "exclusiveMinimum": 0,
            "title": "Value",
            "type": "integer"
          },
          "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."
          }
        },
        "required": [
          "value",
          "unit"
        ],
        "title": "ConversionWindow",
        "type": "object"
      },
      "ConversionWindowUnit": {
        "enum": [
          "second",
          "minute",
          "hour",
          "day",
          "week",
          "month",
          "session"
        ],
        "title": "ConversionWindowUnit",
        "type": "string"
      },
      "CustomEvent": {
        "properties": {
          "filters": {
            "default": [],
            "items": {
              "description": "Set `type` to `property` to filter on a property value, or `cohort` to filter on cohort membership. Set `type` to `first_time` to keep only the first time each user did the event.",
              "discriminator": {
                "mapping": {
                  "cohort": "#/components/schemas/CohortFilter",
                  "first_time": "#/components/schemas/FirstTimeFilter",
                  "property": "#/components/schemas/PropertyFilter"
                },
                "propertyName": "type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/PropertyFilter"
                },
                {
                  "$ref": "#/components/schemas/CohortFilter"
                },
                {
                  "$ref": "#/components/schemas/FirstTimeFilter"
                }
              ]
            },
            "title": "Filters",
            "type": "array"
          },
          "filters_logical_operator": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LogicalOperators"
              }
            ],
            "default": "AND"
          },
          "event_type": {
            "const": "custom_event",
            "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
            "title": "Event Type",
            "type": "string"
          },
          "id": {
            "description": "Id of the custom event.",
            "minLength": 1,
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "event_type",
          "id"
        ],
        "title": "CustomEvent",
        "type": "object"
      },
      "CustomEventDataDefinitionResponse": {
        "properties": {
          "id": {
            "description": "Opaque definition ID, stable across renames.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The definition's name.",
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name shown in the UI.",
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "hidden": {
            "description": "Whether the definition is hidden in the UI.",
            "title": "Hidden",
            "type": "boolean"
          },
          "blocked": {
            "description": "Whether the definition's incoming data is dropped at ingest. Types that cannot be blocked always report `false`.",
            "title": "Blocked",
            "type": "boolean"
          },
          "verified": {
            "description": "Whether the definition is verified.",
            "title": "Verified",
            "type": "boolean"
          },
          "last_verified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the definition was last verified.",
            "title": "Last Verified At"
          },
          "last_verified_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionVerifier"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who last verified the definition."
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionOwner"
            },
            "title": "Owners",
            "type": "array"
          },
          "merged_into": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition this one is merged into."
          },
          "first_tracked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When data for the definition was first seen.",
            "title": "First Tracked At"
          },
          "created_at": {
            "description": "When the definition was created.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "updated_at": {
            "description": "When the definition was last updated.",
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "type": {
            "const": "custom_event",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CustomEventDefinition"
              },
              {
                "type": "null"
              }
            ],
            "description": "The events the custom event combines. Null when the stored definition cannot be expressed in this schema. Optional fields that are null or empty are left out of the definition."
          }
        },
        "required": [
          "id",
          "name",
          "event_name",
          "display_name",
          "description",
          "hidden",
          "blocked",
          "verified",
          "last_verified_at",
          "last_verified_by",
          "tags",
          "owners",
          "merged_into",
          "first_tracked_at",
          "created_at",
          "updated_at",
          "type",
          "definition"
        ],
        "title": "CustomEventDataDefinitionResponse",
        "type": "object"
      },
      "CustomEventDefinition": {
        "properties": {
          "events": {
            "description": "An event matching any of these counts as the custom event.",
            "items": {
              "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
              "discriminator": {
                "mapping": {
                  "custom_event": "#/components/schemas/CustomEvent",
                  "event": "#/components/schemas/Event"
                },
                "propertyName": "event_type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Event"
                },
                {
                  "$ref": "#/components/schemas/CustomEvent"
                }
              ]
            },
            "title": "Events",
            "type": "array"
          }
        },
        "required": [
          "events"
        ],
        "title": "CustomEventDefinition",
        "type": "object"
      },
      "CustomPropertyDataDefinitionResponse": {
        "properties": {
          "id": {
            "description": "Opaque definition ID, stable across renames.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The definition's name.",
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name shown in the UI.",
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "hidden": {
            "description": "Whether the definition is hidden in the UI.",
            "title": "Hidden",
            "type": "boolean"
          },
          "blocked": {
            "description": "Whether the definition's incoming data is dropped at ingest. Types that cannot be blocked always report `false`.",
            "title": "Blocked",
            "type": "boolean"
          },
          "verified": {
            "description": "Whether the definition is verified.",
            "title": "Verified",
            "type": "boolean"
          },
          "last_verified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the definition was last verified.",
            "title": "Last Verified At"
          },
          "last_verified_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionVerifier"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who last verified the definition."
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionOwner"
            },
            "title": "Owners",
            "type": "array"
          },
          "merged_into": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition this one is merged into."
          },
          "first_tracked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When data for the definition was first seen.",
            "title": "First Tracked At"
          },
          "created_at": {
            "description": "When the definition was created.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "updated_at": {
            "description": "When the definition was last updated.",
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "type": {
            "const": "custom_property",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CustomPropertyDefinition"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the custom property is computed. Null when the stored definition cannot be expressed in this schema. Optional fields that are null or empty are left out of the definition."
          }
        },
        "required": [
          "id",
          "name",
          "event_name",
          "display_name",
          "description",
          "hidden",
          "blocked",
          "verified",
          "last_verified_at",
          "last_verified_by",
          "tags",
          "owners",
          "merged_into",
          "first_tracked_at",
          "created_at",
          "updated_at",
          "type",
          "definition"
        ],
        "title": "CustomPropertyDataDefinitionResponse",
        "type": "object"
      },
      "CustomPropertyDefinition": {
        "description": "``formula`` refers to ``properties`` by key. ``is_session_scoped`` computes the value per\nsession.",
        "properties": {
          "source": {
            "enum": [
              "event",
              "profile"
            ],
            "title": "Source",
            "type": "string"
          },
          "formula": {
            "title": "Formula",
            "type": "string"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "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": {
                "mapping": {
                  "event": "#/components/schemas/CustomPropertyEventProperty",
                  "event_custom": "#/components/schemas/EventCustomProperty",
                  "lookup": "#/components/schemas/LookupProperty",
                  "profile": "#/components/schemas/ProfileProperty",
                  "profile_custom": "#/components/schemas/ProfileCustomProperty"
                },
                "propertyName": "source"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/CustomPropertyEventProperty"
                },
                {
                  "$ref": "#/components/schemas/ProfileProperty"
                },
                {
                  "$ref": "#/components/schemas/LookupProperty"
                },
                {
                  "$ref": "#/components/schemas/EventCustomProperty"
                },
                {
                  "$ref": "#/components/schemas/ProfileCustomProperty"
                }
              ]
            },
            "default": {},
            "title": "Properties"
          },
          "is_session_scoped": {
            "default": false,
            "title": "Is Session Scoped",
            "type": "boolean"
          }
        },
        "required": [
          "source",
          "formula"
        ],
        "title": "CustomPropertyDefinition",
        "type": "object"
      },
      "CustomPropertyEventProperty": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/PropertyType"
          },
          "path": {
            "anyOf": [
              {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Key path into an object-valued property.",
            "title": "Path"
          },
          "list_item": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListItem"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required for, and only for, `list[object]`."
          },
          "source": {
            "const": "event",
            "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.",
            "title": "Source",
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "from_event": {
            "anyOf": [
              {
                "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
                "discriminator": {
                  "mapping": {
                    "custom_event": "#/components/schemas/CustomEvent",
                    "event": "#/components/schemas/Event"
                  },
                  "propertyName": "event_type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "$ref": "#/components/schemas/CustomEvent"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The event the value is read from, when it is not the event being read.",
            "title": "From Event"
          }
        },
        "required": [
          "type",
          "source",
          "name"
        ],
        "title": "CustomPropertyEventProperty",
        "type": "object"
      },
      "DataDefinitionOwner": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/OwnerType",
            "description": "Whether the owner is a user or a team."
          },
          "id": {
            "description": "The owner's user or team ID.",
            "title": "Id",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The owner's name.",
            "title": "Display Name"
          },
          "resolved": {
            "description": "Whether the owner still exists.",
            "title": "Resolved",
            "type": "boolean"
          }
        },
        "required": [
          "type",
          "id",
          "display_name",
          "resolved"
        ],
        "title": "DataDefinitionOwner",
        "type": "object"
      },
      "DataDefinitionSummary": {
        "properties": {
          "id": {
            "description": "The definition's ID.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The definition's name.",
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "DataDefinitionSummary",
        "type": "object"
      },
      "DataDefinitionVerifier": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/OwnerType",
            "description": "Whether the verifier is a user or a team."
          },
          "id": {
            "description": "The verifier's user or team ID.",
            "title": "Id",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The verifier's name.",
            "title": "Display Name"
          }
        },
        "required": [
          "type",
          "id",
          "display_name"
        ],
        "title": "DataDefinitionVerifier",
        "type": "object"
      },
      "DataDefinitionWithoutBodyResponse": {
        "description": "An event or event property, which has no definition body.",
        "properties": {
          "id": {
            "description": "Opaque definition ID, stable across renames.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The definition's name.",
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name shown in the UI.",
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "hidden": {
            "description": "Whether the definition is hidden in the UI.",
            "title": "Hidden",
            "type": "boolean"
          },
          "blocked": {
            "description": "Whether the definition's incoming data is dropped at ingest. Types that cannot be blocked always report `false`.",
            "title": "Blocked",
            "type": "boolean"
          },
          "verified": {
            "description": "Whether the definition is verified.",
            "title": "Verified",
            "type": "boolean"
          },
          "last_verified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the definition was last verified.",
            "title": "Last Verified At"
          },
          "last_verified_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionVerifier"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who last verified the definition."
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionOwner"
            },
            "title": "Owners",
            "type": "array"
          },
          "merged_into": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition this one is merged into."
          },
          "first_tracked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When data for the definition was first seen.",
            "title": "First Tracked At"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the definition was created. Null if the event or property has no stored definition.",
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the definition was last updated. Null if the event or property has no stored definition.",
            "title": "Updated At"
          },
          "type": {
            "description": "The kind of definition.",
            "enum": [
              "event",
              "event_property"
            ],
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "description": "Always null for this kind of definition.",
            "title": "Definition",
            "type": "null"
          }
        },
        "required": [
          "id",
          "name",
          "event_name",
          "display_name",
          "description",
          "hidden",
          "blocked",
          "verified",
          "last_verified_at",
          "last_verified_by",
          "tags",
          "owners",
          "merged_into",
          "first_tracked_at",
          "created_at",
          "updated_at",
          "type",
          "definition"
        ],
        "title": "DataDefinitionWithoutBodyResponse",
        "type": "object"
      },
      "Event": {
        "properties": {
          "filters": {
            "default": [],
            "items": {
              "description": "Set `type` to `property` to filter on a property value, or `cohort` to filter on cohort membership. Set `type` to `first_time` to keep only the first time each user did the event.",
              "discriminator": {
                "mapping": {
                  "cohort": "#/components/schemas/CohortFilter",
                  "first_time": "#/components/schemas/FirstTimeFilter",
                  "property": "#/components/schemas/PropertyFilter"
                },
                "propertyName": "type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/PropertyFilter"
                },
                {
                  "$ref": "#/components/schemas/CohortFilter"
                },
                {
                  "$ref": "#/components/schemas/FirstTimeFilter"
                }
              ]
            },
            "title": "Filters",
            "type": "array"
          },
          "filters_logical_operator": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LogicalOperators"
              }
            ],
            "default": "AND"
          },
          "name": {
            "description": "Name of the event as tracked, not its Lexicon display name.",
            "title": "Name",
            "type": "string"
          },
          "event_type": {
            "const": "event",
            "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
            "title": "Event Type",
            "type": "string"
          }
        },
        "required": [
          "name",
          "event_type"
        ],
        "title": "Event",
        "type": "object"
      },
      "EventBehavior": {
        "properties": {
          "type": {
            "const": "event",
            "description": "Set `type` to `event` for events counted as they happen, `funnel` for ordered steps, or `retention` for a start event and a return event.",
            "title": "Type",
            "type": "string"
          },
          "events": {
            "items": {
              "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
              "discriminator": {
                "mapping": {
                  "custom_event": "#/components/schemas/CustomEvent",
                  "event": "#/components/schemas/Event"
                },
                "propertyName": "event_type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Event"
                },
                {
                  "$ref": "#/components/schemas/CustomEvent"
                }
              ]
            },
            "minItems": 1,
            "title": "Events",
            "type": "array"
          }
        },
        "required": [
          "type",
          "events"
        ],
        "title": "EventBehavior",
        "type": "object"
      },
      "EventCountMeasurement": {
        "description": "Counts matching events, sessions, or users.",
        "properties": {
          "type": {
            "const": "count",
            "description": "What the metric calculates. Set `type` to `count`, `property`, `frequency_per_user`, or `property_per_user`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "calculation": {
            "$ref": "#/components/schemas/CalculationType"
          }
        },
        "required": [
          "type",
          "calculation"
        ],
        "title": "EventCountMeasurement",
        "type": "object"
      },
      "EventCustomJoinKey": {
        "description": "A saved event custom property a lookup table is attached to.\n\nThe query reads whether it is list-valued from the saved custom property.",
        "properties": {
          "source": {
            "const": "event_custom",
            "description": "The property the lookup table is joined on. Set `source` to `event`, `profile`, `event_custom`, or `profile_custom`.",
            "title": "Source",
            "type": "string"
          },
          "id": {
            "minLength": 1,
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "source",
          "id"
        ],
        "title": "EventCustomJoinKey",
        "type": "object"
      },
      "EventCustomProperty": {
        "description": "A saved custom property computed on the event, by id.",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/PropertyType"
          },
          "path": {
            "anyOf": [
              {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Key path into an object-valued property.",
            "title": "Path"
          },
          "list_item": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListItem"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required for, and only for, `list[object]`."
          },
          "source": {
            "const": "event_custom",
            "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.",
            "title": "Source",
            "type": "string"
          },
          "id": {
            "minLength": 1,
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "type",
          "source",
          "id"
        ],
        "title": "EventCustomProperty",
        "type": "object"
      },
      "EventFrequencyPerUserMeasurement": {
        "description": "A statistic over how many matching events each user performed.",
        "properties": {
          "type": {
            "const": "frequency_per_user",
            "description": "What the metric calculates. Set `type` to `count`, `property`, `frequency_per_user`, or `property_per_user`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "calculation": {
            "enum": [
              "distribution",
              "average",
              "percentile",
              "min",
              "max"
            ],
            "title": "Calculation",
            "type": "string"
          },
          "percentile": {
            "anyOf": [
              {
                "exclusiveMaximum": 100,
                "exclusiveMinimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The percentile to compute, strictly between 0 and 100; 50 is the median. Required for, and only for, calculation `percentile`.",
            "title": "Percentile"
          }
        },
        "required": [
          "type",
          "calculation"
        ],
        "title": "EventFrequencyPerUserMeasurement",
        "type": "object"
      },
      "EventJoinKey": {
        "description": "An event property a lookup table is attached to.",
        "properties": {
          "source": {
            "const": "event",
            "description": "The property the lookup table is joined on. Set `source` to `event`, `profile`, `event_custom`, or `profile_custom`.",
            "title": "Source",
            "type": "string"
          },
          "name": {
            "description": "Name of the event property.",
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "is_list": {
            "default": false,
            "description": "Set to true when the property is list-valued. Each element of the list is looked up in the lookup table, and a filter matches the looked-up values by `list_match`.",
            "title": "Is List",
            "type": "boolean"
          }
        },
        "required": [
          "source",
          "name"
        ],
        "title": "EventJoinKey",
        "type": "object"
      },
      "EventMetric": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "group_key": {
            "default": "User",
            "description": "The raw group key name, as shown in Project Settings—for example `$company_id`. `User` is the user profile and the default.",
            "minLength": 1,
            "title": "Group Key",
            "type": "string"
          },
          "measurement": {
            "description": "What the metric calculates. Set `type` to `count`, `property`, `frequency_per_user`, or `property_per_user`.",
            "discriminator": {
              "mapping": {
                "count": "#/components/schemas/EventCountMeasurement",
                "frequency_per_user": "#/components/schemas/EventFrequencyPerUserMeasurement",
                "property": "#/components/schemas/EventPropertyMeasurement",
                "property_per_user": "#/components/schemas/EventPropertyPerUserMeasurement"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventCountMeasurement"
              },
              {
                "$ref": "#/components/schemas/EventPropertyMeasurement"
              },
              {
                "$ref": "#/components/schemas/EventFrequencyPerUserMeasurement"
              },
              {
                "$ref": "#/components/schemas/EventPropertyPerUserMeasurement"
              }
            ],
            "title": "Measurement"
          },
          "type": {
            "const": "event",
            "description": "Set `type` to `event` to measure events, `funnel` for conversion through ordered steps, `retention` for how often users return after a start event, `cohort` for the members of a saved cohort, or `formula` to combine other metrics in this request.",
            "title": "Type",
            "type": "string"
          },
          "events": {
            "items": {
              "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
              "discriminator": {
                "mapping": {
                  "custom_event": "#/components/schemas/CustomEvent",
                  "event": "#/components/schemas/Event"
                },
                "propertyName": "event_type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Event"
                },
                {
                  "$ref": "#/components/schemas/CustomEvent"
                }
              ]
            },
            "minItems": 1,
            "title": "Events",
            "type": "array"
          }
        },
        "required": [
          "measurement",
          "type",
          "events"
        ],
        "title": "EventMetric",
        "type": "object"
      },
      "EventProperty": {
        "description": "A property recorded on the event.",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/PropertyType"
          },
          "path": {
            "anyOf": [
              {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Key path into an object-valued property.",
            "title": "Path"
          },
          "list_item": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListItem"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required for, and only for, `list[object]`."
          },
          "source": {
            "const": "event",
            "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.",
            "title": "Source",
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "type",
          "source",
          "name"
        ],
        "title": "EventProperty",
        "type": "object"
      },
      "EventPropertyMeasurement": {
        "description": "A statistic over a property's values across all matching events.\n\nEvery calculation except `distinct_count` needs a number property.",
        "properties": {
          "type": {
            "const": "property",
            "description": "What the metric calculates. Set `type` to `count`, `property`, `frequency_per_user`, or `property_per_user`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "calculation": {
            "enum": [
              "sum",
              "average",
              "percentile",
              "min",
              "max",
              "distinct_count"
            ],
            "title": "Calculation",
            "type": "string"
          },
          "percentile": {
            "anyOf": [
              {
                "exclusiveMaximum": 100,
                "exclusiveMinimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The percentile to compute, strictly between 0 and 100; 50 is the median. Required for, and only for, calculation `percentile`.",
            "title": "Percentile"
          },
          "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": {
              "mapping": {
                "event": "#/components/schemas/EventProperty",
                "event_custom": "#/components/schemas/EventCustomProperty",
                "lookup": "#/components/schemas/LookupProperty",
                "profile": "#/components/schemas/ProfileProperty",
                "profile_custom": "#/components/schemas/ProfileCustomProperty"
              },
              "propertyName": "source"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileProperty"
              },
              {
                "$ref": "#/components/schemas/LookupProperty"
              },
              {
                "$ref": "#/components/schemas/EventCustomProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileCustomProperty"
              }
            ],
            "title": "Property"
          }
        },
        "required": [
          "type",
          "calculation",
          "property"
        ],
        "title": "EventPropertyMeasurement",
        "type": "object"
      },
      "EventPropertyPerUserMeasurement": {
        "description": "Aggregates a property for each user, then a statistic across users.\n\n`per_user` other than `distinct_count` needs a number property.",
        "properties": {
          "type": {
            "const": "property_per_user",
            "description": "What the metric calculates. Set `type` to `count`, `property`, `frequency_per_user`, or `property_per_user`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "calculation": {
            "enum": [
              "distribution",
              "sum",
              "average",
              "percentile",
              "min",
              "max"
            ],
            "title": "Calculation",
            "type": "string"
          },
          "percentile": {
            "anyOf": [
              {
                "exclusiveMaximum": 100,
                "exclusiveMinimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The percentile to compute, strictly between 0 and 100; 50 is the median. Required for, and only for, calculation `percentile`.",
            "title": "Percentile"
          },
          "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": {
              "mapping": {
                "event": "#/components/schemas/EventProperty",
                "event_custom": "#/components/schemas/EventCustomProperty",
                "lookup": "#/components/schemas/LookupProperty",
                "profile": "#/components/schemas/ProfileProperty",
                "profile_custom": "#/components/schemas/ProfileCustomProperty"
              },
              "propertyName": "source"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileProperty"
              },
              {
                "$ref": "#/components/schemas/LookupProperty"
              },
              {
                "$ref": "#/components/schemas/EventCustomProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileCustomProperty"
              }
            ],
            "title": "Property"
          },
          "per_user": {
            "description": "What is computed for each user (each `group_key` entity) before `calculation` runs across users.",
            "enum": [
              "sum",
              "average",
              "distinct_count",
              "min",
              "max"
            ],
            "title": "Per User",
            "type": "string"
          }
        },
        "required": [
          "type",
          "calculation",
          "property",
          "per_user"
        ],
        "title": "EventPropertyPerUserMeasurement",
        "type": "object"
      },
      "FirstTimeFilter": {
        "description": "Keeps only the first time each user did the event.",
        "properties": {
          "type": {
            "const": "first_time",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "title": "FirstTimeFilter",
        "type": "object"
      },
      "FormulaMetric": {
        "properties": {
          "type": {
            "const": "formula",
            "description": "Set `type` to `event` to measure events, `funnel` for conversion through ordered steps, `retention` for how often users return after a start event, `cohort` for the members of a saved cohort, or `formula` to combine other metrics in this request.",
            "title": "Type",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "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.",
            "minLength": 1,
            "title": "Formula",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          }
        },
        "required": [
          "type",
          "formula"
        ],
        "title": "FormulaMetric",
        "type": "object"
      },
      "FunnelBehavior": {
        "properties": {
          "type": {
            "const": "funnel",
            "description": "Set `type` to `event` for events counted as they happen, `funnel` for ordered steps, or `retention` for a start event and a return event.",
            "title": "Type",
            "type": "string"
          },
          "steps": {
            "description": "The funnel steps, first to last.",
            "items": {
              "$ref": "#/components/schemas/FunnelStep"
            },
            "maxItems": 25,
            "minItems": 2,
            "title": "Steps",
            "type": "array"
          },
          "conversion_window": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ConversionWindow"
              }
            ],
            "default": {
              "value": 7,
              "unit": "day"
            },
            "description": "How long after the first step the funnel must complete: a span of time or up to 12 sessions. Defaults to 7 days."
          },
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FunnelOrder"
              }
            ],
            "default": "ordered",
            "description": "ordered: steps in sequence, other events may occur between them. any: the steps after the first may happen in any order."
          },
          "hold_constant": {
            "default": [],
            "description": "Properties whose value must stay the same across a user's steps.",
            "items": {
              "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": {
                "mapping": {
                  "event": "#/components/schemas/EventProperty",
                  "event_custom": "#/components/schemas/EventCustomProperty",
                  "lookup": "#/components/schemas/LookupProperty",
                  "profile": "#/components/schemas/ProfileProperty",
                  "profile_custom": "#/components/schemas/ProfileCustomProperty"
                },
                "propertyName": "source"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/EventProperty"
                },
                {
                  "$ref": "#/components/schemas/ProfileProperty"
                },
                {
                  "$ref": "#/components/schemas/LookupProperty"
                },
                {
                  "$ref": "#/components/schemas/EventCustomProperty"
                },
                {
                  "$ref": "#/components/schemas/ProfileCustomProperty"
                }
              ]
            },
            "title": "Hold Constant",
            "type": "array"
          },
          "exclusions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/FunnelExclusion"
            },
            "title": "Exclusions",
            "type": "array"
          },
          "reentry_mode": {
            "default": "basic",
            "description": "How a user who starts the funnel again before finishing it is counted.",
            "enum": [
              "basic",
              "optimized"
            ],
            "title": "Reentry Mode",
            "type": "string"
          }
        },
        "required": [
          "type",
          "steps"
        ],
        "title": "FunnelBehavior",
        "type": "object"
      },
      "FunnelConversionRateMeasurement": {
        "description": "The share of entities that complete the funnel, counted per `calculation`.",
        "properties": {
          "type": {
            "const": "conversion_rate",
            "description": "What the metric calculates. Set `type` to `conversion_rate`, `count`, `time_to_convert`, or `property`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "calculation": {
            "default": "unique_users",
            "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.",
            "enum": [
              "unique_users",
              "total_events",
              "total_sessions"
            ],
            "title": "Calculation",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "title": "FunnelConversionRateMeasurement",
        "type": "object"
      },
      "FunnelCountMeasurement": {
        "description": "Counts the entities, events, or sessions that complete the funnel.",
        "properties": {
          "type": {
            "const": "count",
            "description": "What the metric calculates. Set `type` to `conversion_rate`, `count`, `time_to_convert`, or `property`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "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.",
            "enum": [
              "unique_users",
              "total_events",
              "total_sessions"
            ],
            "title": "Calculation",
            "type": "string"
          }
        },
        "required": [
          "type",
          "calculation"
        ],
        "title": "FunnelCountMeasurement",
        "type": "object"
      },
      "FunnelExclusion": {
        "description": "An event that drops a user from the funnel when it happens between two steps.",
        "properties": {
          "event": {
            "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
            "discriminator": {
              "mapping": {
                "custom_event": "#/components/schemas/CustomEvent",
                "event": "#/components/schemas/Event"
              },
              "propertyName": "event_type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/Event"
              },
              {
                "$ref": "#/components/schemas/CustomEvent"
              }
            ],
            "title": "Event"
          },
          "from_step": {
            "description": "The 1-based step the exclusion starts after.",
            "minimum": 1,
            "title": "From Step",
            "type": "integer"
          },
          "to_step": {
            "description": "The 1-based step the exclusion ends before.",
            "minimum": 2,
            "title": "To Step",
            "type": "integer"
          }
        },
        "required": [
          "event",
          "from_step",
          "to_step"
        ],
        "title": "FunnelExclusion",
        "type": "object"
      },
      "FunnelMetric": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "group_key": {
            "default": "User",
            "description": "The raw group key name, as shown in Project Settings—for example `$company_id`. `User` is the user profile and the default.",
            "minLength": 1,
            "title": "Group Key",
            "type": "string"
          },
          "measurement": {
            "description": "What the metric calculates. Set `type` to `conversion_rate`, `count`, `time_to_convert`, or `property`.",
            "discriminator": {
              "mapping": {
                "conversion_rate": "#/components/schemas/FunnelConversionRateMeasurement",
                "count": "#/components/schemas/FunnelCountMeasurement",
                "property": "#/components/schemas/FunnelPropertyMeasurement",
                "time_to_convert": "#/components/schemas/FunnelTimeToConvertMeasurement"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/FunnelConversionRateMeasurement"
              },
              {
                "$ref": "#/components/schemas/FunnelCountMeasurement"
              },
              {
                "$ref": "#/components/schemas/FunnelTimeToConvertMeasurement"
              },
              {
                "$ref": "#/components/schemas/FunnelPropertyMeasurement"
              }
            ],
            "title": "Measurement"
          },
          "type": {
            "const": "funnel",
            "description": "Set `type` to `event` to measure events, `funnel` for conversion through ordered steps, `retention` for how often users return after a start event, `cohort` for the members of a saved cohort, or `formula` to combine other metrics in this request.",
            "title": "Type",
            "type": "string"
          },
          "steps": {
            "description": "The funnel steps, first to last.",
            "items": {
              "$ref": "#/components/schemas/FunnelStep"
            },
            "maxItems": 25,
            "minItems": 2,
            "title": "Steps",
            "type": "array"
          },
          "conversion_window": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ConversionWindow"
              }
            ],
            "default": {
              "value": 7,
              "unit": "day"
            },
            "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."
          },
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FunnelOrder"
              }
            ],
            "default": "ordered",
            "description": "ordered: steps in sequence, other events may occur between them. any: the steps after the first may happen in any order."
          },
          "hold_constant": {
            "default": [],
            "description": "Properties whose value must stay the same across a user's steps.",
            "items": {
              "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": {
                "mapping": {
                  "event": "#/components/schemas/EventProperty",
                  "event_custom": "#/components/schemas/EventCustomProperty",
                  "lookup": "#/components/schemas/LookupProperty",
                  "profile": "#/components/schemas/ProfileProperty",
                  "profile_custom": "#/components/schemas/ProfileCustomProperty"
                },
                "propertyName": "source"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/EventProperty"
                },
                {
                  "$ref": "#/components/schemas/ProfileProperty"
                },
                {
                  "$ref": "#/components/schemas/LookupProperty"
                },
                {
                  "$ref": "#/components/schemas/EventCustomProperty"
                },
                {
                  "$ref": "#/components/schemas/ProfileCustomProperty"
                }
              ]
            },
            "title": "Hold Constant",
            "type": "array"
          },
          "exclusions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/FunnelExclusion"
            },
            "title": "Exclusions",
            "type": "array"
          },
          "reentry_mode": {
            "default": "basic",
            "description": "How a user who starts the funnel again before finishing it is counted.",
            "enum": [
              "basic",
              "optimized"
            ],
            "title": "Reentry Mode",
            "type": "string"
          }
        },
        "required": [
          "measurement",
          "type",
          "steps"
        ],
        "title": "FunnelMetric",
        "type": "object"
      },
      "FunnelOrder": {
        "description": "`ordered`: steps in sequence, other events may occur between them.\n`any`: the steps after the first may happen in any order.",
        "enum": [
          "ordered",
          "any"
        ],
        "title": "FunnelOrder",
        "type": "string"
      },
      "FunnelPropertyMeasurement": {
        "description": "The sum of a number property over the last-step event of each conversion.",
        "properties": {
          "type": {
            "const": "property",
            "description": "What the metric calculates. Set `type` to `conversion_rate`, `count`, `time_to_convert`, or `property`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "calculation": {
            "const": "sum",
            "default": "sum",
            "title": "Calculation",
            "type": "string"
          },
          "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": {
              "mapping": {
                "event": "#/components/schemas/EventProperty",
                "event_custom": "#/components/schemas/EventCustomProperty",
                "lookup": "#/components/schemas/LookupProperty",
                "profile": "#/components/schemas/ProfileProperty",
                "profile_custom": "#/components/schemas/ProfileCustomProperty"
              },
              "propertyName": "source"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileProperty"
              },
              {
                "$ref": "#/components/schemas/LookupProperty"
              },
              {
                "$ref": "#/components/schemas/EventCustomProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileCustomProperty"
              }
            ],
            "title": "Property"
          }
        },
        "required": [
          "type",
          "property"
        ],
        "title": "FunnelPropertyMeasurement",
        "type": "object"
      },
      "FunnelStep": {
        "properties": {
          "event": {
            "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
            "discriminator": {
              "mapping": {
                "custom_event": "#/components/schemas/CustomEvent",
                "event": "#/components/schemas/Event"
              },
              "propertyName": "event_type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/Event"
              },
              {
                "$ref": "#/components/schemas/CustomEvent"
              }
            ],
            "title": "Event"
          },
          "alternative_events": {
            "default": [],
            "description": "Other events that also complete the step.",
            "items": {
              "description": "Set `event_type` to `event` for an event tracked into the project, or `custom_event` for a saved custom event.",
              "discriminator": {
                "mapping": {
                  "custom_event": "#/components/schemas/CustomEvent",
                  "event": "#/components/schemas/Event"
                },
                "propertyName": "event_type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Event"
                },
                {
                  "$ref": "#/components/schemas/CustomEvent"
                }
              ]
            },
            "title": "Alternative Events",
            "type": "array"
          },
          "order": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FunnelOrder"
              },
              {
                "type": "null"
              }
            ],
            "description": "The step's order when it differs from the funnel's: `any` lets the step happen in any order relative to the other `any` steps."
          }
        },
        "required": [
          "event"
        ],
        "title": "FunnelStep",
        "type": "object"
      },
      "FunnelTimeToConvertMeasurement": {
        "description": "A statistic over how long converting entities took, in seconds.",
        "properties": {
          "type": {
            "const": "time_to_convert",
            "description": "What the metric calculates. Set `type` to `conversion_rate`, `count`, `time_to_convert`, or `property`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "calculation": {
            "enum": [
              "average",
              "percentile",
              "min",
              "max"
            ],
            "title": "Calculation",
            "type": "string"
          },
          "percentile": {
            "anyOf": [
              {
                "exclusiveMaximum": 100,
                "exclusiveMinimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The percentile to compute, strictly between 0 and 100; 50 is the median. Required for, and only for, calculation `percentile`.",
            "title": "Percentile"
          }
        },
        "required": [
          "type",
          "calculation"
        ],
        "title": "FunnelTimeToConvertMeasurement",
        "type": "object"
      },
      "ListDataDefinitionsResponse": {
        "description": "A page of a project's data definitions, ordered by name.",
        "properties": {
          "results": {
            "description": "List of items for the current page.",
            "items": {
              "discriminator": {
                "mapping": {
                  "behavior": "#/components/schemas/BehaviorDataDefinitionResponse",
                  "cohort": "#/components/schemas/CohortDataDefinitionResponse",
                  "custom_event": "#/components/schemas/CustomEventDataDefinitionResponse",
                  "custom_property": "#/components/schemas/CustomPropertyDataDefinitionResponse",
                  "event": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                  "event_property": "#/components/schemas/DataDefinitionWithoutBodyResponse",
                  "metric": "#/components/schemas/MetricDataDefinitionResponse"
                },
                "propertyName": "type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/DataDefinitionWithoutBodyResponse"
                },
                {
                  "$ref": "#/components/schemas/CustomEventDataDefinitionResponse"
                },
                {
                  "$ref": "#/components/schemas/CustomPropertyDataDefinitionResponse"
                },
                {
                  "$ref": "#/components/schemas/BehaviorDataDefinitionResponse"
                },
                {
                  "$ref": "#/components/schemas/MetricDataDefinitionResponse"
                },
                {
                  "$ref": "#/components/schemas/CohortDataDefinitionResponse"
                }
              ]
            },
            "title": "Results",
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPaginationResponse",
            "description": "Pagination cursors to navigate through the results."
          }
        },
        "required": [
          "results",
          "pagination"
        ],
        "title": "ListDataDefinitionsResponse",
        "type": "object"
      },
      "ListItem": {
        "description": "Reads one primitive key out of each object in a `list[object]` property,\nso the list can be filtered or broken down like a `list[<type>]`.\n\n`key_path` is the path from the object root to the leaf value: `[\"sku\"]` for a\ntop-level key, `[\"details\", \"sku\"]` for a nested one.",
        "properties": {
          "key_path": {
            "items": {
              "minLength": 1,
              "type": "string"
            },
            "minItems": 1,
            "title": "Key Path",
            "type": "array"
          },
          "type": {
            "enum": [
              "string",
              "number",
              "boolean",
              "datetime",
              "list[string]",
              "list[number]",
              "list[boolean]",
              "list[datetime]",
              "list[list]"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "key_path",
          "type"
        ],
        "title": "ListItem",
        "type": "object"
      },
      "ListMatch": {
        "description": "How a filter treats a list-valued property: match when any element\npasses, or only when all do.",
        "enum": [
          "any",
          "all"
        ],
        "title": "ListMatch",
        "type": "string"
      },
      "LogicalOperators": {
        "description": "How a list of filters is combined: `AND` keeps what matches every filter, `OR`\nwhat matches any of them.",
        "enum": [
          "AND",
          "OR"
        ],
        "title": "LogicalOperators",
        "type": "string"
      },
      "LookupProperty": {
        "description": "A column of a lookup table, reached through the property it is joined on.\n\nThe table is not named: each join key maps to at most one lookup table, and\na column name alone is ambiguous across tables. Group profiles are not\nlookup tables; their properties are `profile` properties with a `group_key`.",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/PropertyType"
          },
          "path": {
            "anyOf": [
              {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Key path into an object-valued property.",
            "title": "Path"
          },
          "list_item": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListItem"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required for, and only for, `list[object]`."
          },
          "source": {
            "const": "lookup",
            "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.",
            "title": "Source",
            "type": "string"
          },
          "join_key": {
            "description": "The property the lookup table is joined on. Set `source` to `event`, `profile`, `event_custom`, or `profile_custom`.",
            "discriminator": {
              "mapping": {
                "event": "#/components/schemas/EventJoinKey",
                "event_custom": "#/components/schemas/EventCustomJoinKey",
                "profile": "#/components/schemas/ProfileJoinKey",
                "profile_custom": "#/components/schemas/ProfileCustomJoinKey"
              },
              "propertyName": "source"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventJoinKey"
              },
              {
                "$ref": "#/components/schemas/ProfileJoinKey"
              },
              {
                "$ref": "#/components/schemas/EventCustomJoinKey"
              },
              {
                "$ref": "#/components/schemas/ProfileCustomJoinKey"
              }
            ],
            "title": "Join Key"
          },
          "column": {
            "description": "Name of the column to read from the lookup table joined on `join_key`.",
            "minLength": 1,
            "title": "Column",
            "type": "string"
          }
        },
        "required": [
          "type",
          "source",
          "join_key",
          "column"
        ],
        "title": "LookupProperty",
        "type": "object"
      },
      "MetricDataDefinitionResponse": {
        "properties": {
          "id": {
            "description": "Opaque definition ID, stable across renames.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The definition's name.",
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name shown in the UI.",
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "hidden": {
            "description": "Whether the definition is hidden in the UI.",
            "title": "Hidden",
            "type": "boolean"
          },
          "blocked": {
            "description": "Whether the definition's incoming data is dropped at ingest. Types that cannot be blocked always report `false`.",
            "title": "Blocked",
            "type": "boolean"
          },
          "verified": {
            "description": "Whether the definition is verified.",
            "title": "Verified",
            "type": "boolean"
          },
          "last_verified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the definition was last verified.",
            "title": "Last Verified At"
          },
          "last_verified_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionVerifier"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who last verified the definition."
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionOwner"
            },
            "title": "Owners",
            "type": "array"
          },
          "merged_into": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataDefinitionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition this one is merged into."
          },
          "first_tracked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When data for the definition was first seen.",
            "title": "First Tracked At"
          },
          "created_at": {
            "description": "When the definition was created.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "updated_at": {
            "description": "When the definition was last updated.",
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "type": {
            "const": "metric",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "anyOf": [
              {
                "description": "One metric, or a formula's inputs followed by the formula, which refers to each input by its `display_name`.",
                "items": {
                  "description": "Set `type` to `event`, `funnel`, `retention`, `cohort`, or `formula` for a metric defined inline, or `saved_metric` for a saved metric.",
                  "discriminator": {
                    "mapping": {
                      "cohort": "#/components/schemas/CohortMetric",
                      "event": "#/components/schemas/EventMetric",
                      "formula": "#/components/schemas/FormulaMetric",
                      "funnel": "#/components/schemas/FunnelMetric",
                      "retention": "#/components/schemas/RetentionMetric",
                      "saved_metric": "#/components/schemas/SavedMetric"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/EventMetric"
                    },
                    {
                      "$ref": "#/components/schemas/FunnelMetric"
                    },
                    {
                      "$ref": "#/components/schemas/RetentionMetric"
                    },
                    {
                      "$ref": "#/components/schemas/CohortMetric"
                    },
                    {
                      "$ref": "#/components/schemas/FormulaMetric"
                    },
                    {
                      "$ref": "#/components/schemas/SavedMetric"
                    }
                  ]
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "The metric's query. Null when the stored definition cannot be expressed in this schema. Optional fields that are null or empty are left out of the definition.",
            "title": "Definition"
          }
        },
        "required": [
          "id",
          "name",
          "event_name",
          "display_name",
          "description",
          "hidden",
          "blocked",
          "verified",
          "last_verified_at",
          "last_verified_by",
          "tags",
          "owners",
          "merged_into",
          "first_tracked_at",
          "created_at",
          "updated_at",
          "type",
          "definition"
        ],
        "title": "MetricDataDefinitionResponse",
        "type": "object"
      },
      "Operator": {
        "description": "The comparison a property filter applies.\n\nWhich operators are valid depends on the property's `type`.",
        "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",
        "type": "string"
      },
      "OwnerType": {
        "enum": [
          "user",
          "team"
        ],
        "title": "OwnerType",
        "type": "string"
      },
      "ProfileCustomJoinKey": {
        "description": "A saved user profile custom property a lookup table is attached to.\n\nA `profile_custom` join key always means the `$user_id` profile. The query\nreads whether it is list-valued from the saved custom property.",
        "properties": {
          "source": {
            "const": "profile_custom",
            "description": "The property the lookup table is joined on. Set `source` to `event`, `profile`, `event_custom`, or `profile_custom`.",
            "title": "Source",
            "type": "string"
          },
          "id": {
            "minLength": 1,
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "source",
          "id"
        ],
        "title": "ProfileCustomJoinKey",
        "type": "object"
      },
      "ProfileCustomProperty": {
        "description": "A saved custom property computed on a user or group profile, by id.\n\n`group_key` names which profile, as for `profile` properties.",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/PropertyType"
          },
          "path": {
            "anyOf": [
              {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Key path into an object-valued property.",
            "title": "Path"
          },
          "list_item": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListItem"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required for, and only for, `list[object]`."
          },
          "source": {
            "const": "profile_custom",
            "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.",
            "title": "Source",
            "type": "string"
          },
          "id": {
            "minLength": 1,
            "title": "Id",
            "type": "string"
          },
          "group_key": {
            "default": "User",
            "description": "The raw group key name, as shown in Project Settings—for example `$company_id`. `User` is the user profile and the default.",
            "minLength": 1,
            "title": "Group Key",
            "type": "string"
          }
        },
        "required": [
          "type",
          "source",
          "id"
        ],
        "title": "ProfileCustomProperty",
        "type": "object"
      },
      "ProfileJoinKey": {
        "description": "A user profile property a lookup table is attached to.\n\nA `profile` join key always means the `$user_id` profile.",
        "properties": {
          "source": {
            "const": "profile",
            "description": "The property the lookup table is joined on. Set `source` to `event`, `profile`, `event_custom`, or `profile_custom`.",
            "title": "Source",
            "type": "string"
          },
          "name": {
            "description": "Name of the user profile property.",
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "is_list": {
            "default": false,
            "description": "Set to true when the property is list-valued. Each element of the list is looked up in the lookup table, and a filter matches the looked-up values by `list_match`.",
            "title": "Is List",
            "type": "boolean"
          }
        },
        "required": [
          "source",
          "name"
        ],
        "title": "ProfileJoinKey",
        "type": "object"
      },
      "ProfileProperty": {
        "description": "A property on a user profile or a group profile (company, organization,\n...), read as of query time.\n\n`group_key` names which profile.",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/PropertyType"
          },
          "path": {
            "anyOf": [
              {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Key path into an object-valued property.",
            "title": "Path"
          },
          "list_item": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListItem"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required for, and only for, `list[object]`."
          },
          "source": {
            "const": "profile",
            "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.",
            "title": "Source",
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "group_key": {
            "default": "User",
            "description": "The raw group key name, as shown in Project Settings—for example `$company_id`. `User` is the user profile and the default.",
            "minLength": 1,
            "title": "Group Key",
            "type": "string"
          }
        },
        "required": [
          "type",
          "source",
          "name"
        ],
        "title": "ProfileProperty",
        "type": "object"
      },
      "PropertyFilter": {
        "description": "Filters events or profiles by a property value, including datetime properties.",
        "properties": {
          "type": {
            "const": "property",
            "title": "Type",
            "type": "string"
          },
          "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": {
              "mapping": {
                "event": "#/components/schemas/EventProperty",
                "event_custom": "#/components/schemas/EventCustomProperty",
                "lookup": "#/components/schemas/LookupProperty",
                "profile": "#/components/schemas/ProfileProperty",
                "profile_custom": "#/components/schemas/ProfileCustomProperty"
              },
              "propertyName": "source"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileProperty"
              },
              {
                "$ref": "#/components/schemas/LookupProperty"
              },
              {
                "$ref": "#/components/schemas/EventCustomProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileCustomProperty"
              }
            ],
            "title": "Property"
          },
          "operator": {
            "description": "The comparison to apply. Which operators are valid depends on the property's `type`. The datetime operators apply to datetime properties only.",
            "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",
              "is on",
              "is not on",
              "is before",
              "is on or after",
              "is in the last",
              "is not in the last",
              "is before the last",
              "is in the next"
            ],
            "title": "Operator",
            "type": "string"
          },
          "values": {
            "anyOf": [
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "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. For a datetime property: one calendar date for `is on`, `is not on`; one date or timestamp for `is before`, `is on or after`; two dates or two timestamps (not one of each), both inclusive, for `is between` / `is not between`; one whole number of at least 1 for the relative operators. A date is `YYYY-MM-DD` or `YYYY-MM-DDTHH:mm`, in the project's timezone.",
            "title": "Values"
          },
          "list_match": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListMatch"
              },
              {
                "type": "null"
              }
            ],
            "description": "For list-valued properties, and for lookup columns whose join key is list-valued (`join_key.is_list`). 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": {
            "default": false,
            "description": "For list-valued properties with `list_match: any`: drop the list elements that did not match instead of keeping the whole list. Not supported for lookup properties.",
            "title": "Keep Only Matching",
            "type": "boolean"
          },
          "unit": {
            "anyOf": [
              {
                "enum": [
                  "minute",
                  "hour",
                  "day",
                  "week",
                  "month"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The unit of the window of a relative datetime operator (`is in the last`, `is not in the last`, `is before the last`, `is in the next`). Required for those, and not allowed for any other operator.",
            "title": "Unit"
          }
        },
        "required": [
          "type",
          "property",
          "operator"
        ],
        "title": "PropertyFilter",
        "type": "object"
      },
      "PropertyType": {
        "description": "The type a property's value is interpreted as.\n\nRequired, because the query does not look a property's type up.\n`list[object]` is only usable together with `list_item`, which picks one\nkey out of each object.",
        "enum": [
          "string",
          "number",
          "boolean",
          "datetime",
          "list[string]",
          "list[number]",
          "list[boolean]",
          "list[datetime]",
          "list[list]",
          "list[object]"
        ],
        "title": "PropertyType",
        "type": "string"
      },
      "RetentionBehavior": {
        "properties": {
          "type": {
            "const": "retention",
            "description": "Set `type` to `event` for events counted as they happen, `funnel` for ordered steps, or `retention` for a start event and a return event.",
            "title": "Type",
            "type": "string"
          },
          "start_event": {
            "description": "The event that starts an entity's retention clock.",
            "discriminator": {
              "mapping": {
                "custom_event": "#/components/schemas/CustomEvent",
                "event": "#/components/schemas/Event"
              },
              "propertyName": "event_type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/Event"
              },
              {
                "$ref": "#/components/schemas/CustomEvent"
              }
            ],
            "title": "Start Event"
          },
          "return_event": {
            "description": "The event that counts as returning.",
            "discriminator": {
              "mapping": {
                "custom_event": "#/components/schemas/CustomEvent",
                "event": "#/components/schemas/Event"
              },
              "propertyName": "event_type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/Event"
              },
              {
                "$ref": "#/components/schemas/CustomEvent"
              }
            ],
            "title": "Return Event"
          },
          "unit": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RetentionUnit"
              }
            ],
            "default": "day",
            "description": "The size of each retention bucket after the start event."
          },
          "criteria": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RetentionCriteria"
              }
            ],
            "default": "on",
            "description": "When a return event counts toward a 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)."
          },
          "alignment": {
            "default": "birth",
            "description": "`birth` measures buckets from each user's start event, `interval_start` from the start of the interval the start event happened in.",
            "enum": [
              "birth",
              "interval_start"
            ],
            "title": "Alignment",
            "type": "string"
          },
          "custom_bucket_sizes": {
            "default": [],
            "description": "Bucket widths in `unit`s, when the buckets are not one unit each.",
            "items": {
              "type": "integer"
            },
            "title": "Custom Bucket Sizes",
            "type": "array"
          }
        },
        "required": [
          "type",
          "start_event",
          "return_event"
        ],
        "title": "RetentionBehavior",
        "type": "object"
      },
      "RetentionCountMeasurement": {
        "description": "Counts the entities retained in the bucket.",
        "properties": {
          "type": {
            "const": "count",
            "description": "What the metric reports. Set `type` to `retention_rate`, `count`, or `property`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "calculation": {
            "const": "unique_users",
            "default": "unique_users",
            "title": "Calculation",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "title": "RetentionCountMeasurement",
        "type": "object"
      },
      "RetentionCriteria": {
        "description": "When a return event counts toward a bucket: `on` that bucket only,\n`on_or_after` that bucket or any later one, `on_or_before` that bucket or\nany earlier one, `streak` every bucket up to and including it.",
        "enum": [
          "on",
          "on_or_after",
          "on_or_before",
          "streak"
        ],
        "title": "RetentionCriteria",
        "type": "string"
      },
      "RetentionMetric": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "group_key": {
            "default": "User",
            "description": "The raw group key name, as shown in Project Settings—for example `$company_id`. `User` is the user profile and the default.",
            "minLength": 1,
            "title": "Group Key",
            "type": "string"
          },
          "measurement": {
            "description": "What the metric reports. Set `type` to `retention_rate`, `count`, or `property`.",
            "discriminator": {
              "mapping": {
                "count": "#/components/schemas/RetentionCountMeasurement",
                "property": "#/components/schemas/RetentionPropertyMeasurement",
                "retention_rate": "#/components/schemas/RetentionRateMeasurement"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/RetentionRateMeasurement"
              },
              {
                "$ref": "#/components/schemas/RetentionCountMeasurement"
              },
              {
                "$ref": "#/components/schemas/RetentionPropertyMeasurement"
              }
            ],
            "title": "Measurement"
          },
          "type": {
            "const": "retention",
            "description": "Set `type` to `event` to measure events, `funnel` for conversion through ordered steps, `retention` for how often users return after a start event, `cohort` for the members of a saved cohort, or `formula` to combine other metrics in this request.",
            "title": "Type",
            "type": "string"
          },
          "start_event": {
            "description": "The event that starts an entity's retention clock.",
            "discriminator": {
              "mapping": {
                "custom_event": "#/components/schemas/CustomEvent",
                "event": "#/components/schemas/Event"
              },
              "propertyName": "event_type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/Event"
              },
              {
                "$ref": "#/components/schemas/CustomEvent"
              }
            ],
            "title": "Start Event"
          },
          "return_event": {
            "description": "The event that counts as returning.",
            "discriminator": {
              "mapping": {
                "custom_event": "#/components/schemas/CustomEvent",
                "event": "#/components/schemas/Event"
              },
              "propertyName": "event_type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/Event"
              },
              {
                "$ref": "#/components/schemas/CustomEvent"
              }
            ],
            "title": "Return Event"
          },
          "unit": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RetentionUnit"
              }
            ],
            "default": "day",
            "description": "The size of each retention bucket after the start event."
          },
          "bucket": {
            "default": 0,
            "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.",
            "minimum": 0,
            "title": "Bucket",
            "type": "integer"
          },
          "criteria": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RetentionCriteria"
              }
            ],
            "default": "on",
            "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)."
          },
          "alignment": {
            "default": "birth",
            "description": "`birth` measures buckets from each user's start event, `interval_start` from the start of the interval the start event happened in.",
            "enum": [
              "birth",
              "interval_start"
            ],
            "title": "Alignment",
            "type": "string"
          },
          "custom_bucket_sizes": {
            "default": [],
            "description": "Bucket widths in `unit`s, when the buckets are not one unit each.",
            "items": {
              "type": "integer"
            },
            "title": "Custom Bucket Sizes",
            "type": "array"
          }
        },
        "required": [
          "measurement",
          "type",
          "start_event",
          "return_event"
        ],
        "title": "RetentionMetric",
        "type": "object"
      },
      "RetentionPropertyMeasurement": {
        "description": "A number property over the cohort's return events in the bucket: `sum` adds it\nup, `average` is the mean of each cohort member's sum, counting members who did not\nreturn as 0.",
        "properties": {
          "type": {
            "const": "property",
            "description": "What the metric reports. Set `type` to `retention_rate`, `count`, or `property`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          },
          "calculation": {
            "enum": [
              "sum",
              "average"
            ],
            "title": "Calculation",
            "type": "string"
          },
          "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": {
              "mapping": {
                "event": "#/components/schemas/EventProperty",
                "event_custom": "#/components/schemas/EventCustomProperty",
                "lookup": "#/components/schemas/LookupProperty",
                "profile": "#/components/schemas/ProfileProperty",
                "profile_custom": "#/components/schemas/ProfileCustomProperty"
              },
              "propertyName": "source"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileProperty"
              },
              {
                "$ref": "#/components/schemas/LookupProperty"
              },
              {
                "$ref": "#/components/schemas/EventCustomProperty"
              },
              {
                "$ref": "#/components/schemas/ProfileCustomProperty"
              }
            ],
            "title": "Property"
          }
        },
        "required": [
          "type",
          "calculation",
          "property"
        ],
        "title": "RetentionPropertyMeasurement",
        "type": "object"
      },
      "RetentionRateMeasurement": {
        "description": "The share of entities that did the start event and returned in the bucket.",
        "properties": {
          "type": {
            "const": "retention_rate",
            "description": "What the metric reports. Set `type` to `retention_rate`, `count`, or `property`.",
            "title": "Type",
            "type": "string"
          },
          "interval_aggregation": {
            "anyOf": [
              {
                "enum": [
                  "standard",
                  "cumulative"
                ],
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/RollingAverage"
              }
            ],
            "default": "standard",
            "title": "Interval Aggregation"
          }
        },
        "required": [
          "type"
        ],
        "title": "RetentionRateMeasurement",
        "type": "object"
      },
      "RetentionUnit": {
        "enum": [
          "day",
          "week",
          "month"
        ],
        "title": "RetentionUnit",
        "type": "string"
      },
      "RollingAverage": {
        "description": "A rolling average over a number of time buckets. The request must set\n`time.unit`, which sizes each bucket.",
        "properties": {
          "size": {
            "description": "Number of time buckets to average over.",
            "title": "Size",
            "type": "integer"
          }
        },
        "required": [
          "size"
        ],
        "title": "RollingAverage",
        "type": "object"
      },
      "SavedMetric": {
        "description": "A saved metric, as an input to a formula.",
        "properties": {
          "type": {
            "const": "saved_metric",
            "title": "Type",
            "type": "string"
          },
          "metric_id": {
            "description": "Id of the saved metric.",
            "minLength": 1,
            "title": "Metric Id",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          }
        },
        "required": [
          "type",
          "metric_id"
        ],
        "title": "SavedMetric",
        "type": "object"
      },
      "TimeUnit": {
        "enum": [
          "minute",
          "hour",
          "day",
          "week",
          "month",
          "quarter"
        ],
        "title": "TimeUnit",
        "type": "string"
      },
      "CreateBehaviorDataDefinitionRequest": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "The definition's name.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "maxLength": 175,
              "minLength": 1,
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/OwnerRef"
            },
            "title": "Owners",
            "type": "array"
          },
          "type": {
            "const": "behavior",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "description": "The behavior's query clause.",
            "discriminator": {
              "mapping": {
                "event": "#/components/schemas/EventBehavior",
                "funnel": "#/components/schemas/FunnelBehavior",
                "retention": "#/components/schemas/RetentionBehavior"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventBehavior"
              },
              {
                "$ref": "#/components/schemas/FunnelBehavior"
              },
              {
                "$ref": "#/components/schemas/RetentionBehavior"
              }
            ],
            "title": "Definition"
          }
        },
        "required": [
          "name",
          "type",
          "definition"
        ],
        "title": "CreateBehaviorDataDefinitionRequest",
        "type": "object"
      },
      "CreateCohortDataDefinitionRequest": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "The definition's name.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "maxLength": 175,
              "minLength": 1,
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/OwnerRef"
            },
            "title": "Owners",
            "type": "array"
          },
          "type": {
            "const": "cohort",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/CohortDefinition",
            "description": "Who the cohort's members are."
          }
        },
        "required": [
          "name",
          "type",
          "definition"
        ],
        "title": "CreateCohortDataDefinitionRequest",
        "type": "object"
      },
      "CreateCustomEventDataDefinitionRequest": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "The definition's name.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "maxLength": 175,
              "minLength": 1,
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/OwnerRef"
            },
            "title": "Owners",
            "type": "array"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name shown in the UI.",
            "title": "Display Name"
          },
          "type": {
            "const": "custom_event",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/CustomEventDefinition",
            "description": "The events the custom event combines."
          }
        },
        "required": [
          "name",
          "type",
          "definition"
        ],
        "title": "CreateCustomEventDataDefinitionRequest",
        "type": "object"
      },
      "CreateCustomPropertyDataDefinitionRequest": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "The definition's name.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "maxLength": 175,
              "minLength": 1,
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/OwnerRef"
            },
            "title": "Owners",
            "type": "array"
          },
          "type": {
            "const": "custom_property",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/CustomPropertyDefinition",
            "description": "How the custom property is computed."
          }
        },
        "required": [
          "name",
          "type",
          "definition"
        ],
        "title": "CreateCustomPropertyDataDefinitionRequest",
        "type": "object"
      },
      "CreateDataDefinitionWithoutBodyRequest": {
        "additionalProperties": false,
        "description": "An event or event property, which has no definition body.",
        "properties": {
          "name": {
            "description": "The definition's name.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "maxLength": 175,
              "minLength": 1,
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/OwnerRef"
            },
            "title": "Owners",
            "type": "array"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name shown in the UI.",
            "title": "Display Name"
          },
          "type": {
            "description": "The kind of definition.",
            "enum": [
              "event",
              "event_property"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type"
        ],
        "title": "CreateDataDefinitionWithoutBodyRequest",
        "type": "object"
      },
      "CreateMetricDataDefinitionRequest": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "The definition's name.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "event_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The parent event of an event property.",
            "title": "Event Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description.",
            "title": "Description"
          },
          "tags": {
            "description": "The definition's tag names.",
            "items": {
              "maxLength": 175,
              "minLength": 1,
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "owners": {
            "description": "The definition's owners.",
            "items": {
              "$ref": "#/components/schemas/OwnerRef"
            },
            "title": "Owners",
            "type": "array"
          },
          "type": {
            "const": "metric",
            "description": "The kind of definition.",
            "title": "Type",
            "type": "string"
          },
          "definition": {
            "description": "The metric's query.",
            "items": {
              "description": "Set `type` to `event`, `funnel`, `retention`, `cohort`, or `formula` for a metric defined inline, or `saved_metric` for a saved metric.",
              "discriminator": {
                "mapping": {
                  "cohort": "#/components/schemas/CohortMetric",
                  "event": "#/components/schemas/EventMetric",
                  "formula": "#/components/schemas/FormulaMetric",
                  "funnel": "#/components/schemas/FunnelMetric",
                  "retention": "#/components/schemas/RetentionMetric",
                  "saved_metric": "#/components/schemas/SavedMetric"
                },
                "propertyName": "type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/EventMetric"
                },
                {
                  "$ref": "#/components/schemas/FunnelMetric"
                },
                {
                  "$ref": "#/components/schemas/RetentionMetric"
                },
                {
                  "$ref": "#/components/schemas/CohortMetric"
                },
                {
                  "$ref": "#/components/schemas/FormulaMetric"
                },
                {
                  "$ref": "#/components/schemas/SavedMetric"
                }
              ]
            },
            "minItems": 1,
            "title": "Definition",
            "type": "array"
          }
        },
        "required": [
          "name",
          "type",
          "definition"
        ],
        "title": "CreateMetricDataDefinitionRequest",
        "type": "object"
      },
      "OwnerRef": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "$ref": "#/components/schemas/OwnerType"
          },
          "id": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "OwnerRef",
        "type": "object"
      },
      "DataDefinitionRef": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EntityType",
            "description": "The kind of definition."
          },
          "id": {
            "description": "The definition's ID.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The definition's name.",
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "name"
        ],
        "title": "DataDefinitionRef",
        "type": "object"
      },
      "EntityType": {
        "enum": [
          "event",
          "custom_event",
          "event_property",
          "custom_property",
          "metric",
          "behavior",
          "cohort"
        ],
        "title": "EntityType",
        "type": "string"
      },
      "MergeDataDefinitionResponse": {
        "properties": {
          "canonical": {
            "$ref": "#/components/schemas/DataDefinitionRef",
            "description": "The definition the sources merged into."
          },
          "sources": {
            "description": "The definitions merged into the canonical.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionRef"
            },
            "title": "Sources",
            "type": "array"
          }
        },
        "required": [
          "canonical",
          "sources"
        ],
        "title": "MergeDataDefinitionResponse",
        "type": "object"
      },
      "MergeDataDefinitionRequest": {
        "additionalProperties": false,
        "description": "Fold ``sources`` into ``canonical``, all of one ``type``. Exactly one merge per request.",
        "properties": {
          "type": {
            "description": "The kind of definition to merge.",
            "enum": [
              "event",
              "event_property"
            ],
            "title": "Type",
            "type": "string"
          },
          "canonical": {
            "description": "Name of the definition the sources merge into.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Canonical",
            "type": "string"
          },
          "sources": {
            "description": "Names of the definitions merged into the canonical.",
            "items": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "title": "Sources",
            "type": "array"
          }
        },
        "required": [
          "type",
          "canonical",
          "sources"
        ],
        "title": "MergeDataDefinitionRequest",
        "type": "object"
      },
      "UnmergeDataDefinitionResponse": {
        "properties": {
          "canonical": {
            "$ref": "#/components/schemas/DataDefinitionRef",
            "description": "The definition the sources unmerged from."
          },
          "sources": {
            "description": "The definitions unmerged from the canonical.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionRef"
            },
            "title": "Sources",
            "type": "array"
          }
        },
        "required": [
          "canonical",
          "sources"
        ],
        "title": "UnmergeDataDefinitionResponse",
        "type": "object"
      },
      "UnmergeDataDefinitionRequest": {
        "additionalProperties": false,
        "description": "Split ``sources`` back out of ``canonical``, all of one ``type``. Exactly one unmerge per\nrequest. Leave ``sources`` out to unmerge every definition merged into the canonical.",
        "properties": {
          "type": {
            "description": "The kind of definition to unmerge.",
            "enum": [
              "event",
              "event_property"
            ],
            "title": "Type",
            "type": "string"
          },
          "canonical": {
            "description": "Name of the definition the sources unmerge out of.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Canonical",
            "type": "string"
          },
          "sources": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 255,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Names of the definitions to unmerge out of the canonical. Omit to unmerge every definition merged into it.",
            "title": "Sources"
          }
        },
        "required": [
          "type",
          "canonical"
        ],
        "title": "UnmergeDataDefinitionRequest",
        "type": "object"
      },
      "DeleteDataDefinitionResponse": {
        "properties": {
          "entity": {
            "$ref": "#/components/schemas/DataDefinitionRef",
            "description": "The deleted definition."
          },
          "deleted_at": {
            "description": "When the definition was deleted.",
            "format": "date-time",
            "title": "Deleted At",
            "type": "string"
          }
        },
        "required": [
          "entity",
          "deleted_at"
        ],
        "title": "DeleteDataDefinitionResponse",
        "type": "object"
      },
      "CollectionOperation": {
        "enum": [
          "add",
          "set",
          "remove"
        ],
        "title": "CollectionOperation",
        "type": "string"
      },
      "DataDefinitionOwnerRef": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "$ref": "#/components/schemas/OwnerType",
            "description": "Whether the owner is a user or a team."
          },
          "id": {
            "description": "The owner's user or team ID.",
            "maxLength": 64,
            "minLength": 1,
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "DataDefinitionOwnerRef",
        "type": "object"
      },
      "DataDefinitionOwnersPatch": {
        "additionalProperties": false,
        "properties": {
          "operation": {
            "$ref": "#/components/schemas/CollectionOperation",
            "description": "Add the owners, replace the definition's owners with them, or remove them."
          },
          "values": {
            "description": "The owners.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionOwnerRef"
            },
            "title": "Values",
            "type": "array"
          }
        },
        "required": [
          "operation",
          "values"
        ],
        "title": "DataDefinitionOwnersPatch",
        "type": "object"
      },
      "DataDefinitionTagsPatch": {
        "additionalProperties": false,
        "properties": {
          "operation": {
            "$ref": "#/components/schemas/CollectionOperation",
            "description": "Add the tags, replace the definition's tags with them, or remove them."
          },
          "values": {
            "description": "Tag names. Tags that don't exist are created, except by remove.",
            "items": {
              "maxLength": 175,
              "minLength": 1,
              "type": "string"
            },
            "title": "Values",
            "type": "array"
          }
        },
        "required": [
          "operation",
          "values"
        ],
        "title": "DataDefinitionTagsPatch",
        "type": "object"
      },
      "PatchDataDefinitionRequest": {
        "additionalProperties": false,
        "description": "The fields to write on the definition. A field left out is unchanged.",
        "properties": {
          "name": {
            "description": "The definition's new name. Only custom events, custom properties, behaviors, metrics, and cohorts can be renamed.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The definition's description. `null` clears it.",
            "title": "Description"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name shown in the UI. `null` clears it.",
            "title": "Display Name"
          },
          "tags": {
            "$ref": "#/components/schemas/DataDefinitionTagsPatch",
            "description": "Change the definition's tags."
          },
          "owners": {
            "$ref": "#/components/schemas/DataDefinitionOwnersPatch",
            "description": "Change the definition's owners."
          },
          "hidden": {
            "description": "Hide or unhide the definition.",
            "title": "Hidden",
            "type": "boolean"
          },
          "blocked": {
            "description": "Block or unblock the definition. Blocking drops its incoming data at ingest.",
            "title": "Blocked",
            "type": "boolean"
          },
          "verified": {
            "description": "Verify the definition.",
            "title": "Verified",
            "type": "boolean"
          }
        },
        "title": "PatchDataDefinitionRequest",
        "type": "object"
      },
      "DataDefinitionTagResponse": {
        "properties": {
          "id": {
            "description": "The tag's ID.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The tag's name.",
            "title": "Name",
            "type": "string"
          },
          "entity_count": {
            "description": "The number of definitions carrying the tag.",
            "title": "Entity Count",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "entity_count"
        ],
        "title": "DataDefinitionTagResponse",
        "type": "object"
      },
      "ListDataDefinitionTagsResponse": {
        "description": "A page of a project's tags.",
        "properties": {
          "results": {
            "description": "List of items for the current page.",
            "items": {
              "$ref": "#/components/schemas/DataDefinitionTagResponse"
            },
            "title": "Results",
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPaginationResponse",
            "description": "Pagination cursors to navigate through the results."
          }
        },
        "required": [
          "results",
          "pagination"
        ],
        "title": "ListDataDefinitionTagsResponse",
        "type": "object"
      },
      "CreateDataDefinitionTagRequest": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "The tag's name. Unique within the project.",
            "maxLength": 175,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateDataDefinitionTagRequest",
        "type": "object"
      },
      "UpdateDataDefinitionTagRequest": {
        "additionalProperties": false,
        "description": "The fields to write on the tag. A field left out is unchanged.",
        "properties": {
          "name": {
            "description": "The tag's new name. Unique within the project.",
            "maxLength": 175,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "title": "UpdateDataDefinitionTagRequest",
        "type": "object"
      },
      "DeleteDataDefinitionTagResponse": {
        "properties": {
          "deleted_at": {
            "description": "When the tag was deleted.",
            "format": "date-time",
            "title": "Deleted At",
            "type": "string"
          }
        },
        "required": [
          "deleted_at"
        ],
        "title": "DeleteDataDefinitionTagResponse",
        "type": "object"
      },
      "QueryAuditLogRequest": {
        "additionalProperties": false,
        "description": "The set of filters to apply to the audit log query. All filters are optional, and if none are provided, all audit logs for the organization will be returned.",
        "properties": {
          "user_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter to audit logs by the IDs of the users who performed the actions.",
            "title": "User Ids"
          },
          "user_emails": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter to audit logs by the emails of the users who performed the actions.",
            "title": "User Emails"
          },
          "exclude_user_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "List of user IDs to exclude from the results. Audit logs performed by these users will not be included in the response.",
            "title": "Exclude User Ids"
          },
          "exclude_user_emails": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "List of user emails to exclude from the results. Audit logs performed by these users will not be included in the response.",
            "title": "Exclude User Emails"
          },
          "types": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "List of entity types and actions to filter audit logs by. See https://docs.mixpanel.com/docs/access-security/audit-log-reference for a list of valid types.",
            "title": "Types"
          },
          "created_before": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter to audit logs created before this timestamp.",
            "title": "Created Before"
          },
          "created_after": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter to audit logs created after this timestamp.",
            "title": "Created After"
          },
          "services": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter to audit logs that originated from these Mixpanel services, e.g. mcp, webapp.",
            "title": "Services"
          },
          "user_email_search": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Case-insensitive substring match against user email addresses.",
            "title": "User Email Search"
          },
          "project_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "List of Project IDs to filter audit logs by. If not provided, audit logs for all projects in the organization as well as organization-level audit logs will be returned.",
            "title": "Project Ids"
          }
        },
        "title": "QueryAuditLogRequest",
        "type": "object"
      },
      "ErrorResponse": {
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "A stable reference that identifies the problem type, if applicable.",
            "title": "Type"
          },
          "status": {
            "description": "The HTTP status code generated by the origin server for this occurrence of the problem.",
            "title": "Status",
            "type": "integer"
          },
          "instance": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "A stable reference that identifies the specific occurrence of the problem, if applicable.",
            "title": "Instance"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "A human-readable explanation specific to this occurrence of the problem, if applicable.",
            "title": "Detail"
          },
          "error_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Opaque identifier for this error occurrence. Include it when contacting support so the corresponding server-side error can be located.",
            "title": "Error Id"
          },
          "title": {
            "description": "A short, human-readable summary of the problem type.",
            "readOnly": true,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "status",
          "title"
        ],
        "title": "ErrorResponse",
        "type": "object"
      },
      "RequestValidationErrorItem": {
        "properties": {
          "type": {
            "description": "Machine-readable validation error type, e.g. 'missing'.",
            "title": "Type",
            "type": "string"
          },
          "loc": {
            "description": "Location of the offending value in the request.",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Loc",
            "type": "array"
          },
          "msg": {
            "description": "Human-readable description of the error.",
            "title": "Msg",
            "type": "string"
          },
          "ctx": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Additional context about the error, if any.",
            "title": "Ctx"
          }
        },
        "required": [
          "type",
          "loc",
          "msg"
        ],
        "title": "RequestValidationErrorItem",
        "type": "object"
      },
      "RequestValidationErrorResponse": {
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "A stable reference that identifies the problem type, if applicable.",
            "title": "Type"
          },
          "status": {
            "description": "The HTTP status code generated by the origin server for this occurrence of the problem.",
            "title": "Status",
            "type": "integer"
          },
          "instance": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "A stable reference that identifies the specific occurrence of the problem, if applicable.",
            "title": "Instance"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "A human-readable explanation specific to this occurrence of the problem, if applicable.",
            "title": "Detail"
          },
          "error_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Opaque identifier for this error occurrence. Include it when contacting support so the corresponding server-side error can be located.",
            "title": "Error Id"
          },
          "errors": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/RequestValidationErrorItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The set of request validation errors.",
            "title": "Errors"
          },
          "title": {
            "description": "A short, human-readable summary of the problem type.",
            "readOnly": true,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "status",
          "title"
        ],
        "title": "RequestValidationErrorResponse",
        "type": "object"
      }
    },
    "securitySchemes": {
      "ServiceAccountAuth": {
        "type": "http",
        "description": "This endpoint uses [Service Account](https://docs.mixpanel.com/reference/service-accounts#authenticating-with-a-service-account) authentication.",
        "scheme": "basic"
      }
    },
    "responses": {
      "RequestValidationError": {
        "description": "Request validation failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/RequestValidationErrorResponse"
            }
          }
        }
      },
      "Error": {
        "description": "Error response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "parameters": {
      "ProjectIdPathParameter": {
        "in": "path",
        "name": "project_id",
        "schema": {
          "title": "Project ID",
          "type": "string"
        },
        "required": true,
        "description": "The unique identifier for the project."
      },
      "WorkspaceIdPathParameter": {
        "in": "path",
        "name": "workspace_id",
        "schema": {
          "title": "Workspace ID",
          "type": "string"
        },
        "required": true,
        "description": "The unique identifier for the workspace."
      },
      "OrganizationIdPathParameter": {
        "in": "path",
        "name": "organization_id",
        "schema": {
          "title": "Organization ID",
          "type": "string"
        },
        "required": true,
        "description": "The unique identifier for the organization."
      },
      "MixpanelVersionHeader": {
        "in": "header",
        "name": "Mixpanel-Version",
        "required": false,
        "description": "Optional date-based API version pin.\n\nIf omitted, the request is served by the **latest** API version, and the caller accepts that a future release may introduce a breaking change to the response contract. If set to a supported version date, that version's contract is honored and will not receive a breaking change.",
        "schema": {
          "default": "2026-08-13",
          "type": "string",
          "title": "Mixpanel-Version"
        }
      },
      "IdempotencyKeyHeader": {
        "in": "header",
        "name": "Idempotency-Key",
        "required": false,
        "description": "Optional, client-provided key guaranteeing the operation is idempotent on success: if a request is replayed, the response includes `Idempotent-Replayed: true`.\n\nReusing a key with a different request body, or while a request with the same key is still in flight, returns a `409`.\n\nUse a unique, random value for each request (a UUID v4 works well).",
        "schema": {
          "type": "string",
          "maxLength": 255,
          "title": "Idempotency-Key"
        }
      }
    }
  }
}