From e51fe84cbeefd3944cbacd798e2165f9bab59329 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Thu, 9 Jan 2025 15:54:47 +0100 Subject: [PATCH] Rebuild schema --- frontend/src/queries/schema.json | 13733 ++++++++++++++++++++++++++++- posthog/schema.py | 7304 ++++++++++++++- 2 files changed, 21034 insertions(+), 3 deletions(-) diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json index fede3b603a1c1..738076b3a2be4 100644 --- a/frontend/src/queries/schema.json +++ b/frontend/src/queries/schema.json @@ -1,4 +1,13735 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": {} + "definitions": { + "ActionConversionGoal": { + "additionalProperties": false, + "properties": { + "actionId": { + "$ref": "#/definitions/integer" + } + }, + "required": ["actionId"], + "type": "object" + }, + "ActionsNode": { + "additionalProperties": false, + "properties": { + "custom_name": { + "type": "string" + }, + "fixedProperties": { + "description": "Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "id": { + "$ref": "#/definitions/integer" + }, + "kind": { + "const": "ActionsNode", + "type": "string" + }, + "math": { + "$ref": "#/definitions/MathType" + }, + "math_group_type_index": { + "enum": [0, 1, 2, 3, 4], + "type": "number" + }, + "math_hogql": { + "type": "string" + }, + "math_property": { + "type": "string" + }, + "math_property_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "properties": { + "description": "Properties configurable in the interface", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "response": { + "type": "object" + } + }, + "required": ["id", "kind"], + "type": "object" + }, + "ActorsPropertyTaxonomyQuery": { + "additionalProperties": false, + "properties": { + "group_type_index": { + "$ref": "#/definitions/integer" + }, + "kind": { + "const": "ActorsPropertyTaxonomyQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "property": { + "type": "string" + }, + "response": { + "$ref": "#/definitions/ActorsPropertyTaxonomyQueryResponse" + } + }, + "required": ["kind", "property"], + "type": "object" + }, + "ActorsPropertyTaxonomyQueryResponse": { + "additionalProperties": false, + "description": "All analytics query responses must inherit from this.", + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/ActorsPropertyTaxonomyResponse" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "ActorsPropertyTaxonomyResponse": { + "additionalProperties": false, + "properties": { + "sample_count": { + "$ref": "#/definitions/integer" + }, + "sample_values": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/integer" + } + ] + }, + "type": "array" + } + }, + "required": ["sample_values", "sample_count"], + "type": "object" + }, + "ActorsQuery": { + "additionalProperties": false, + "properties": { + "fixedProperties": { + "description": "Currently only person filters supported. No filters for querying groups. See `filter_conditions()` in actor_strategies.py.", + "items": { + "$ref": "#/definitions/AnyPersonScopeFilter" + }, + "type": "array" + }, + "kind": { + "const": "ActorsQuery", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "orderBy": { + "items": { + "type": "string" + }, + "type": "array" + }, + "properties": { + "description": "Currently only person filters supported. No filters for querying groups. See `filter_conditions()` in actor_strategies.py.", + "items": { + "$ref": "#/definitions/AnyPersonScopeFilter" + }, + "type": "array" + }, + "response": { + "$ref": "#/definitions/ActorsQueryResponse" + }, + "search": { + "type": "string" + }, + "select": { + "items": { + "$ref": "#/definitions/HogQLExpression" + }, + "type": "array" + }, + "source": { + "anyOf": [ + { + "$ref": "#/definitions/InsightActorsQuery" + }, + { + "$ref": "#/definitions/FunnelsActorsQuery" + }, + { + "$ref": "#/definitions/FunnelCorrelationActorsQuery" + }, + { + "$ref": "#/definitions/HogQLQuery" + } + ] + } + }, + "required": ["kind"], + "type": "object" + }, + "ActorsQueryResponse": { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "missing_actors_count": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["columns", "hogql", "limit", "offset", "results", "types"], + "type": "object" + }, + "AggregationAxisFormat": { + "enum": ["numeric", "duration", "duration_ms", "percentage", "percentage_scaled"], + "type": "string" + }, + "AlertCalculationInterval": { + "enum": ["hourly", "daily", "weekly", "monthly"], + "type": "string" + }, + "AlertCondition": { + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/definitions/AlertConditionType" + } + }, + "required": ["type"], + "type": "object" + }, + "AlertConditionType": { + "enum": ["absolute_value", "relative_increase", "relative_decrease"], + "type": "string" + }, + "AlertState": { + "enum": ["Firing", "Not firing", "Errored", "Snoozed"], + "type": "string" + }, + "AnyDataNode": { + "anyOf": [ + { + "$ref": "#/definitions/EventsNode" + }, + { + "$ref": "#/definitions/ActionsNode" + }, + { + "$ref": "#/definitions/PersonsNode" + }, + { + "$ref": "#/definitions/EventsQuery" + }, + { + "$ref": "#/definitions/ActorsQuery" + }, + { + "$ref": "#/definitions/InsightActorsQuery" + }, + { + "$ref": "#/definitions/InsightActorsQueryOptions" + }, + { + "$ref": "#/definitions/SessionsTimelineQuery" + }, + { + "$ref": "#/definitions/HogQuery" + }, + { + "$ref": "#/definitions/HogQLQuery" + }, + { + "$ref": "#/definitions/HogQLMetadata" + }, + { + "$ref": "#/definitions/HogQLAutocomplete" + }, + { + "$ref": "#/definitions/WebOverviewQuery" + }, + { + "$ref": "#/definitions/WebStatsTableQuery" + }, + { + "$ref": "#/definitions/WebExternalClicksTableQuery" + }, + { + "$ref": "#/definitions/WebGoalsQuery" + }, + { + "$ref": "#/definitions/SessionAttributionExplorerQuery" + }, + { + "$ref": "#/definitions/ErrorTrackingQuery" + }, + { + "$ref": "#/definitions/ExperimentFunnelsQuery" + }, + { + "$ref": "#/definitions/ExperimentTrendsQuery" + }, + { + "$ref": "#/definitions/RecordingsQuery" + } + ] + }, + "AnyEntityNode": { + "anyOf": [ + { + "$ref": "#/definitions/EventsNode" + }, + { + "$ref": "#/definitions/ActionsNode" + }, + { + "$ref": "#/definitions/DataWarehouseNode" + } + ] + }, + "AnyFilterLike": { + "anyOf": [ + { + "$ref": "#/definitions/AnyPropertyFilter" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + }, + { + "$ref": "#/definitions/PropertyGroupFilterValue" + } + ] + }, + "AnyPersonScopeFilter": { + "anyOf": [ + { + "$ref": "#/definitions/PersonPropertyFilter" + }, + { + "$ref": "#/definitions/CohortPropertyFilter" + }, + { + "$ref": "#/definitions/HogQLPropertyFilter" + }, + { + "$ref": "#/definitions/EmptyPropertyFilter" + } + ], + "description": "Any filter type supported by `property_to_expr(scope=\"person\", ...)`." + }, + "AnyPropertyFilter": { + "anyOf": [ + { + "$ref": "#/definitions/EventPropertyFilter" + }, + { + "$ref": "#/definitions/PersonPropertyFilter" + }, + { + "$ref": "#/definitions/ElementPropertyFilter" + }, + { + "$ref": "#/definitions/SessionPropertyFilter" + }, + { + "$ref": "#/definitions/CohortPropertyFilter" + }, + { + "$ref": "#/definitions/RecordingPropertyFilter" + }, + { + "$ref": "#/definitions/LogEntryPropertyFilter" + }, + { + "$ref": "#/definitions/GroupPropertyFilter" + }, + { + "$ref": "#/definitions/FeaturePropertyFilter" + }, + { + "$ref": "#/definitions/HogQLPropertyFilter" + }, + { + "$ref": "#/definitions/EmptyPropertyFilter" + }, + { + "$ref": "#/definitions/DataWarehousePropertyFilter" + }, + { + "$ref": "#/definitions/DataWarehousePersonPropertyFilter" + } + ] + }, + "AnyResponseType": { + "anyOf": [ + { + "type": "object" + }, + { + "$ref": "#/definitions/HogQueryResponse" + }, + { + "$ref": "#/definitions/HogQLQueryResponse" + }, + { + "$ref": "#/definitions/HogQLMetadataResponse" + }, + { + "$ref": "#/definitions/HogQLAutocompleteResponse" + }, + { + "type": "object" + }, + { + "not": {} + }, + { + "$ref": "#/definitions/EventsQueryResponse" + }, + { + "$ref": "#/definitions/ErrorTrackingQueryResponse" + } + ] + }, + "AssistantArrayPropertyFilter": { + "additionalProperties": false, + "properties": { + "operator": { + "$ref": "#/definitions/AssistantArrayPropertyFilterOperator", + "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values." + }, + "value": { + "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["operator", "value"], + "type": "object" + }, + "AssistantArrayPropertyFilterOperator": { + "enum": ["exact", "is_not"], + "type": "string" + }, + "AssistantBaseMultipleBreakdownFilter": { + "additionalProperties": false, + "properties": { + "property": { + "description": "Property name from the plan to break down by.", + "type": "string" + } + }, + "required": ["property"], + "type": "object" + }, + "AssistantBasePropertyFilter": { + "anyOf": [ + { + "$ref": "#/definitions/AssistantStringNumberOrBooleanPropertyFilter" + }, + { + "$ref": "#/definitions/AssistantDateTimePropertyFilter" + }, + { + "$ref": "#/definitions/AssistantSetPropertyFilter" + } + ] + }, + "AssistantBreakdownFilter": { + "additionalProperties": false, + "properties": { + "breakdown_limit": { + "$ref": "#/definitions/integer", + "default": 25, + "description": "How many distinct values to show." + } + }, + "type": "object" + }, + "AssistantDateTimePropertyFilter": { + "additionalProperties": false, + "properties": { + "operator": { + "$ref": "#/definitions/AssistantDateTimePropertyFilterOperator" + }, + "value": { + "description": "Value must be a date in ISO 8601 format.", + "type": "string" + } + }, + "required": ["operator", "value"], + "type": "object" + }, + "AssistantDateTimePropertyFilterOperator": { + "enum": ["is_date_exact", "is_date_before", "is_date_after"], + "type": "string" + }, + "AssistantEventMultipleBreakdownFilterType": { + "enum": ["person", "event", "session", "hogql"], + "type": "string" + }, + "AssistantEventType": { + "enum": ["status", "message", "conversation"], + "type": "string" + }, + "AssistantFunnelsBreakdownFilter": { + "additionalProperties": false, + "properties": { + "breakdown": { + "description": "The entity property to break down by.", + "type": "string" + }, + "breakdown_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "If `breakdown_type` is `group`, this is the index of the group. Use the index from the group mapping." + }, + "breakdown_limit": { + "$ref": "#/definitions/integer", + "default": 25, + "description": "How many distinct values to show." + }, + "breakdown_type": { + "$ref": "#/definitions/AssistantFunnelsBreakdownType", + "default": "event", + "description": "Type of the entity to break down by. If `group` is used, you must also provide `breakdown_group_type_index` from the group mapping." + } + }, + "required": ["breakdown_type", "breakdown"], + "type": "object" + }, + "AssistantFunnelsBreakdownType": { + "enum": ["person", "event", "group", "session"], + "type": "string" + }, + "AssistantFunnelsEventsNode": { + "additionalProperties": false, + "properties": { + "custom_name": { + "description": "Optional custom name for the event if it is needed to be renamed.", + "type": "string" + }, + "event": { + "description": "Name of the event.", + "type": "string" + }, + "kind": { + "const": "EventsNode", + "type": "string" + }, + "math": { + "$ref": "#/definitions/AssistantTrendsMath", + "description": "Optional math aggregation type for the series. Only specify this math type if the user wants one of these. `first_time_for_user` - counts the number of users who have completed the event for the first time ever. `first_time_for_user_with_filters` - counts the number of users who have completed the event with specified filters for the first time." + }, + "properties": { + "items": { + "$ref": "#/definitions/AssistantPropertyFilter" + }, + "type": "array" + }, + "response": { + "type": "object" + } + }, + "required": ["event", "kind"], + "type": "object" + }, + "AssistantFunnelsExclusionEventsNode": { + "additionalProperties": false, + "description": "Exclustion steps for funnels. The \"from\" and \"to\" steps must not exceed the funnel's series length.", + "properties": { + "event": { + "type": "string" + }, + "funnelFromStep": { + "$ref": "#/definitions/integer" + }, + "funnelToStep": { + "$ref": "#/definitions/integer" + }, + "kind": { + "const": "EventsNode", + "type": "string" + } + }, + "required": ["event", "funnelFromStep", "funnelToStep", "kind"], + "type": "object" + }, + "AssistantFunnelsFilter": { + "additionalProperties": false, + "properties": { + "binCount": { + "description": "Use this setting only when `funnelVizType` is `time_to_convert`: number of bins to show in histogram.", + "type": "integer" + }, + "exclusions": { + "default": [], + "description": "Users may want to use exclusion events to filter out conversions in which a particular event occurred between specific steps. These events must not be included in the main sequence. You must include start and end indexes for each exclusion where the minimum index is one and the maximum index is the number of steps in the funnel. For example, there is a sequence with three steps: sign up, finish onboarding, purchase. If the user wants to exclude all conversions in which users left the page before finishing the onboarding, the exclusion step would be the event `$pageleave` with start index 2 and end index 3.", + "items": { + "$ref": "#/definitions/AssistantFunnelsExclusionEventsNode" + }, + "type": "array" + }, + "funnelAggregateByHogQL": { + "const": "properties.$session_id", + "description": "Use this field only if the user explicitly asks to aggregate the funnel by unique sessions.", + "type": "string" + }, + "funnelOrderType": { + "$ref": "#/definitions/StepOrderValue", + "default": "ordered", + "description": "Defines the behavior of event matching between steps. Prefer the `strict` option unless explicitly told to use a different one. `ordered` - defines a sequential funnel. Step B must happen after Step A, but any number of events can happen between A and B. `strict` - defines a funnel where all events must happen in order. Step B must happen directly after Step A without any events in between. `any` - order doesn't matter. Steps can be completed in any sequence." + }, + "funnelStepReference": { + "$ref": "#/definitions/FunnelStepReference", + "default": "total", + "description": "Whether conversion shown in the graph should be across all steps or just relative to the previous step." + }, + "funnelVizType": { + "$ref": "#/definitions/FunnelVizType", + "default": "steps", + "description": "Defines the type of visualization to use. The `steps` option is recommended. `steps` - shows a step-by-step funnel. Perfect to show a conversion rate of a sequence of events (default). `time_to_convert` - shows a histogram of the time it took to complete the funnel. Use this if the user asks about the average time it takes to complete the funnel. `trends` - shows a trend of the whole sequence's conversion rate over time. Use this if the user wants to see how the conversion rate changes over time." + }, + "funnelWindowInterval": { + "$ref": "#/definitions/integer", + "default": 14, + "description": "Controls a time frame value for a conversion to be considered. Select a reasonable value based on the user's query. Use in combination with `funnelWindowIntervalUnit`. The default value is 14 days." + }, + "funnelWindowIntervalUnit": { + "$ref": "#/definitions/FunnelConversionWindowTimeUnit", + "default": "day", + "description": "Controls a time frame interval for a conversion to be considered. Select a reasonable value based on the user's query. Use in combination with `funnelWindowInterval`. The default value is 14 days." + }, + "layout": { + "$ref": "#/definitions/FunnelLayout", + "default": "vertical", + "description": "Controls how the funnel chart is displayed: vertically (preferred) or horizontally." + } + }, + "type": "object" + }, + "AssistantFunnelsQuery": { + "additionalProperties": false, + "properties": { + "aggregation_group_type_index": { + "$ref": "#/definitions/integer", + "description": "Use this field to define the aggregation by a specific group from the group mapping that the user has provided." + }, + "breakdownFilter": { + "$ref": "#/definitions/AssistantFunnelsBreakdownFilter", + "description": "Breakdown the chart by a property" + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "funnelsFilter": { + "$ref": "#/definitions/AssistantFunnelsFilter", + "description": "Properties specific to the funnels insight" + }, + "interval": { + "$ref": "#/definitions/IntervalType", + "description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`" + }, + "kind": { + "const": "FunnelsQuery", + "type": "string" + }, + "properties": { + "default": [], + "description": "Property filters for all series", + "items": { + "$ref": "#/definitions/AssistantPropertyFilter" + }, + "type": "array" + }, + "samplingFactor": { + "description": "Sampling rate from 0 to 1 where 1 is 100% of the data.", + "type": ["number", "null"] + }, + "series": { + "description": "Events to include", + "items": { + "$ref": "#/definitions/AssistantFunnelsEventsNode" + }, + "type": "array" + } + }, + "required": ["kind", "series"], + "type": "object" + }, + "AssistantGenerationStatusEvent": { + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/definitions/AssistantGenerationStatusType" + } + }, + "required": ["type"], + "type": "object" + }, + "AssistantGenerationStatusType": { + "enum": ["ack", "generation_error"], + "type": "string" + }, + "AssistantGenericMultipleBreakdownFilter": { + "additionalProperties": false, + "properties": { + "property": { + "description": "Property name from the plan to break down by.", + "type": "string" + }, + "type": { + "$ref": "#/definitions/AssistantEventMultipleBreakdownFilterType" + } + }, + "required": ["property", "type"], + "type": "object" + }, + "AssistantGenericPropertyFilter": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "key": { + "description": "Use one of the properties the user has provided in the plan.", + "type": "string" + }, + "operator": { + "$ref": "#/definitions/AssistantSingleValuePropertyFilterOperator", + "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern." + }, + "type": { + "anyOf": [ + { + "const": "event", + "description": "Event properties", + "type": "string" + }, + { + "const": "person", + "description": "Person properties", + "type": "string" + }, + { + "const": "session", + "type": "string" + }, + { + "const": "feature", + "description": "Event property with \"$feature/\" prepended", + "type": "string" + } + ] + }, + "value": { + "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value.", + "type": "string" + } + }, + "required": ["key", "operator", "type", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "key": { + "description": "Use one of the properties the user has provided in the plan.", + "type": "string" + }, + "operator": { + "$ref": "#/definitions/AssistantArrayPropertyFilterOperator", + "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values." + }, + "type": { + "anyOf": [ + { + "const": "event", + "description": "Event properties", + "type": "string" + }, + { + "const": "person", + "description": "Person properties", + "type": "string" + }, + { + "const": "session", + "type": "string" + }, + { + "const": "feature", + "description": "Event property with \"$feature/\" prepended", + "type": "string" + } + ] + }, + "value": { + "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["key", "operator", "type", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "key": { + "description": "Use one of the properties the user has provided in the plan.", + "type": "string" + }, + "operator": { + "$ref": "#/definitions/AssistantDateTimePropertyFilterOperator" + }, + "type": { + "anyOf": [ + { + "const": "event", + "description": "Event properties", + "type": "string" + }, + { + "const": "person", + "description": "Person properties", + "type": "string" + }, + { + "const": "session", + "type": "string" + }, + { + "const": "feature", + "description": "Event property with \"$feature/\" prepended", + "type": "string" + } + ] + }, + "value": { + "description": "Value must be a date in ISO 8601 format.", + "type": "string" + } + }, + "required": ["key", "operator", "type", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "key": { + "description": "Use one of the properties the user has provided in the plan.", + "type": "string" + }, + "operator": { + "$ref": "#/definitions/AssistantSetPropertyFilterOperator", + "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected." + }, + "type": { + "anyOf": [ + { + "const": "event", + "description": "Event properties", + "type": "string" + }, + { + "const": "person", + "description": "Person properties", + "type": "string" + }, + { + "const": "session", + "type": "string" + }, + { + "const": "feature", + "description": "Event property with \"$feature/\" prepended", + "type": "string" + } + ] + } + }, + "required": ["key", "operator", "type"], + "type": "object" + } + ] + }, + "AssistantGroupMultipleBreakdownFilter": { + "additionalProperties": false, + "properties": { + "group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Index of the group type from the group mapping." + }, + "property": { + "description": "Property name from the plan to break down by.", + "type": "string" + }, + "type": { + "const": "group", + "type": "string" + } + }, + "required": ["property", "type"], + "type": "object" + }, + "AssistantGroupPropertyFilter": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "group_type_index": { + "$ref": "#/definitions/integer", + "description": "Index of the group type from the group mapping." + }, + "key": { + "description": "Use one of the properties the user has provided in the plan.", + "type": "string" + }, + "operator": { + "$ref": "#/definitions/AssistantSingleValuePropertyFilterOperator", + "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern." + }, + "type": { + "const": "group", + "type": "string" + }, + "value": { + "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value.", + "type": "string" + } + }, + "required": ["group_type_index", "key", "operator", "type", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "group_type_index": { + "$ref": "#/definitions/integer", + "description": "Index of the group type from the group mapping." + }, + "key": { + "description": "Use one of the properties the user has provided in the plan.", + "type": "string" + }, + "operator": { + "$ref": "#/definitions/AssistantArrayPropertyFilterOperator", + "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values." + }, + "type": { + "const": "group", + "type": "string" + }, + "value": { + "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["group_type_index", "key", "operator", "type", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "group_type_index": { + "$ref": "#/definitions/integer", + "description": "Index of the group type from the group mapping." + }, + "key": { + "description": "Use one of the properties the user has provided in the plan.", + "type": "string" + }, + "operator": { + "$ref": "#/definitions/AssistantDateTimePropertyFilterOperator" + }, + "type": { + "const": "group", + "type": "string" + }, + "value": { + "description": "Value must be a date in ISO 8601 format.", + "type": "string" + } + }, + "required": ["group_type_index", "key", "operator", "type", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "group_type_index": { + "$ref": "#/definitions/integer", + "description": "Index of the group type from the group mapping." + }, + "key": { + "description": "Use one of the properties the user has provided in the plan.", + "type": "string" + }, + "operator": { + "$ref": "#/definitions/AssistantSetPropertyFilterOperator", + "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected." + }, + "type": { + "const": "group", + "type": "string" + } + }, + "required": ["group_type_index", "key", "operator", "type"], + "type": "object" + } + ] + }, + "AssistantInsightsQueryBase": { + "additionalProperties": false, + "properties": { + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "properties": { + "default": [], + "description": "Property filters for all series", + "items": { + "$ref": "#/definitions/AssistantPropertyFilter" + }, + "type": "array" + }, + "samplingFactor": { + "description": "Sampling rate from 0 to 1 where 1 is 100% of the data.", + "type": ["number", "null"] + } + }, + "type": "object" + }, + "AssistantMessage": { + "additionalProperties": false, + "properties": { + "content": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "const": "ai", + "type": "string" + } + }, + "required": ["type", "content"], + "type": "object" + }, + "AssistantMessageType": { + "enum": ["human", "ai", "ai/reasoning", "ai/viz", "ai/failure", "ai/router"], + "type": "string" + }, + "AssistantMultipleBreakdownFilter": { + "anyOf": [ + { + "$ref": "#/definitions/AssistantGroupMultipleBreakdownFilter" + }, + { + "$ref": "#/definitions/AssistantGenericMultipleBreakdownFilter" + } + ] + }, + "AssistantPropertyFilter": { + "anyOf": [ + { + "$ref": "#/definitions/AssistantGenericPropertyFilter" + }, + { + "$ref": "#/definitions/AssistantGroupPropertyFilter" + } + ] + }, + "AssistantRetentionFilter": { + "additionalProperties": false, + "properties": { + "cumulative": { + "description": "Whether retention should be rolling (aka unbounded, cumulative). Rolling retention means that a user coming back in period 5 makes them count towards all the previous periods.", + "type": "boolean" + }, + "period": { + "$ref": "#/definitions/RetentionPeriod", + "default": "Day", + "description": "Retention period, the interval to track cohorts by." + }, + "retentionReference": { + "description": "Whether retention is with regard to initial cohort size, or that of the previous period.", + "enum": ["total", "previous"], + "type": "string" + }, + "retentionType": { + "$ref": "#/definitions/RetentionType", + "description": "Retention type: recurring or first time. Recurring retention counts a user as part of a cohort if they performed the cohort event during that time period, irrespective of it was their first time or not. First time retention only counts a user as part of the cohort if it was their first time performing the cohort event." + }, + "returningEntity": { + "$ref": "#/definitions/RetentionEntity", + "description": "Retention event (event marking the user coming back)." + }, + "showMean": { + "description": "Whether an additional series should be shown, showing the mean conversion for each period across cohorts.", + "type": "boolean" + }, + "targetEntity": { + "$ref": "#/definitions/RetentionEntity", + "description": "Activation event (event putting the actor into the initial cohort)." + }, + "totalIntervals": { + "$ref": "#/definitions/integer", + "default": 11, + "description": "How many intervals to show in the chart. The default value is 11 (meaning 10 periods after initial cohort)." + } + }, + "type": "object" + }, + "AssistantRetentionQuery": { + "additionalProperties": false, + "properties": { + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "kind": { + "const": "RetentionQuery", + "type": "string" + }, + "properties": { + "default": [], + "description": "Property filters for all series", + "items": { + "$ref": "#/definitions/AssistantPropertyFilter" + }, + "type": "array" + }, + "retentionFilter": { + "$ref": "#/definitions/AssistantRetentionFilter", + "description": "Properties specific to the retention insight" + }, + "samplingFactor": { + "description": "Sampling rate from 0 to 1 where 1 is 100% of the data.", + "type": ["number", "null"] + } + }, + "required": ["kind", "retentionFilter"], + "type": "object" + }, + "AssistantSetPropertyFilter": { + "additionalProperties": false, + "properties": { + "operator": { + "$ref": "#/definitions/AssistantSetPropertyFilterOperator", + "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected." + } + }, + "required": ["operator"], + "type": "object" + }, + "AssistantSetPropertyFilterOperator": { + "enum": ["is_set", "is_not_set"], + "type": "string" + }, + "AssistantSingleValuePropertyFilter": { + "additionalProperties": false, + "properties": { + "operator": { + "$ref": "#/definitions/AssistantSingleValuePropertyFilterOperator", + "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern." + }, + "value": { + "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value.", + "type": "string" + } + }, + "required": ["operator", "value"], + "type": "object" + }, + "AssistantSingleValuePropertyFilterOperator": { + "enum": ["exact", "is_not", "icontains", "not_icontains", "regex", "not_regex"], + "type": "string" + }, + "AssistantStringNumberOrBooleanPropertyFilter": { + "anyOf": [ + { + "$ref": "#/definitions/AssistantSingleValuePropertyFilter" + }, + { + "$ref": "#/definitions/AssistantArrayPropertyFilter" + } + ] + }, + "AssistantTrendsBreakdownFilter": { + "additionalProperties": false, + "properties": { + "breakdown_limit": { + "$ref": "#/definitions/integer", + "default": 25, + "description": "How many distinct values to show." + }, + "breakdowns": { + "description": "Use this field to define breakdowns.", + "items": { + "$ref": "#/definitions/AssistantMultipleBreakdownFilter" + }, + "maxLength": 3, + "type": "array" + } + }, + "required": ["breakdowns"], + "type": "object" + }, + "AssistantTrendsDisplayType": { + "anyOf": [ + { + "const": "ActionsLineGraph", + "type": "string" + }, + { + "const": "ActionsBar", + "type": "string" + }, + { + "const": "ActionsAreaGraph", + "type": "string" + }, + { + "const": "ActionsLineGraphCumulative", + "type": "string" + }, + { + "const": "BoldNumber", + "type": "string" + }, + { + "const": "ActionsPie", + "type": "string" + }, + { + "const": "ActionsBarValue", + "type": "string" + }, + { + "const": "ActionsTable", + "type": "string" + }, + { + "const": "WorldMap", + "type": "string" + }, + { + "not": {} + } + ] + }, + "AssistantTrendsEventsNode": { + "additionalProperties": false, + "properties": { + "custom_name": { + "type": "string" + }, + "event": { + "description": "The event or `null` for all events.", + "type": ["string", "null"] + }, + "kind": { + "const": "EventsNode", + "type": "string" + }, + "math": { + "$ref": "#/definitions/MathType" + }, + "math_group_type_index": { + "enum": [0, 1, 2, 3, 4], + "type": "number" + }, + "math_property": { + "type": "string" + }, + "math_property_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "orderBy": { + "description": "Columns to order by", + "items": { + "type": "string" + }, + "type": "array" + }, + "properties": { + "items": { + "$ref": "#/definitions/AssistantPropertyFilter" + }, + "type": "array" + }, + "response": { + "type": "object" + } + }, + "required": ["kind"], + "type": "object" + }, + "AssistantTrendsFilter": { + "additionalProperties": false, + "properties": { + "aggregationAxisFormat": { + "$ref": "#/definitions/AggregationAxisFormat", + "default": "numeric", + "description": "Formats the trends value axis. Do not use the formatting unless you are absolutely sure that formatting will match the data. `numeric` - no formatting. Prefer this option by default. `duration` - formats the value in seconds to a human-readable duration, e.g., `132` becomes `2 minutes 12 seconds`. Use this option only if you are sure that the values are in seconds. `duration_ms` - formats the value in miliseconds to a human-readable duration, e.g., `1050` becomes `1 second 50 milliseconds`. Use this option only if you are sure that the values are in miliseconds. `percentage` - adds a percentage sign to the value, e.g., `50` becomes `50%`. `percentage_scaled` - formats the value as a percentage scaled to 0-100, e.g., `0.5` becomes `50%`." + }, + "aggregationAxisPostfix": { + "description": "Custom postfix to add to the aggregation axis, e.g., ` clicks` to format 5 as `5 clicks`. You may need to add a space before postfix.", + "type": "string" + }, + "aggregationAxisPrefix": { + "description": "Custom prefix to add to the aggregation axis, e.g., `$` for USD dollars. You may need to add a space after prefix.", + "type": "string" + }, + "decimalPlaces": { + "description": "Number of decimal places to show. Do not add this unless you are sure that values will have a decimal point.", + "type": "number" + }, + "display": { + "default": "ActionsLineGraph", + "description": "Visualization type. Available values: `ActionsLineGraph` - time-series line chart; most common option, as it shows change over time. `ActionsBar` - time-series bar chart. `ActionsAreaGraph` - time-series area chart. `ActionsLineGraphCumulative` - cumulative time-series line chart; good for cumulative metrics. `BoldNumber` - total value single large number. You can't use this with breakdown; use when user explicitly asks for a single output number. `ActionsBarValue` - total value (NOT time-series) bar chart; good for categorical data. `ActionsPie` - total value pie chart; good for visualizing proportions. `ActionsTable` - total value table; good when using breakdown to list users or other entities. `WorldMap` - total value world map; use when breaking down by country name using property `$geoip_country_name`, and only then.", + "enum": [ + "ActionsLineGraph", + "ActionsBar", + "ActionsAreaGraph", + "ActionsLineGraphCumulative", + "BoldNumber", + "ActionsPie", + "ActionsBarValue", + "ActionsTable", + "WorldMap" + ], + "type": "string" + }, + "formula": { + "description": "If the formula is provided, apply it here.", + "type": "string" + }, + "showLegend": { + "default": false, + "description": "Whether to show the legend describing series and breakdowns.", + "type": "boolean" + }, + "showPercentStackView": { + "default": false, + "description": "Whether to show a percentage of each series. Use only with", + "type": "boolean" + }, + "showValuesOnSeries": { + "default": false, + "description": "Whether to show a value on each data point.", + "type": "boolean" + }, + "yAxisScaleType": { + "default": "linear", + "description": "Whether to scale the y-axis.", + "enum": ["log10", "linear"], + "type": "string" + } + }, + "type": "object" + }, + "AssistantTrendsMath": { + "enum": ["first_time_for_user", "first_time_for_user_with_filters"], + "type": "string" + }, + "AssistantTrendsQuery": { + "additionalProperties": false, + "properties": { + "breakdownFilter": { + "$ref": "#/definitions/AssistantTrendsBreakdownFilter", + "description": "Breakdown of the events" + }, + "compareFilter": { + "$ref": "#/definitions/CompareFilter", + "description": "Compare to date range" + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "interval": { + "$ref": "#/definitions/IntervalType", + "default": "day", + "description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`" + }, + "kind": { + "const": "TrendsQuery", + "type": "string" + }, + "properties": { + "default": [], + "description": "Property filters for all series", + "items": { + "$ref": "#/definitions/AssistantPropertyFilter" + }, + "type": "array" + }, + "samplingFactor": { + "description": "Sampling rate from 0 to 1 where 1 is 100% of the data.", + "type": ["number", "null"] + }, + "series": { + "description": "Events to include", + "items": { + "$ref": "#/definitions/AssistantTrendsEventsNode" + }, + "type": "array" + }, + "trendsFilter": { + "$ref": "#/definitions/AssistantTrendsFilter", + "description": "Properties specific to the trends insight" + } + }, + "required": ["kind", "series"], + "type": "object" + }, + "AutocompleteCompletionItem": { + "additionalProperties": false, + "properties": { + "detail": { + "description": "A human-readable string with additional information about this item, like type or symbol information.", + "type": "string" + }, + "documentation": { + "description": "A human-readable string that represents a doc-comment.", + "type": "string" + }, + "insertText": { + "description": "A string or snippet that should be inserted in a document when selecting this completion.", + "type": "string" + }, + "kind": { + "$ref": "#/definitions/AutocompleteCompletionItemKind", + "description": "The kind of this completion item. Based on the kind an icon is chosen by the editor." + }, + "label": { + "description": "The label of this completion item. By default this is also the text that is inserted when selecting this completion.", + "type": "string" + } + }, + "required": ["label", "insertText", "kind"], + "type": "object" + }, + "AutocompleteCompletionItemKind": { + "enum": [ + "Method", + "Function", + "Constructor", + "Field", + "Variable", + "Class", + "Struct", + "Interface", + "Module", + "Property", + "Event", + "Operator", + "Unit", + "Value", + "Constant", + "Enum", + "EnumMember", + "Keyword", + "Text", + "Color", + "File", + "Reference", + "Customcolor", + "Folder", + "TypeParameter", + "User", + "Issue", + "Snippet" + ], + "type": "string" + }, + "BaseAssistantMessage": { + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + } + }, + "type": "object" + }, + "BaseMathType": { + "enum": [ + "total", + "dau", + "weekly_active", + "monthly_active", + "unique_session", + "first_time_for_user", + "first_matching_event_for_user" + ], + "type": "string" + }, + "BinCountValue": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "auto", + "type": "string" + } + ] + }, + "Breakdown": { + "additionalProperties": false, + "properties": { + "group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ] + }, + "histogram_bin_count": { + "$ref": "#/definitions/integer" + }, + "normalize_url": { + "type": "boolean" + }, + "property": { + "type": "string" + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/MultipleBreakdownType" + }, + { + "type": "null" + } + ] + } + }, + "required": ["property"], + "type": "object" + }, + "BreakdownAttributionType": { + "enum": ["first_touch", "last_touch", "all_events", "step"], + "type": "string" + }, + "BreakdownFilter": { + "additionalProperties": false, + "properties": { + "breakdown": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/integer" + }, + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/integer" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "breakdown_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ] + }, + "breakdown_hide_other_aggregation": { + "type": ["boolean", "null"] + }, + "breakdown_histogram_bin_count": { + "$ref": "#/definitions/integer" + }, + "breakdown_limit": { + "$ref": "#/definitions/integer" + }, + "breakdown_normalize_url": { + "type": "boolean" + }, + "breakdown_type": { + "anyOf": [ + { + "$ref": "#/definitions/BreakdownType" + }, + { + "type": "null" + } + ], + "default": "event" + }, + "breakdowns": { + "items": { + "$ref": "#/definitions/Breakdown" + }, + "maxLength": 3, + "type": "array" + } + }, + "type": "object" + }, + "BreakdownItem": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/BreakdownValueInt" + } + ] + } + }, + "required": ["label", "value"], + "type": "object" + }, + "BreakdownKeyType": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "BreakdownType": { + "enum": [ + "cohort", + "person", + "event", + "group", + "session", + "hogql", + "data_warehouse", + "data_warehouse_person_property" + ], + "type": "string" + }, + "BreakdownValueInt": { + "$ref": "#/definitions/integer" + }, + "CacheMissResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": ["string", "null"] + }, + "query_status": { + "$ref": "#/definitions/QueryStatus" + } + }, + "required": ["cache_key"], + "type": "object" + }, + "CachedActorsPropertyTaxonomyQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/ActorsPropertyTaxonomyResponse" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedActorsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "missing_actors_count": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "columns", + "hogql", + "is_cached", + "last_refresh", + "limit", + "next_allowed_client_refresh", + "offset", + "results", + "timezone", + "types" + ], + "type": "object" + }, + "CachedErrorTrackingQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "columns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/ErrorTrackingIssue" + }, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedEventTaxonomyQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/EventTaxonomyResponse" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedEventsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "columns", + "hogql", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone", + "types" + ], + "type": "object" + }, + "CachedExperimentFunnelsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "expected_loss": { + "type": "number" + }, + "funnels_query": { + "$ref": "#/definitions/FunnelsQuery" + }, + "insight": { + "items": { + "items": { + "type": "object" + }, + "type": "array" + }, + "type": "array" + }, + "is_cached": { + "type": "boolean" + }, + "kind": { + "const": "ExperimentFunnelsQuery", + "type": "string" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "timezone": { + "type": "string" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantFunnelsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "credible_intervals", + "expected_loss", + "insight", + "is_cached", + "kind", + "last_refresh", + "next_allowed_client_refresh", + "probability", + "significance_code", + "significant", + "timezone", + "variants" + ], + "type": "object" + }, + "CachedExperimentTrendsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "count_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "exposure_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "insight": { + "items": { + "type": "object" + }, + "type": "array" + }, + "is_cached": { + "type": "boolean" + }, + "kind": { + "const": "ExperimentTrendsQuery", + "type": "string" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "p_value": { + "type": "number" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "timezone": { + "type": "string" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantTrendsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "credible_intervals", + "insight", + "is_cached", + "kind", + "last_refresh", + "next_allowed_client_refresh", + "p_value", + "probability", + "significance_code", + "significant", + "timezone", + "variants" + ], + "type": "object" + }, + "CachedFunnelCorrelationResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/FunnelCorrelationResult" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedFunnelsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "isUdf": { + "type": "boolean" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "anyOf": [ + { + "$ref": "#/definitions/FunnelStepsResults" + }, + { + "$ref": "#/definitions/FunnelStepsBreakdownResults" + }, + { + "$ref": "#/definitions/FunnelTimeToConvertResults" + }, + { + "$ref": "#/definitions/FunnelTrendsResults" + } + ] + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedHogQLQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "clickhouse": { + "description": "Executed ClickHouse query", + "type": "string" + }, + "columns": { + "description": "Returned columns", + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "explain": { + "description": "Query explanation output", + "items": { + "type": "string" + }, + "type": "array" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "metadata": { + "$ref": "#/definitions/HogQLMetadataResponse", + "description": "Query metadata output" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query": { + "description": "Input query string", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "description": "Types of returned columns", + "items": {}, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedInsightActorsQueryOptionsResponse": { + "additionalProperties": false, + "properties": { + "breakdown": { + "items": { + "$ref": "#/definitions/BreakdownItem" + }, + "type": "array" + }, + "breakdowns": { + "items": { + "$ref": "#/definitions/MultipleBreakdownOptions" + }, + "type": "array" + }, + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "compare": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "day": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/DatetimeDay" + }, + { + "$ref": "#/definitions/Day" + } + ] + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "interval": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/integer", + "description": "An interval selected out of available intervals in source query" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "series": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/integer" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "status": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "timezone": { + "type": "string" + } + }, + "required": ["cache_key", "is_cached", "last_refresh", "next_allowed_client_refresh", "timezone"], + "type": "object" + }, + "CachedLifecycleQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedPathsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedRetentionQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/RetentionResult" + }, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedSessionAttributionExplorerQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": {}, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedSessionsTimelineQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/TimelineEntry" + }, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedStickinessQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedSuggestedQuestionsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "questions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timezone": { + "type": "string" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "questions", + "timezone" + ], + "type": "object" + }, + "CachedTeamTaxonomyQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/TeamTaxonomyResponse" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedTrendsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "description": "Wether more breakdown values are available.", + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedWebExternalClicksTableQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedWebGoalsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedWebOverviewQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "dateFrom": { + "type": "string" + }, + "dateTo": { + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/WebOverviewItem" + }, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "CachedWebStatsTableQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "ChartAxis": { + "additionalProperties": false, + "properties": { + "column": { + "type": "string" + }, + "settings": { + "additionalProperties": false, + "properties": { + "display": { + "$ref": "#/definitions/ChartSettingsDisplay" + }, + "formatting": { + "$ref": "#/definitions/ChartSettingsFormatting" + } + }, + "type": "object" + } + }, + "required": ["column"], + "type": "object" + }, + "ChartDisplayCategory": { + "enum": ["TimeSeries", "CumulativeTimeSeries", "TotalValue"], + "type": "string" + }, + "ChartDisplayType": { + "enum": [ + "ActionsLineGraph", + "ActionsBar", + "ActionsStackedBar", + "ActionsAreaGraph", + "ActionsLineGraphCumulative", + "BoldNumber", + "ActionsPie", + "ActionsBarValue", + "ActionsTable", + "WorldMap" + ], + "type": "string" + }, + "ChartSettings": { + "additionalProperties": false, + "properties": { + "goalLines": { + "items": { + "$ref": "#/definitions/GoalLine" + }, + "type": "array" + }, + "leftYAxisSettings": { + "$ref": "#/definitions/YAxisSettings" + }, + "rightYAxisSettings": { + "$ref": "#/definitions/YAxisSettings" + }, + "seriesBreakdownColumn": { + "type": ["string", "null"] + }, + "stackBars100": { + "description": "Whether we fill the bars to 100% in stacked mode", + "type": "boolean" + }, + "xAxis": { + "$ref": "#/definitions/ChartAxis" + }, + "yAxis": { + "items": { + "$ref": "#/definitions/ChartAxis" + }, + "type": "array" + }, + "yAxisAtZero": { + "description": "Deprecated: use `[left|right]YAxisSettings`. Whether the Y axis should start at zero", + "type": "boolean" + } + }, + "type": "object" + }, + "ChartSettingsDisplay": { + "additionalProperties": false, + "properties": { + "color": { + "type": "string" + }, + "displayType": { + "enum": ["auto", "line", "bar"], + "type": "string" + }, + "label": { + "type": "string" + }, + "trendLine": { + "type": "boolean" + }, + "yAxisPosition": { + "enum": ["left", "right"], + "type": "string" + } + }, + "type": "object" + }, + "ChartSettingsFormatting": { + "additionalProperties": false, + "properties": { + "decimalPlaces": { + "type": "number" + }, + "prefix": { + "type": "string" + }, + "style": { + "enum": ["none", "number", "percent"], + "type": "string" + }, + "suffix": { + "type": "string" + } + }, + "type": "object" + }, + "ClickhouseQueryProgress": { + "additionalProperties": false, + "properties": { + "active_cpu_time": { + "$ref": "#/definitions/integer" + }, + "bytes_read": { + "$ref": "#/definitions/integer" + }, + "estimated_rows_total": { + "$ref": "#/definitions/integer" + }, + "rows_read": { + "$ref": "#/definitions/integer" + }, + "time_elapsed": { + "$ref": "#/definitions/integer" + } + }, + "required": ["bytes_read", "rows_read", "estimated_rows_total", "time_elapsed", "active_cpu_time"], + "type": "object" + }, + "CohortPropertyFilter": { + "additionalProperties": false, + "description": "Sync with plugin-server/src/types.ts", + "properties": { + "key": { + "const": "id", + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator", + "default": "in" + }, + "type": { + "const": "cohort", + "type": "string" + }, + "value": { + "type": "integer" + } + }, + "required": ["key", "operator", "type", "value"], + "type": "object" + }, + "CompareFilter": { + "additionalProperties": false, + "properties": { + "compare": { + "default": false, + "description": "Whether to compare the current date range to a previous date range.", + "type": "boolean" + }, + "compare_to": { + "description": "The date range to compare to. The value is a relative date. Examples of relative dates are: `-1y` for 1 year ago, `-14m` for 14 months ago, `-100w` for 100 weeks ago, `-14d` for 14 days ago, `-30h` for 30 hours ago.", + "type": "string" + } + }, + "type": "object" + }, + "ConditionalFormattingRule": { + "additionalProperties": false, + "properties": { + "bytecode": { + "items": {}, + "type": "array" + }, + "color": { + "type": "string" + }, + "colorMode": { + "enum": ["light", "dark"], + "type": "string" + }, + "columnName": { + "type": "string" + }, + "id": { + "type": "string" + }, + "input": { + "type": "string" + }, + "templateId": { + "type": "string" + } + }, + "required": ["id", "templateId", "columnName", "bytecode", "input", "color"], + "type": "object" + }, + "CountPerActorMathType": { + "enum": [ + "avg_count_per_actor", + "min_count_per_actor", + "max_count_per_actor", + "median_count_per_actor", + "p90_count_per_actor", + "p95_count_per_actor", + "p99_count_per_actor" + ], + "type": "string" + }, + "CustomChannelCondition": { + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "key": { + "$ref": "#/definitions/CustomChannelField" + }, + "op": { + "$ref": "#/definitions/CustomChannelOperator" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ] + } + }, + "required": ["key", "op", "id"], + "type": "object" + }, + "CustomChannelField": { + "enum": ["utm_source", "utm_medium", "utm_campaign", "referring_domain", "url", "pathname", "hostname"], + "type": "string" + }, + "CustomChannelOperator": { + "enum": ["exact", "is_not", "is_set", "is_not_set", "icontains", "not_icontains", "regex", "not_regex"], + "type": "string" + }, + "CustomChannelRule": { + "additionalProperties": false, + "properties": { + "channel_type": { + "type": "string" + }, + "combiner": { + "$ref": "#/definitions/FilterLogicalOperator" + }, + "id": { + "type": "string" + }, + "items": { + "items": { + "$ref": "#/definitions/CustomChannelCondition" + }, + "type": "array" + } + }, + "required": ["items", "combiner", "channel_type", "id"], + "type": "object" + }, + "CustomEventConversionGoal": { + "additionalProperties": false, + "properties": { + "customEventName": { + "type": "string" + } + }, + "required": ["customEventName"], + "type": "object" + }, + "DashboardFilter": { + "additionalProperties": false, + "properties": { + "date_from": { + "type": ["string", "null"] + }, + "date_to": { + "type": ["string", "null"] + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "type": "null" + } + ] + } + }, + "type": "object" + }, + "DataColorToken": { + "enum": [ + "preset-1", + "preset-2", + "preset-3", + "preset-4", + "preset-5", + "preset-6", + "preset-7", + "preset-8", + "preset-9", + "preset-10", + "preset-11", + "preset-12", + "preset-13", + "preset-14", + "preset-15" + ], + "type": "string" + }, + "DataTableNode": { + "additionalProperties": false, + "properties": { + "allowSorting": { + "description": "Can the user click on column headers to sort the table? (default: true)", + "type": "boolean" + }, + "columns": { + "description": "Columns shown in the table, unless the `source` provides them.", + "items": { + "$ref": "#/definitions/HogQLExpression" + }, + "type": "array" + }, + "embedded": { + "description": "Uses the embedded version of LemonTable", + "type": "boolean" + }, + "expandable": { + "description": "Can expand row to show raw event data (default: true)", + "type": "boolean" + }, + "full": { + "description": "Show with most visual options enabled. Used in scenes.", + "type": "boolean" + }, + "hiddenColumns": { + "description": "Columns that aren't shown in the table, even if in columns or returned data", + "items": { + "$ref": "#/definitions/HogQLExpression" + }, + "type": "array" + }, + "kind": { + "const": "DataTableNode", + "type": "string" + }, + "propertiesViaUrl": { + "description": "Link properties via the URL (default: false)", + "type": "boolean" + }, + "response": { + "anyOf": [ + { + "properties": {}, + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["columns", "hogql", "results", "types"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "missing_actors_count": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["columns", "hogql", "limit", "offset", "results", "types"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "clickhouse": { + "description": "Executed ClickHouse query", + "type": "string" + }, + "columns": { + "description": "Returned columns", + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "explain": { + "description": "Query explanation output", + "items": { + "type": "string" + }, + "type": "array" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "metadata": { + "$ref": "#/definitions/HogQLMetadataResponse", + "description": "Query metadata output" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query": { + "description": "Input query string", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "description": "Types of returned columns", + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "dateFrom": { + "type": "string" + }, + "dateTo": { + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/WebOverviewItem" + }, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": {}, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/ErrorTrackingIssue" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "expected_loss": { + "type": "number" + }, + "funnels_query": { + "$ref": "#/definitions/FunnelsQuery" + }, + "insight": { + "items": { + "items": { + "type": "object" + }, + "type": "array" + }, + "type": "array" + }, + "kind": { + "const": "ExperimentFunnelsQuery", + "type": "string" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantFunnelsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "credible_intervals", + "expected_loss", + "insight", + "kind", + "probability", + "significance_code", + "significant", + "variants" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "count_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "exposure_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "insight": { + "items": { + "type": "object" + }, + "type": "array" + }, + "kind": { + "const": "ExperimentTrendsQuery", + "type": "string" + }, + "p_value": { + "type": "number" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantTrendsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "credible_intervals", + "insight", + "kind", + "p_value", + "probability", + "significance_code", + "significant", + "variants" + ], + "type": "object" + } + ] + }, + "showActions": { + "description": "Show the kebab menu at the end of the row", + "type": "boolean" + }, + "showColumnConfigurator": { + "description": "Show a button to configure the table's columns if possible", + "type": "boolean" + }, + "showDateRange": { + "description": "Show date range selector", + "type": "boolean" + }, + "showElapsedTime": { + "description": "Show the time it takes to run a query", + "type": "boolean" + }, + "showEventFilter": { + "description": "Include an event filter above the table (EventsNode only)", + "type": "boolean" + }, + "showExport": { + "description": "Show the export button", + "type": "boolean" + }, + "showHogQLEditor": { + "description": "Include a HogQL query editor above HogQL tables", + "type": "boolean" + }, + "showOpenEditorButton": { + "description": "Show a button to open the current query as a new insight. (default: true)", + "type": "boolean" + }, + "showPersistentColumnConfigurator": { + "description": "Show a button to configure and persist the table's default columns if possible", + "type": "boolean" + }, + "showPropertyFilter": { + "anyOf": [ + { + "type": "boolean" + }, + { + "items": { + "$ref": "#/definitions/TaxonomicFilterGroupType" + }, + "type": "array" + } + ], + "description": "Include a property filter above the table" + }, + "showReload": { + "description": "Show a reload button", + "type": "boolean" + }, + "showResultsTable": { + "description": "Show a results table", + "type": "boolean" + }, + "showSavedQueries": { + "description": "Shows a list of saved queries", + "type": "boolean" + }, + "showSearch": { + "description": "Include a free text search field (PersonsNode only)", + "type": "boolean" + }, + "showTestAccountFilters": { + "description": "Show filter to exclude test accounts", + "type": "boolean" + }, + "showTimings": { + "description": "Show a detailed query timing breakdown", + "type": "boolean" + }, + "source": { + "anyOf": [ + { + "$ref": "#/definitions/EventsNode" + }, + { + "$ref": "#/definitions/EventsQuery" + }, + { + "$ref": "#/definitions/PersonsNode" + }, + { + "$ref": "#/definitions/ActorsQuery" + }, + { + "$ref": "#/definitions/HogQLQuery" + }, + { + "$ref": "#/definitions/WebOverviewQuery" + }, + { + "$ref": "#/definitions/WebStatsTableQuery" + }, + { + "$ref": "#/definitions/WebExternalClicksTableQuery" + }, + { + "$ref": "#/definitions/WebGoalsQuery" + }, + { + "$ref": "#/definitions/SessionAttributionExplorerQuery" + }, + { + "$ref": "#/definitions/ErrorTrackingQuery" + }, + { + "$ref": "#/definitions/ExperimentFunnelsQuery" + }, + { + "$ref": "#/definitions/ExperimentTrendsQuery" + } + ], + "description": "Source of the events" + } + }, + "required": ["kind", "source"], + "type": "object" + }, + "DataVisualizationNode": { + "additionalProperties": false, + "properties": { + "chartSettings": { + "$ref": "#/definitions/ChartSettings" + }, + "display": { + "$ref": "#/definitions/ChartDisplayType" + }, + "kind": { + "const": "DataVisualizationNode", + "type": "string" + }, + "source": { + "$ref": "#/definitions/HogQLQuery" + }, + "tableSettings": { + "$ref": "#/definitions/TableSettings" + } + }, + "required": ["kind", "source"], + "type": "object" + }, + "DataWarehouseEventsModifier": { + "additionalProperties": false, + "properties": { + "distinct_id_field": { + "type": "string" + }, + "id_field": { + "type": "string" + }, + "table_name": { + "type": "string" + }, + "timestamp_field": { + "type": "string" + } + }, + "required": ["table_name", "timestamp_field", "distinct_id_field", "id_field"], + "type": "object" + }, + "DataWarehouseNode": { + "additionalProperties": false, + "properties": { + "custom_name": { + "type": "string" + }, + "distinct_id_field": { + "type": "string" + }, + "fixedProperties": { + "description": "Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "id_field": { + "type": "string" + }, + "kind": { + "const": "DataWarehouseNode", + "type": "string" + }, + "math": { + "$ref": "#/definitions/MathType" + }, + "math_group_type_index": { + "enum": [0, 1, 2, 3, 4], + "type": "number" + }, + "math_hogql": { + "type": "string" + }, + "math_property": { + "type": "string" + }, + "math_property_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "properties": { + "description": "Properties configurable in the interface", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "response": { + "type": "object" + }, + "table_name": { + "type": "string" + }, + "timestamp_field": { + "type": "string" + } + }, + "required": ["distinct_id_field", "id", "id_field", "kind", "table_name", "timestamp_field"], + "type": "object" + }, + "DataWarehousePersonPropertyFilter": { + "additionalProperties": false, + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator" + }, + "type": { + "const": "data_warehouse_person_property", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "DataWarehousePropertyFilter": { + "additionalProperties": false, + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator" + }, + "type": { + "const": "data_warehouse", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "DatabaseSchemaBatchExportTable": { + "additionalProperties": false, + "properties": { + "fields": { + "additionalProperties": { + "$ref": "#/definitions/DatabaseSchemaField" + }, + "type": "object" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "const": "batch_export", + "type": "string" + } + }, + "required": ["fields", "id", "name", "type"], + "type": "object" + }, + "DatabaseSchemaDataWarehouseTable": { + "additionalProperties": false, + "properties": { + "fields": { + "additionalProperties": { + "$ref": "#/definitions/DatabaseSchemaField" + }, + "type": "object" + }, + "format": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "schema": { + "$ref": "#/definitions/DatabaseSchemaSchema" + }, + "source": { + "$ref": "#/definitions/DatabaseSchemaSource" + }, + "type": { + "const": "data_warehouse", + "type": "string" + }, + "url_pattern": { + "type": "string" + } + }, + "required": ["fields", "format", "id", "name", "type", "url_pattern"], + "type": "object" + }, + "DatabaseSchemaField": { + "additionalProperties": false, + "properties": { + "chain": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/integer" + } + ] + }, + "type": "array" + }, + "fields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "hogql_value": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "schema_valid": { + "type": "boolean" + }, + "table": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/DatabaseSerializedFieldType" + } + }, + "required": ["name", "hogql_value", "type", "schema_valid"], + "type": "object" + }, + "DatabaseSchemaMaterializedViewTable": { + "additionalProperties": false, + "properties": { + "fields": { + "additionalProperties": { + "$ref": "#/definitions/DatabaseSchemaField" + }, + "type": "object" + }, + "id": { + "type": "string" + }, + "last_run_at": { + "type": "string" + }, + "name": { + "type": "string" + }, + "query": { + "$ref": "#/definitions/HogQLQuery" + }, + "status": { + "type": "string" + }, + "type": { + "const": "materialized_view", + "type": "string" + } + }, + "required": ["fields", "id", "name", "query", "type"], + "type": "object" + }, + "DatabaseSchemaPostHogTable": { + "additionalProperties": false, + "properties": { + "fields": { + "additionalProperties": { + "$ref": "#/definitions/DatabaseSchemaField" + }, + "type": "object" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "const": "posthog", + "type": "string" + } + }, + "required": ["fields", "id", "name", "type"], + "type": "object" + }, + "DatabaseSchemaQuery": { + "additionalProperties": false, + "properties": { + "kind": { + "const": "DatabaseSchemaQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "response": { + "$ref": "#/definitions/DatabaseSchemaQueryResponse" + } + }, + "required": ["kind"], + "type": "object" + }, + "DatabaseSchemaQueryResponse": { + "additionalProperties": false, + "properties": { + "tables": { + "additionalProperties": { + "$ref": "#/definitions/DatabaseSchemaTable" + }, + "type": "object" + } + }, + "required": ["tables"], + "type": "object" + }, + "DatabaseSchemaSchema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "incremental": { + "type": "boolean" + }, + "last_synced_at": { + "type": "string" + }, + "name": { + "type": "string" + }, + "should_sync": { + "type": "boolean" + }, + "status": { + "type": "string" + } + }, + "required": ["id", "name", "should_sync", "incremental"], + "type": "object" + }, + "DatabaseSchemaSource": { + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "last_synced_at": { + "type": "string" + }, + "prefix": { + "type": "string" + }, + "source_type": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": ["id", "status", "source_type", "prefix"], + "type": "object" + }, + "DatabaseSchemaTable": { + "anyOf": [ + { + "$ref": "#/definitions/DatabaseSchemaPostHogTable" + }, + { + "$ref": "#/definitions/DatabaseSchemaDataWarehouseTable" + }, + { + "$ref": "#/definitions/DatabaseSchemaViewTable" + }, + { + "$ref": "#/definitions/DatabaseSchemaBatchExportTable" + }, + { + "$ref": "#/definitions/DatabaseSchemaMaterializedViewTable" + } + ] + }, + "DatabaseSchemaTableCommon": { + "additionalProperties": false, + "properties": { + "fields": { + "additionalProperties": { + "$ref": "#/definitions/DatabaseSchemaField" + }, + "type": "object" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "enum": ["posthog", "data_warehouse", "view", "batch_export", "materialized_view"], + "type": "string" + } + }, + "required": ["type", "id", "name", "fields"], + "type": "object" + }, + "DatabaseSchemaViewTable": { + "additionalProperties": false, + "properties": { + "fields": { + "additionalProperties": { + "$ref": "#/definitions/DatabaseSchemaField" + }, + "type": "object" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "query": { + "$ref": "#/definitions/HogQLQuery" + }, + "type": { + "const": "view", + "type": "string" + } + }, + "required": ["fields", "id", "name", "query", "type"], + "type": "object" + }, + "DatabaseSerializedFieldType": { + "enum": [ + "integer", + "float", + "string", + "datetime", + "date", + "boolean", + "array", + "json", + "lazy_table", + "virtual_table", + "field_traverser", + "expression", + "view", + "materialized_view" + ], + "type": "string" + }, + "DateRange": { + "additionalProperties": false, + "properties": { + "date_from": { + "type": ["string", "null"] + }, + "date_to": { + "type": ["string", "null"] + }, + "explicitDate": { + "default": false, + "description": "Whether the date_from and date_to should be used verbatim. Disables rounding to the start and end of period.", + "type": ["boolean", "null"] + } + }, + "type": "object" + }, + "DatetimeDay": { + "format": "date-time", + "type": "string" + }, + "Day": { + "$ref": "#/definitions/integer" + }, + "DefaultChannelTypes": { + "enum": [ + "Cross Network", + "Paid Search", + "Paid Social", + "Paid Video", + "Paid Shopping", + "Paid Unknown", + "Direct", + "Organic Search", + "Organic Social", + "Organic Video", + "Organic Shopping", + "Push", + "SMS", + "Audio", + "Email", + "Referral", + "Affiliate", + "Unknown" + ], + "type": "string" + }, + "DurationType": { + "enum": ["duration", "active_seconds", "inactive_seconds"], + "type": "string" + }, + "ElementPropertyFilter": { + "additionalProperties": false, + "description": "Sync with plugin-server/src/types.ts", + "properties": { + "key": { + "enum": ["tag_name", "text", "href", "selector"], + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator" + }, + "type": { + "const": "element", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "ElementType": { + "additionalProperties": false, + "properties": { + "attr_class": { + "items": { + "type": "string" + }, + "type": "array" + }, + "attr_id": { + "type": "string" + }, + "attributes": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "href": { + "type": "string" + }, + "nth_child": { + "type": "number" + }, + "nth_of_type": { + "type": "number" + }, + "order": { + "type": "number" + }, + "tag_name": { + "type": "string" + }, + "text": { + "type": "string" + } + }, + "required": ["attributes", "tag_name"], + "type": "object" + }, + "EmptyPropertyFilter": { + "additionalProperties": false, + "type": "object" + }, + "EntityNode": { + "additionalProperties": false, + "properties": { + "custom_name": { + "type": "string" + }, + "fixedProperties": { + "description": "Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "kind": { + "$ref": "#/definitions/NodeKind" + }, + "math": { + "$ref": "#/definitions/MathType" + }, + "math_group_type_index": { + "enum": [0, 1, 2, 3, 4], + "type": "number" + }, + "math_hogql": { + "type": "string" + }, + "math_property": { + "type": "string" + }, + "math_property_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "properties": { + "description": "Properties configurable in the interface", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "response": { + "type": "object" + } + }, + "required": ["kind"], + "type": "object" + }, + "EntityType": { + "enum": ["actions", "events", "data_warehouse", "new_entity"], + "type": "string" + }, + "ErrorTrackingIssue": { + "additionalProperties": false, + "properties": { + "assignee": { + "type": ["number", "null"] + }, + "description": { + "type": ["string", "null"] + }, + "earliest": { + "type": "string" + }, + "first_seen": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "last_seen": { + "format": "date-time", + "type": "string" + }, + "name": { + "type": ["string", "null"] + }, + "occurrences": { + "type": "number" + }, + "sessions": { + "type": "number" + }, + "status": { + "enum": ["archived", "active", "resolved", "pending_release"], + "type": "string" + }, + "users": { + "type": "number" + }, + "volume": {} + }, + "required": [ + "id", + "name", + "description", + "occurrences", + "sessions", + "users", + "first_seen", + "last_seen", + "earliest", + "assignee", + "status" + ], + "type": "object" + }, + "ErrorTrackingQuery": { + "additionalProperties": false, + "properties": { + "assignee": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ] + }, + "dateRange": { + "$ref": "#/definitions/DateRange" + }, + "filterGroup": { + "$ref": "#/definitions/PropertyGroupFilter" + }, + "filterTestAccounts": { + "type": "boolean" + }, + "issueId": { + "type": "string" + }, + "kind": { + "const": "ErrorTrackingQuery", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "orderBy": { + "enum": ["last_seen", "first_seen", "occurrences", "users", "sessions"], + "type": "string" + }, + "response": { + "$ref": "#/definitions/ErrorTrackingQueryResponse" + }, + "searchQuery": { + "type": "string" + }, + "select": { + "items": { + "$ref": "#/definitions/HogQLExpression" + }, + "type": "array" + } + }, + "required": ["dateRange", "kind"], + "type": "object" + }, + "ErrorTrackingQueryResponse": { + "additionalProperties": false, + "properties": { + "columns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/ErrorTrackingIssue" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "EventDefinition": { + "additionalProperties": false, + "properties": { + "elements": { + "items": {}, + "type": "array" + }, + "event": { + "type": "string" + }, + "properties": { + "type": "object" + } + }, + "required": ["event", "properties", "elements"], + "type": "object" + }, + "EventOddsRatioSerialized": { + "additionalProperties": false, + "properties": { + "correlation_type": { + "enum": ["success", "failure"], + "type": "string" + }, + "event": { + "$ref": "#/definitions/EventDefinition" + }, + "failure_count": { + "$ref": "#/definitions/integer" + }, + "odds_ratio": { + "type": "number" + }, + "success_count": { + "$ref": "#/definitions/integer" + } + }, + "required": ["event", "success_count", "failure_count", "odds_ratio", "correlation_type"], + "type": "object" + }, + "EventPropertyFilter": { + "additionalProperties": false, + "description": "Sync with plugin-server/src/types.ts", + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator", + "default": "exact" + }, + "type": { + "const": "event", + "description": "Event properties", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "EventTaxonomyItem": { + "additionalProperties": false, + "properties": { + "property": { + "type": "string" + }, + "sample_count": { + "$ref": "#/definitions/integer" + }, + "sample_values": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["property", "sample_values", "sample_count"], + "type": "object" + }, + "EventTaxonomyQuery": { + "additionalProperties": false, + "properties": { + "event": { + "type": "string" + }, + "kind": { + "const": "EventTaxonomyQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "response": { + "$ref": "#/definitions/EventTaxonomyQueryResponse" + } + }, + "required": ["event", "kind"], + "type": "object" + }, + "EventTaxonomyQueryResponse": { + "additionalProperties": false, + "description": "All analytics query responses must inherit from this.", + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/EventTaxonomyResponse" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "EventTaxonomyResponse": { + "items": { + "$ref": "#/definitions/EventTaxonomyItem" + }, + "type": "array" + }, + "EventType": { + "additionalProperties": false, + "properties": { + "distinct_id": { + "type": "string" + }, + "elements": { + "items": { + "$ref": "#/definitions/ElementType" + }, + "type": "array" + }, + "elements_chain": { + "type": ["string", "null"] + }, + "event": { + "type": "string" + }, + "id": { + "type": "string" + }, + "person": { + "additionalProperties": false, + "properties": { + "distinct_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "is_identified": { + "type": "boolean" + }, + "properties": { + "type": "object" + } + }, + "required": ["distinct_ids", "properties"], + "type": "object" + }, + "properties": { + "type": "object" + }, + "timestamp": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "required": ["id", "distinct_id", "properties", "event", "timestamp", "elements"], + "type": "object" + }, + "EventsNode": { + "additionalProperties": false, + "properties": { + "custom_name": { + "type": "string" + }, + "event": { + "description": "The event or `null` for all events.", + "type": ["string", "null"] + }, + "fixedProperties": { + "description": "Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "kind": { + "const": "EventsNode", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "math": { + "$ref": "#/definitions/MathType" + }, + "math_group_type_index": { + "enum": [0, 1, 2, 3, 4], + "type": "number" + }, + "math_hogql": { + "type": "string" + }, + "math_property": { + "type": "string" + }, + "math_property_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "orderBy": { + "description": "Columns to order by", + "items": { + "type": "string" + }, + "type": "array" + }, + "properties": { + "description": "Properties configurable in the interface", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "response": { + "type": "object" + } + }, + "required": ["kind"], + "type": "object" + }, + "EventsQuery": { + "additionalProperties": false, + "properties": { + "actionId": { + "$ref": "#/definitions/integer", + "description": "Show events matching a given action" + }, + "after": { + "description": "Only fetch events that happened after this timestamp", + "type": "string" + }, + "before": { + "description": "Only fetch events that happened before this timestamp", + "type": "string" + }, + "event": { + "description": "Limit to events matching this string", + "type": ["string", "null"] + }, + "filterTestAccounts": { + "description": "Filter test accounts", + "type": "boolean" + }, + "fixedProperties": { + "description": "Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + "items": { + "$ref": "#/definitions/AnyFilterLike" + }, + "type": "array" + }, + "kind": { + "const": "EventsQuery", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer", + "description": "Number of rows to return" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer", + "description": "Number of rows to skip before returning rows" + }, + "orderBy": { + "description": "Columns to order by", + "items": { + "type": "string" + }, + "type": "array" + }, + "personId": { + "description": "Show events for a given person", + "type": "string" + }, + "properties": { + "description": "Properties configurable in the interface", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "response": { + "$ref": "#/definitions/EventsQueryResponse" + }, + "select": { + "description": "Return a limited set of data. Required.", + "items": { + "$ref": "#/definitions/HogQLExpression" + }, + "type": "array" + }, + "where": { + "description": "HogQL filters to apply on returned data", + "items": { + "$ref": "#/definitions/HogQLExpression" + }, + "type": "array" + } + }, + "required": ["kind", "select"], + "type": "object" + }, + "EventsQueryPersonColumn": { + "additionalProperties": false, + "properties": { + "created_at": { + "type": "string" + }, + "distinct_id": { + "type": "string" + }, + "properties": { + "additionalProperties": false, + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "uuid": { + "type": "string" + } + }, + "required": ["uuid", "created_at", "properties", "distinct_id"], + "type": "object" + }, + "EventsQueryResponse": { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["columns", "hogql", "results", "types"], + "type": "object" + }, + "ExperimentFunnelsQuery": { + "additionalProperties": false, + "properties": { + "experiment_id": { + "$ref": "#/definitions/integer" + }, + "funnels_query": { + "$ref": "#/definitions/FunnelsQuery" + }, + "kind": { + "const": "ExperimentFunnelsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "name": { + "type": "string" + }, + "response": { + "$ref": "#/definitions/ExperimentFunnelsQueryResponse" + } + }, + "required": ["funnels_query", "kind"], + "type": "object" + }, + "ExperimentFunnelsQueryResponse": { + "additionalProperties": false, + "properties": { + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "expected_loss": { + "type": "number" + }, + "funnels_query": { + "$ref": "#/definitions/FunnelsQuery" + }, + "insight": { + "items": { + "items": { + "type": "object" + }, + "type": "array" + }, + "type": "array" + }, + "kind": { + "const": "ExperimentFunnelsQuery", + "type": "string" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantFunnelsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "kind", + "insight", + "variants", + "probability", + "significant", + "significance_code", + "expected_loss", + "credible_intervals" + ], + "type": "object" + }, + "ExperimentSignificanceCode": { + "enum": ["significant", "not_enough_exposure", "low_win_probability", "high_loss", "high_p_value"], + "type": "string" + }, + "ExperimentTrendsQuery": { + "additionalProperties": false, + "properties": { + "count_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "experiment_id": { + "$ref": "#/definitions/integer" + }, + "exposure_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "kind": { + "const": "ExperimentTrendsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "name": { + "type": "string" + }, + "response": { + "$ref": "#/definitions/ExperimentTrendsQueryResponse" + } + }, + "required": ["count_query", "kind"], + "type": "object" + }, + "ExperimentTrendsQueryResponse": { + "additionalProperties": false, + "properties": { + "count_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "exposure_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "insight": { + "items": { + "type": "object" + }, + "type": "array" + }, + "kind": { + "const": "ExperimentTrendsQuery", + "type": "string" + }, + "p_value": { + "type": "number" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantTrendsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "kind", + "insight", + "variants", + "probability", + "significant", + "significance_code", + "p_value", + "credible_intervals" + ], + "type": "object" + }, + "ExperimentVariantFunnelsBaseStats": { + "additionalProperties": false, + "properties": { + "failure_count": { + "type": "number" + }, + "key": { + "type": "string" + }, + "success_count": { + "type": "number" + } + }, + "required": ["key", "success_count", "failure_count"], + "type": "object" + }, + "ExperimentVariantTrendsBaseStats": { + "additionalProperties": false, + "properties": { + "absolute_exposure": { + "type": "number" + }, + "count": { + "type": "number" + }, + "exposure": { + "type": "number" + }, + "key": { + "type": "string" + } + }, + "required": ["key", "count", "exposure", "absolute_exposure"], + "type": "object" + }, + "FailureMessage": { + "additionalProperties": false, + "properties": { + "content": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "const": "ai/failure", + "type": "string" + } + }, + "required": ["type"], + "type": "object" + }, + "FeaturePropertyFilter": { + "additionalProperties": false, + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator" + }, + "type": { + "const": "feature", + "description": "Event property with \"$feature/\" prepended", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "FilterLogicalOperator": { + "enum": ["AND", "OR"], + "type": "string" + }, + "FunnelConversionWindowTimeUnit": { + "enum": ["second", "minute", "hour", "day", "week", "month"], + "type": "string" + }, + "FunnelCorrelationActorsQuery": { + "additionalProperties": false, + "properties": { + "funnelCorrelationPersonConverted": { + "type": "boolean" + }, + "funnelCorrelationPersonEntity": { + "$ref": "#/definitions/AnyEntityNode" + }, + "funnelCorrelationPropertyValues": { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "includeRecordings": { + "type": "boolean" + }, + "kind": { + "const": "FunnelCorrelationActorsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "response": { + "$ref": "#/definitions/ActorsQueryResponse" + }, + "source": { + "$ref": "#/definitions/FunnelCorrelationQuery" + } + }, + "required": ["kind", "source"], + "type": "object" + }, + "FunnelCorrelationQuery": { + "additionalProperties": false, + "properties": { + "funnelCorrelationEventExcludePropertyNames": { + "items": { + "type": "string" + }, + "type": "array" + }, + "funnelCorrelationEventNames": { + "items": { + "type": "string" + }, + "type": "array" + }, + "funnelCorrelationExcludeEventNames": { + "items": { + "type": "string" + }, + "type": "array" + }, + "funnelCorrelationExcludeNames": { + "items": { + "type": "string" + }, + "type": "array" + }, + "funnelCorrelationNames": { + "items": { + "type": "string" + }, + "type": "array" + }, + "funnelCorrelationType": { + "$ref": "#/definitions/FunnelCorrelationResultsType" + }, + "kind": { + "const": "FunnelCorrelationQuery", + "type": "string" + }, + "response": { + "$ref": "#/definitions/FunnelCorrelationResponse" + }, + "source": { + "$ref": "#/definitions/FunnelsActorsQuery" + } + }, + "required": ["funnelCorrelationType", "kind", "source"], + "type": "object" + }, + "FunnelCorrelationResponse": { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/FunnelCorrelationResult" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "FunnelCorrelationResult": { + "additionalProperties": false, + "properties": { + "events": { + "items": { + "$ref": "#/definitions/EventOddsRatioSerialized" + }, + "type": "array" + }, + "skewed": { + "type": "boolean" + } + }, + "required": ["events", "skewed"], + "type": "object" + }, + "FunnelCorrelationResultsType": { + "enum": ["events", "properties", "event_with_properties"], + "type": "string" + }, + "FunnelExclusion": { + "anyOf": [ + { + "$ref": "#/definitions/FunnelExclusionEventsNode" + }, + { + "$ref": "#/definitions/FunnelExclusionActionsNode" + } + ] + }, + "FunnelExclusionActionsNode": { + "additionalProperties": false, + "properties": { + "custom_name": { + "type": "string" + }, + "fixedProperties": { + "description": "Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "funnelFromStep": { + "$ref": "#/definitions/integer" + }, + "funnelToStep": { + "$ref": "#/definitions/integer" + }, + "id": { + "$ref": "#/definitions/integer" + }, + "kind": { + "const": "ActionsNode", + "type": "string" + }, + "math": { + "$ref": "#/definitions/MathType" + }, + "math_group_type_index": { + "enum": [0, 1, 2, 3, 4], + "type": "number" + }, + "math_hogql": { + "type": "string" + }, + "math_property": { + "type": "string" + }, + "math_property_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "properties": { + "description": "Properties configurable in the interface", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "response": { + "type": "object" + } + }, + "required": ["funnelFromStep", "funnelToStep", "id", "kind"], + "type": "object" + }, + "FunnelExclusionEventsNode": { + "additionalProperties": false, + "properties": { + "custom_name": { + "type": "string" + }, + "event": { + "description": "The event or `null` for all events.", + "type": ["string", "null"] + }, + "fixedProperties": { + "description": "Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "funnelFromStep": { + "$ref": "#/definitions/integer" + }, + "funnelToStep": { + "$ref": "#/definitions/integer" + }, + "kind": { + "const": "EventsNode", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "math": { + "$ref": "#/definitions/MathType" + }, + "math_group_type_index": { + "enum": [0, 1, 2, 3, 4], + "type": "number" + }, + "math_hogql": { + "type": "string" + }, + "math_property": { + "type": "string" + }, + "math_property_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "orderBy": { + "description": "Columns to order by", + "items": { + "type": "string" + }, + "type": "array" + }, + "properties": { + "description": "Properties configurable in the interface", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "response": { + "type": "object" + } + }, + "required": ["funnelFromStep", "funnelToStep", "kind"], + "type": "object" + }, + "FunnelExclusionLegacy": { + "additionalProperties": false, + "properties": { + "custom_name": { + "type": ["string", "null"] + }, + "funnel_from_step": { + "type": "number" + }, + "funnel_to_step": { + "type": "number" + }, + "id": { + "type": ["string", "number", "null"] + }, + "index": { + "type": "number" + }, + "name": { + "type": ["string", "null"] + }, + "order": { + "type": "number" + }, + "type": { + "$ref": "#/definitions/EntityType" + } + }, + "required": ["funnel_from_step", "funnel_to_step"], + "type": "object" + }, + "FunnelExclusionSteps": { + "additionalProperties": false, + "properties": { + "funnelFromStep": { + "$ref": "#/definitions/integer" + }, + "funnelToStep": { + "$ref": "#/definitions/integer" + } + }, + "required": ["funnelFromStep", "funnelToStep"], + "type": "object" + }, + "FunnelLayout": { + "enum": ["horizontal", "vertical"], + "type": "string" + }, + "FunnelMathType": { + "enum": ["total", "first_time_for_user", "first_time_for_user_with_filters"], + "type": "string" + }, + "FunnelPathType": { + "enum": ["funnel_path_before_step", "funnel_path_between_steps", "funnel_path_after_step"], + "type": "string" + }, + "FunnelPathsFilter": { + "additionalProperties": false, + "properties": { + "funnelPathType": { + "$ref": "#/definitions/FunnelPathType" + }, + "funnelSource": { + "$ref": "#/definitions/FunnelsQuery" + }, + "funnelStep": { + "$ref": "#/definitions/integer" + } + }, + "required": ["funnelSource"], + "type": "object" + }, + "FunnelStepReference": { + "enum": ["total", "previous"], + "type": "string" + }, + "FunnelStepsBreakdownResults": { + "items": { + "items": { + "type": "object" + }, + "type": "array" + }, + "type": "array" + }, + "FunnelStepsResults": { + "items": { + "type": "object" + }, + "type": "array" + }, + "FunnelTimeToConvertResults": { + "additionalProperties": false, + "properties": { + "average_conversion_time": { + "type": ["number", "null"] + }, + "bins": { + "items": { + "items": { + "type": "integer" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "array" + } + }, + "required": ["average_conversion_time", "bins"], + "type": "object" + }, + "FunnelTrendsResults": { + "items": { + "type": "object" + }, + "type": "array" + }, + "FunnelVizType": { + "enum": ["steps", "time_to_convert", "trends"], + "type": "string" + }, + "FunnelsActorsQuery": { + "additionalProperties": false, + "properties": { + "funnelCustomSteps": { + "description": "Custom step numbers to get persons for. This overrides `funnelStep`. Primarily for correlation use.", + "items": { + "$ref": "#/definitions/integer" + }, + "type": "array" + }, + "funnelStep": { + "$ref": "#/definitions/integer", + "description": "Index of the step for which we want to get the timestamp for, per person. Positive for converted persons, negative for dropped of persons." + }, + "funnelStepBreakdown": { + "$ref": "#/definitions/BreakdownKeyType", + "description": "The breakdown value for which to get persons for. This is an array for person and event properties, a string for groups and an integer for cohorts." + }, + "funnelTrendsDropOff": { + "type": "boolean" + }, + "funnelTrendsEntrancePeriodStart": { + "description": "Used together with `funnelTrendsDropOff` for funnels time conversion date for the persons modal.", + "type": "string" + }, + "includeRecordings": { + "type": "boolean" + }, + "kind": { + "const": "FunnelsActorsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "response": { + "$ref": "#/definitions/ActorsQueryResponse" + }, + "source": { + "$ref": "#/definitions/FunnelsQuery" + } + }, + "required": ["kind", "source"], + "type": "object" + }, + "FunnelsFilter": { + "additionalProperties": false, + "properties": { + "binCount": { + "type": "integer" + }, + "breakdownAttributionType": { + "$ref": "#/definitions/BreakdownAttributionType", + "default": "first_touch" + }, + "breakdownAttributionValue": { + "$ref": "#/definitions/integer" + }, + "exclusions": { + "default": [], + "items": { + "$ref": "#/definitions/FunnelExclusion" + }, + "type": "array" + }, + "funnelAggregateByHogQL": { + "type": "string" + }, + "funnelFromStep": { + "$ref": "#/definitions/integer" + }, + "funnelOrderType": { + "$ref": "#/definitions/StepOrderValue", + "default": "ordered" + }, + "funnelStepReference": { + "$ref": "#/definitions/FunnelStepReference", + "default": "total" + }, + "funnelToStep": { + "$ref": "#/definitions/integer" + }, + "funnelVizType": { + "$ref": "#/definitions/FunnelVizType", + "default": "steps" + }, + "funnelWindowInterval": { + "$ref": "#/definitions/integer", + "default": 14 + }, + "funnelWindowIntervalUnit": { + "$ref": "#/definitions/FunnelConversionWindowTimeUnit", + "default": "day" + }, + "hiddenLegendBreakdowns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "layout": { + "$ref": "#/definitions/FunnelLayout", + "default": "vertical" + }, + "resultCustomizations": { + "additionalProperties": { + "$ref": "#/definitions/ResultCustomizationByValue" + }, + "description": "Customizations for the appearance of result datasets.", + "type": "object" + }, + "useUdf": { + "type": "boolean" + } + }, + "type": "object" + }, + "FunnelsFilterLegacy": { + "additionalProperties": false, + "description": "`FunnelsFilterType` minus everything inherited from `FilterType` and persons modal related params", + "properties": { + "bin_count": { + "$ref": "#/definitions/BinCountValue" + }, + "breakdown_attribution_type": { + "$ref": "#/definitions/BreakdownAttributionType" + }, + "breakdown_attribution_value": { + "type": "number" + }, + "exclusions": { + "items": { + "$ref": "#/definitions/FunnelExclusionLegacy" + }, + "type": "array" + }, + "funnel_aggregate_by_hogql": { + "type": "string" + }, + "funnel_from_step": { + "type": "number" + }, + "funnel_order_type": { + "$ref": "#/definitions/StepOrderValue" + }, + "funnel_step_reference": { + "$ref": "#/definitions/FunnelStepReference" + }, + "funnel_to_step": { + "type": "number" + }, + "funnel_viz_type": { + "$ref": "#/definitions/FunnelVizType" + }, + "funnel_window_interval": { + "type": "number" + }, + "funnel_window_interval_unit": { + "$ref": "#/definitions/FunnelConversionWindowTimeUnit" + }, + "hidden_legend_keys": { + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "not": {} + } + ] + }, + "type": "object" + }, + "layout": { + "$ref": "#/definitions/FunnelLayout" + } + }, + "type": "object" + }, + "FunnelsQuery": { + "additionalProperties": false, + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "breakdownFilter": { + "$ref": "#/definitions/BreakdownFilter", + "description": "Breakdown of the events and actions" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "funnelsFilter": { + "$ref": "#/definitions/FunnelsFilter", + "description": "Properties specific to the funnels insight" + }, + "interval": { + "$ref": "#/definitions/IntervalType", + "description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`" + }, + "kind": { + "const": "FunnelsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/FunnelsQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + }, + "series": { + "description": "Events and actions to include", + "items": { + "$ref": "#/definitions/AnyEntityNode" + }, + "type": "array" + } + }, + "required": ["kind", "series"], + "type": "object" + }, + "FunnelsQueryResponse": { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "isUdf": { + "type": "boolean" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "anyOf": [ + { + "$ref": "#/definitions/FunnelStepsResults" + }, + { + "$ref": "#/definitions/FunnelStepsBreakdownResults" + }, + { + "$ref": "#/definitions/FunnelTimeToConvertResults" + }, + { + "$ref": "#/definitions/FunnelTrendsResults" + } + ] + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "GenericCachedQueryResponse": { + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "timezone": { + "type": "string" + } + }, + "required": ["cache_key", "is_cached", "last_refresh", "next_allowed_client_refresh", "timezone"], + "type": "object" + }, + "GoalLine": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "number" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "GroupMathType": { + "const": "unique_group", + "type": "string" + }, + "GroupPropertyFilter": { + "additionalProperties": false, + "properties": { + "group_type_index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator" + }, + "type": { + "const": "group", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "HasPropertiesNode": { + "anyOf": [ + { + "$ref": "#/definitions/EventsNode" + }, + { + "$ref": "#/definitions/EventsQuery" + }, + { + "$ref": "#/definitions/PersonsNode" + } + ] + }, + "HogCompileResponse": { + "additionalProperties": false, + "properties": { + "bytecode": { + "items": {}, + "type": "array" + }, + "locals": { + "items": {}, + "type": "array" + } + }, + "required": ["bytecode", "locals"], + "type": "object" + }, + "HogLanguage": { + "enum": ["hog", "hogJson", "hogQL", "hogQLExpr", "hogTemplate"], + "type": "string" + }, + "HogQLAutocomplete": { + "additionalProperties": false, + "properties": { + "endPosition": { + "$ref": "#/definitions/integer", + "description": "End position of the editor word" + }, + "filters": { + "$ref": "#/definitions/HogQLFilters", + "description": "Table to validate the expression against" + }, + "globals": { + "description": "Global values in scope", + "type": "object" + }, + "kind": { + "const": "HogQLAutocomplete", + "type": "string" + }, + "language": { + "$ref": "#/definitions/HogLanguage", + "description": "Language to validate" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query": { + "description": "Query to validate", + "type": "string" + }, + "response": { + "$ref": "#/definitions/HogQLAutocompleteResponse" + }, + "sourceQuery": { + "$ref": "#/definitions/AnyDataNode", + "description": "Query in whose context to validate." + }, + "startPosition": { + "$ref": "#/definitions/integer", + "description": "Start position of the editor word" + } + }, + "required": ["endPosition", "kind", "language", "query", "startPosition"], + "type": "object" + }, + "HogQLAutocompleteResponse": { + "additionalProperties": false, + "properties": { + "incomplete_list": { + "description": "Whether or not the suggestions returned are complete", + "type": "boolean" + }, + "suggestions": { + "items": { + "$ref": "#/definitions/AutocompleteCompletionItem" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["suggestions", "incomplete_list"], + "type": "object" + }, + "HogQLExpression": { + "type": "string" + }, + "HogQLFilters": { + "additionalProperties": false, + "description": "Filters object that will be converted to a HogQL {filters} placeholder", + "properties": { + "dateRange": { + "$ref": "#/definitions/DateRange" + }, + "filterTestAccounts": { + "type": "boolean" + }, + "properties": { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + } + }, + "type": "object" + }, + "HogQLMathType": { + "const": "hogql", + "type": "string" + }, + "HogQLMetadata": { + "additionalProperties": false, + "properties": { + "debug": { + "description": "Enable more verbose output, usually run from the /debug page", + "type": "boolean" + }, + "filters": { + "$ref": "#/definitions/HogQLFilters", + "description": "Extra filters applied to query via {filters}" + }, + "globals": { + "description": "Extra globals for the query", + "type": "object" + }, + "kind": { + "const": "HogQLMetadata", + "type": "string" + }, + "language": { + "$ref": "#/definitions/HogLanguage", + "description": "Language to validate" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query": { + "description": "Query to validate", + "type": "string" + }, + "response": { + "$ref": "#/definitions/HogQLMetadataResponse" + }, + "sourceQuery": { + "$ref": "#/definitions/AnyDataNode", + "description": "Query within which \"expr\" and \"template\" are validated. Defaults to \"select * from events\"" + }, + "variables": { + "additionalProperties": { + "$ref": "#/definitions/HogQLVariable" + }, + "description": "Variables to be subsituted into the query", + "type": "object" + } + }, + "required": ["kind", "language", "query"], + "type": "object" + }, + "HogQLMetadataResponse": { + "additionalProperties": false, + "properties": { + "errors": { + "items": { + "$ref": "#/definitions/HogQLNotice" + }, + "type": "array" + }, + "isValid": { + "type": "boolean" + }, + "isValidView": { + "type": "boolean" + }, + "notices": { + "items": { + "$ref": "#/definitions/HogQLNotice" + }, + "type": "array" + }, + "query": { + "type": "string" + }, + "table_names": { + "items": { + "type": "string" + }, + "type": "array" + }, + "warnings": { + "items": { + "$ref": "#/definitions/HogQLNotice" + }, + "type": "array" + } + }, + "required": ["errors", "warnings", "notices"], + "type": "object" + }, + "HogQLNotice": { + "additionalProperties": false, + "properties": { + "end": { + "$ref": "#/definitions/integer" + }, + "fix": { + "type": "string" + }, + "message": { + "type": "string" + }, + "start": { + "$ref": "#/definitions/integer" + } + }, + "required": ["message"], + "type": "object" + }, + "HogQLPropertyFilter": { + "additionalProperties": false, + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "type": { + "const": "hogql", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "type"], + "type": "object" + }, + "HogQLQuery": { + "additionalProperties": false, + "properties": { + "explain": { + "deprecated": "use modifiers.debug instead", + "type": "boolean" + }, + "filters": { + "$ref": "#/definitions/HogQLFilters" + }, + "kind": { + "const": "HogQLQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query": { + "type": "string" + }, + "response": { + "$ref": "#/definitions/HogQLQueryResponse" + }, + "values": { + "description": "Constant values that can be referenced with the {placeholder} syntax in the query", + "type": "object" + }, + "variables": { + "additionalProperties": { + "$ref": "#/definitions/HogQLVariable" + }, + "description": "Variables to be subsituted into the query", + "type": "object" + } + }, + "required": ["kind", "query"], + "type": "object" + }, + "HogQLQueryModifiers": { + "additionalProperties": false, + "description": "HogQL Query Options are automatically set per team. However, they can be overridden in the query.", + "properties": { + "bounceRateDurationSeconds": { + "type": "number" + }, + "bounceRatePageViewMode": { + "enum": ["count_pageviews", "uniq_urls", "uniq_page_screen_autocaptures"], + "type": "string" + }, + "customChannelTypeRules": { + "items": { + "$ref": "#/definitions/CustomChannelRule" + }, + "type": "array" + }, + "dataWarehouseEventsModifiers": { + "items": { + "$ref": "#/definitions/DataWarehouseEventsModifier" + }, + "type": "array" + }, + "debug": { + "type": "boolean" + }, + "inCohortVia": { + "enum": ["auto", "leftjoin", "subquery", "leftjoin_conjoined"], + "type": "string" + }, + "materializationMode": { + "enum": ["auto", "legacy_null_as_string", "legacy_null_as_null", "disabled"], + "type": "string" + }, + "optimizeJoinedFilters": { + "type": "boolean" + }, + "personsArgMaxVersion": { + "enum": ["auto", "v1", "v2"], + "type": "string" + }, + "personsJoinMode": { + "enum": ["inner", "left"], + "type": "string" + }, + "personsOnEventsMode": { + "enum": [ + "disabled", + "person_id_no_override_properties_on_events", + "person_id_override_properties_on_events", + "person_id_override_properties_joined" + ], + "type": "string" + }, + "propertyGroupsMode": { + "enum": ["enabled", "disabled", "optimized"], + "type": "string" + }, + "s3TableUseInvalidColumns": { + "type": "boolean" + }, + "sessionTableVersion": { + "enum": ["auto", "v1", "v2"], + "type": "string" + }, + "useMaterializedViews": { + "type": "boolean" + } + }, + "type": "object" + }, + "HogQLQueryResponse": { + "additionalProperties": false, + "properties": { + "clickhouse": { + "description": "Executed ClickHouse query", + "type": "string" + }, + "columns": { + "description": "Returned columns", + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "explain": { + "description": "Query explanation output", + "items": { + "type": "string" + }, + "type": "array" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "metadata": { + "$ref": "#/definitions/HogQLMetadataResponse", + "description": "Query metadata output" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query": { + "description": "Input query string", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "description": "Types of returned columns", + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "HogQLVariable": { + "additionalProperties": false, + "properties": { + "code_name": { + "type": "string" + }, + "value": {}, + "variableId": { + "type": "string" + } + }, + "required": ["variableId", "code_name"], + "type": "object" + }, + "HogQuery": { + "additionalProperties": false, + "properties": { + "code": { + "type": "string" + }, + "kind": { + "const": "HogQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "response": { + "$ref": "#/definitions/HogQueryResponse" + } + }, + "required": ["kind"], + "type": "object" + }, + "HogQueryResponse": { + "additionalProperties": false, + "properties": { + "bytecode": { + "items": {}, + "type": "array" + }, + "coloredBytecode": { + "items": {}, + "type": "array" + }, + "results": {}, + "stdout": { + "type": "string" + } + }, + "required": ["results"], + "type": "object" + }, + "HumanMessage": { + "additionalProperties": false, + "properties": { + "content": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "const": "human", + "type": "string" + } + }, + "required": ["type", "content"], + "type": "object" + }, + "InsightActorsQuery": { + "additionalProperties": false, + "properties": { + "breakdown": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/BreakdownValueInt" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, + "compare": { + "enum": ["current", "previous"], + "type": "string" + }, + "day": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Day" + } + ] + }, + "includeRecordings": { + "type": "boolean" + }, + "interval": { + "$ref": "#/definitions/integer", + "description": "An interval selected out of available intervals in source query." + }, + "kind": { + "const": "InsightActorsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "response": { + "$ref": "#/definitions/ActorsQueryResponse" + }, + "series": { + "$ref": "#/definitions/integer" + }, + "source": { + "$ref": "#/definitions/InsightQuerySource" + }, + "status": { + "type": "string" + } + }, + "required": ["kind", "source"], + "type": "object" + }, + "InsightActorsQueryBase": { + "additionalProperties": false, + "properties": { + "includeRecordings": { + "type": "boolean" + }, + "kind": { + "$ref": "#/definitions/NodeKind" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "response": { + "$ref": "#/definitions/ActorsQueryResponse" + } + }, + "required": ["kind"], + "type": "object" + }, + "InsightActorsQueryOptions": { + "additionalProperties": false, + "properties": { + "kind": { + "const": "InsightActorsQueryOptions", + "type": "string" + }, + "response": { + "$ref": "#/definitions/InsightActorsQueryOptionsResponse" + }, + "source": { + "anyOf": [ + { + "$ref": "#/definitions/InsightActorsQuery" + }, + { + "$ref": "#/definitions/FunnelsActorsQuery" + }, + { + "$ref": "#/definitions/FunnelCorrelationActorsQuery" + } + ] + } + }, + "required": ["kind", "source"], + "type": "object" + }, + "InsightActorsQueryOptionsResponse": { + "additionalProperties": false, + "properties": { + "breakdown": { + "items": { + "$ref": "#/definitions/BreakdownItem" + }, + "type": "array" + }, + "breakdowns": { + "items": { + "$ref": "#/definitions/MultipleBreakdownOptions" + }, + "type": "array" + }, + "compare": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "day": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/DatetimeDay" + }, + { + "$ref": "#/definitions/Day" + } + ] + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "interval": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/integer", + "description": "An interval selected out of available intervals in source query" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "series": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/integer" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "status": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "InsightFilter": { + "anyOf": [ + { + "$ref": "#/definitions/TrendsFilter" + }, + { + "$ref": "#/definitions/FunnelsFilter" + }, + { + "$ref": "#/definitions/RetentionFilter" + }, + { + "$ref": "#/definitions/PathsFilter" + }, + { + "$ref": "#/definitions/StickinessFilter" + }, + { + "$ref": "#/definitions/LifecycleFilter" + } + ] + }, + "InsightFilterProperty": { + "enum": [ + "trendsFilter", + "funnelsFilter", + "retentionFilter", + "pathsFilter", + "stickinessFilter", + "lifecycleFilter" + ], + "type": "string" + }, + "InsightNodeKind": { + "enum": [ + "TrendsQuery", + "FunnelsQuery", + "RetentionQuery", + "PathsQuery", + "StickinessQuery", + "LifecycleQuery" + ], + "type": "string" + }, + "InsightQueryNode": { + "discriminator": { + "propertyName": "kind" + }, + "oneOf": [ + { + "$ref": "#/definitions/TrendsQuery" + }, + { + "$ref": "#/definitions/FunnelsQuery" + }, + { + "$ref": "#/definitions/RetentionQuery" + }, + { + "$ref": "#/definitions/PathsQuery" + }, + { + "$ref": "#/definitions/StickinessQuery" + }, + { + "$ref": "#/definitions/LifecycleQuery" + } + ], + "required": ["kind"], + "type": "object" + }, + "InsightQuerySource": { + "$ref": "#/definitions/InsightQueryNode" + }, + "InsightShortId": { + "type": "string" + }, + "InsightThreshold": { + "additionalProperties": false, + "properties": { + "bounds": { + "$ref": "#/definitions/InsightsThresholdBounds" + }, + "type": { + "$ref": "#/definitions/InsightThresholdType" + } + }, + "required": ["type"], + "type": "object" + }, + "InsightThresholdType": { + "enum": ["absolute", "percentage"], + "type": "string" + }, + "InsightVizNode": { + "additionalProperties": false, + "properties": { + "embedded": { + "description": "Query is embedded inside another bordered component", + "type": "boolean" + }, + "full": { + "description": "Show with most visual options enabled. Used in insight scene.", + "type": "boolean" + }, + "hidePersonsModal": { + "type": "boolean" + }, + "kind": { + "const": "InsightVizNode", + "type": "string" + }, + "showCorrelationTable": { + "type": "boolean" + }, + "showFilters": { + "type": "boolean" + }, + "showHeader": { + "type": "boolean" + }, + "showLastComputation": { + "type": "boolean" + }, + "showLastComputationRefresh": { + "type": "boolean" + }, + "showResults": { + "type": "boolean" + }, + "showTable": { + "type": "boolean" + }, + "source": { + "$ref": "#/definitions/InsightQueryNode" + }, + "suppressSessionAnalysisWarning": { + "type": "boolean" + }, + "vizSpecificOptions": { + "$ref": "#/definitions/VizSpecificOptions" + } + }, + "required": ["kind", "source"], + "type": "object" + }, + "InsightsQueryBase": { + "additionalProperties": false, + "description": "Base class for insight query nodes. Should not be used directly.", + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "kind": { + "$ref": "#/definitions/NodeKind" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/FunnelsQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + } + }, + "required": ["kind"], + "type": "object" + }, + "InsightsQueryBase": { + "additionalProperties": false, + "description": "Base class for insight query nodes. Should not be used directly.", + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "kind": { + "$ref": "#/definitions/NodeKind" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/LifecycleQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + } + }, + "required": ["kind"], + "type": "object" + }, + "InsightsQueryBase": { + "additionalProperties": false, + "description": "Base class for insight query nodes. Should not be used directly.", + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "kind": { + "$ref": "#/definitions/NodeKind" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/PathsQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + } + }, + "required": ["kind"], + "type": "object" + }, + "InsightsQueryBase": { + "additionalProperties": false, + "description": "Base class for insight query nodes. Should not be used directly.", + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "kind": { + "$ref": "#/definitions/NodeKind" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/RetentionQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + } + }, + "required": ["kind"], + "type": "object" + }, + "InsightsQueryBase": { + "additionalProperties": false, + "description": "Base class for insight query nodes. Should not be used directly.", + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "kind": { + "$ref": "#/definitions/NodeKind" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/TrendsQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + } + }, + "required": ["kind"], + "type": "object" + }, + "InsightsThresholdBounds": { + "additionalProperties": false, + "properties": { + "lower": { + "type": "number" + }, + "upper": { + "type": "number" + } + }, + "type": "object" + }, + "IntervalType": { + "enum": ["minute", "hour", "day", "week", "month"], + "type": "string" + }, + "LifecycleFilter": { + "additionalProperties": false, + "properties": { + "showLegend": { + "default": false, + "type": "boolean" + }, + "showValuesOnSeries": { + "type": "boolean" + }, + "toggledLifecycles": { + "items": { + "$ref": "#/definitions/LifecycleToggle" + }, + "type": "array" + } + }, + "type": "object" + }, + "LifecycleFilterLegacy": { + "additionalProperties": false, + "description": "`LifecycleFilterType` minus everything inherited from `FilterType`", + "properties": { + "show_legend": { + "type": "boolean" + }, + "show_values_on_series": { + "type": "boolean" + }, + "toggledLifecycles": { + "items": { + "$ref": "#/definitions/LifecycleToggle" + }, + "type": "array" + } + }, + "type": "object" + }, + "LifecycleQuery": { + "additionalProperties": false, + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "interval": { + "$ref": "#/definitions/IntervalType", + "default": "day", + "description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`" + }, + "kind": { + "const": "LifecycleQuery", + "type": "string" + }, + "lifecycleFilter": { + "$ref": "#/definitions/LifecycleFilter", + "description": "Properties specific to the lifecycle insight" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/LifecycleQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + }, + "series": { + "description": "Events and actions to include", + "items": { + "$ref": "#/definitions/AnyEntityNode" + }, + "type": "array" + } + }, + "required": ["kind", "series"], + "type": "object" + }, + "LifecycleQueryResponse": { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "LifecycleToggle": { + "enum": ["new", "resurrecting", "returning", "dormant"], + "type": "string" + }, + "LogEntryPropertyFilter": { + "additionalProperties": false, + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator" + }, + "type": { + "const": "log_entry", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "MatchedRecording": { + "additionalProperties": false, + "properties": { + "events": { + "items": { + "$ref": "#/definitions/MatchedRecordingEvent" + }, + "type": "array" + }, + "session_id": { + "type": "string" + } + }, + "required": ["events"], + "type": "object" + }, + "MatchedRecordingEvent": { + "additionalProperties": false, + "properties": { + "uuid": { + "type": "string" + } + }, + "required": ["uuid"], + "type": "object" + }, + "MathType": { + "anyOf": [ + { + "$ref": "#/definitions/BaseMathType" + }, + { + "$ref": "#/definitions/FunnelMathType" + }, + { + "$ref": "#/definitions/PropertyMathType" + }, + { + "$ref": "#/definitions/CountPerActorMathType" + }, + { + "$ref": "#/definitions/GroupMathType" + }, + { + "$ref": "#/definitions/HogQLMathType" + } + ] + }, + "MultipleBreakdownOptions": { + "additionalProperties": false, + "properties": { + "values": { + "items": { + "$ref": "#/definitions/BreakdownItem" + }, + "type": "array" + } + }, + "required": ["values"], + "type": "object" + }, + "MultipleBreakdownType": { + "enum": ["person", "event", "group", "session", "hogql"], + "type": "string" + }, + "NodeKind": { + "description": "PostHog Query Schema definition.\n\nThis file acts as the source of truth for:\n\n- frontend/src/queries/schema.json - generated from typescript via \"pnpm run schema:build:json\"\n\n- posthog/schema.py - generated from json the above json via \"pnpm run schema:build:python\"", + "enum": [ + "EventsNode", + "ActionsNode", + "DataWarehouseNode", + "EventsQuery", + "PersonsNode", + "HogQuery", + "HogQLQuery", + "HogQLMetadata", + "HogQLAutocomplete", + "ActorsQuery", + "FunnelsActorsQuery", + "FunnelCorrelationActorsQuery", + "SessionsTimelineQuery", + "RecordingsQuery", + "SessionAttributionExplorerQuery", + "ErrorTrackingQuery", + "DataTableNode", + "DataVisualizationNode", + "SavedInsightNode", + "InsightVizNode", + "TrendsQuery", + "FunnelsQuery", + "RetentionQuery", + "PathsQuery", + "StickinessQuery", + "LifecycleQuery", + "InsightActorsQuery", + "InsightActorsQueryOptions", + "FunnelCorrelationQuery", + "WebOverviewQuery", + "WebStatsTableQuery", + "WebExternalClicksTableQuery", + "WebGoalsQuery", + "ExperimentFunnelsQuery", + "ExperimentTrendsQuery", + "DatabaseSchemaQuery", + "SuggestedQuestionsQuery", + "TeamTaxonomyQuery", + "EventTaxonomyQuery", + "ActorsPropertyTaxonomyQuery" + ], + "type": "string" + }, + "PathCleaningFilter": { + "additionalProperties": false, + "properties": { + "alias": { + "type": "string" + }, + "regex": { + "type": "string" + } + }, + "type": "object" + }, + "PathType": { + "enum": ["$pageview", "$screen", "custom_event", "hogql"], + "type": "string" + }, + "PathsFilter": { + "additionalProperties": false, + "properties": { + "edgeLimit": { + "$ref": "#/definitions/integer", + "default": 50 + }, + "endPoint": { + "type": "string" + }, + "excludeEvents": { + "items": { + "type": "string" + }, + "type": "array" + }, + "includeEventTypes": { + "items": { + "$ref": "#/definitions/PathType" + }, + "type": "array" + }, + "localPathCleaningFilters": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/PathCleaningFilter" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "maxEdgeWeight": { + "type": "integer" + }, + "minEdgeWeight": { + "type": "integer" + }, + "pathDropoffKey": { + "description": "Relevant only within actors query", + "type": "string" + }, + "pathEndKey": { + "description": "Relevant only within actors query", + "type": "string" + }, + "pathGroupings": { + "items": { + "type": "string" + }, + "type": "array" + }, + "pathReplacements": { + "type": "boolean" + }, + "pathStartKey": { + "description": "Relevant only within actors query", + "type": "string" + }, + "pathsHogQLExpression": { + "type": "string" + }, + "startPoint": { + "type": "string" + }, + "stepLimit": { + "$ref": "#/definitions/integer", + "default": 5 + } + }, + "type": "object" + }, + "PathsFilterLegacy": { + "additionalProperties": false, + "description": "`PathsFilterType` minus everything inherited from `FilterType` and persons modal related params", + "properties": { + "edge_limit": { + "type": "integer" + }, + "end_point": { + "type": "string" + }, + "exclude_events": { + "items": { + "type": "string" + }, + "type": "array" + }, + "funnel_filter": { + "type": "object" + }, + "funnel_paths": { + "$ref": "#/definitions/FunnelPathType" + }, + "include_event_types": { + "items": { + "$ref": "#/definitions/PathType" + }, + "type": "array" + }, + "local_path_cleaning_filters": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/PathCleaningFilter" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "max_edge_weight": { + "type": "integer" + }, + "min_edge_weight": { + "type": "integer" + }, + "path_groupings": { + "items": { + "type": "string" + }, + "type": "array" + }, + "path_replacements": { + "type": "boolean" + }, + "path_type": { + "$ref": "#/definitions/PathType" + }, + "paths_hogql_expression": { + "type": "string" + }, + "start_point": { + "type": "string" + }, + "step_limit": { + "type": "integer" + } + }, + "type": "object" + }, + "PathsQuery": { + "additionalProperties": false, + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "funnelPathsFilter": { + "$ref": "#/definitions/FunnelPathsFilter", + "description": "Used for displaying paths in relation to funnel steps." + }, + "kind": { + "const": "PathsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "pathsFilter": { + "$ref": "#/definitions/PathsFilter", + "description": "Properties specific to the paths insight" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/PathsQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + } + }, + "required": ["kind", "pathsFilter"], + "type": "object" + }, + "PathsQueryResponse": { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "PersonPropertyFilter": { + "additionalProperties": false, + "description": "Sync with plugin-server/src/types.ts", + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator" + }, + "type": { + "const": "person", + "description": "Person properties", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "PersonType": { + "additionalProperties": false, + "properties": { + "created_at": { + "type": "string" + }, + "distinct_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "is_identified": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "properties": { + "type": "object" + }, + "uuid": { + "type": "string" + } + }, + "required": ["distinct_ids", "properties"], + "type": "object" + }, + "PersonsNode": { + "additionalProperties": false, + "deprecated": "Use `ActorsQuery` instead.", + "properties": { + "cohort": { + "$ref": "#/definitions/integer" + }, + "distinctId": { + "type": "string" + }, + "fixedProperties": { + "description": "Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "kind": { + "const": "PersonsNode", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "properties": { + "description": "Properties configurable in the interface", + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "response": { + "type": "object" + }, + "search": { + "type": "string" + } + }, + "required": ["kind"], + "type": "object" + }, + "PropertyFilterType": { + "enum": [ + "meta", + "event", + "person", + "element", + "feature", + "session", + "cohort", + "recording", + "log_entry", + "group", + "hogql", + "data_warehouse", + "data_warehouse_person_property" + ], + "type": "string" + }, + "PropertyFilterValue": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "items": { + "type": ["string", "number"] + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "PropertyGroupFilter": { + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/definitions/FilterLogicalOperator" + }, + "values": { + "items": { + "$ref": "#/definitions/PropertyGroupFilterValue" + }, + "type": "array" + } + }, + "required": ["type", "values"], + "type": "object" + }, + "PropertyGroupFilterValue": { + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/definitions/FilterLogicalOperator" + }, + "values": { + "items": { + "anyOf": [ + { + "$ref": "#/definitions/AnyPropertyFilter" + }, + { + "$ref": "#/definitions/PropertyGroupFilterValue" + } + ] + }, + "type": "array" + } + }, + "required": ["type", "values"], + "type": "object" + }, + "PropertyMathType": { + "enum": ["avg", "sum", "min", "max", "median", "p90", "p95", "p99"], + "type": "string" + }, + "PropertyOperator": { + "description": "Sync with plugin-server/src/types.ts", + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in" + ], + "type": "string" + }, + "QueryRequest": { + "additionalProperties": false, + "properties": { + "async": { + "deprecated": "Use `refresh` instead.", + "type": "boolean" + }, + "client_query_id": { + "description": "Client provided query ID. Can be used to retrieve the status or cancel the query.", + "type": "string" + }, + "filters_override": { + "$ref": "#/definitions/DashboardFilter" + }, + "query": { + "$ref": "#/definitions/QuerySchema", + "description": "Submit a JSON string representing a query for PostHog data analysis, for example a HogQL query.\n\nExample payload:\n\n```\n\n{\"query\": {\"kind\": \"HogQLQuery\", \"query\": \"select * from events limit 100\"}}\n\n```\n\nFor more details on HogQL queries, see the [PostHog HogQL documentation](/docs/hogql#api-access)." + }, + "refresh": { + "$ref": "#/definitions/RefreshType", + "default": "blocking", + "description": "Whether results should be calculated sync or async, and how much to rely on the cache:\n- `'blocking'` - calculate synchronously (returning only when the query is done), UNLESS there are very fresh results in the cache\n- `'async'` - kick off background calculation (returning immediately with a query status), UNLESS there are very fresh results in the cache\n- `'lazy_async'` - kick off background calculation, UNLESS there are somewhat fresh results in the cache\n- `'force_blocking'` - calculate synchronously, even if fresh results are already cached\n- `'force_async'` - kick off background calculation, even if fresh results are already cached\n- `'force_cache'` - return cached data or a cache miss; always completes immediately as it never calculates Background calculation can be tracked using the `query_status` response field." + }, + "variables_override": { + "additionalProperties": { + "type": "object" + }, + "type": "object" + } + }, + "required": ["query"], + "type": "object" + }, + "QueryResponseAlternative": { + "anyOf": [ + { + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["columns", "hogql", "results", "types"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "missing_actors_count": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["columns", "hogql", "limit", "offset", "results", "types"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "breakdown": { + "items": { + "$ref": "#/definitions/BreakdownItem" + }, + "type": "array" + }, + "breakdowns": { + "items": { + "$ref": "#/definitions/MultipleBreakdownOptions" + }, + "type": "array" + }, + "compare": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "day": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/DatetimeDay" + }, + { + "$ref": "#/definitions/Day" + } + ] + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "interval": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/integer", + "description": "An interval selected out of available intervals in source query" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "series": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/integer" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + }, + "status": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["label", "value"], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/TimelineEntry" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "bytecode": { + "items": {}, + "type": "array" + }, + "coloredBytecode": { + "items": {}, + "type": "array" + }, + "results": {}, + "stdout": { + "type": "string" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "clickhouse": { + "description": "Executed ClickHouse query", + "type": "string" + }, + "columns": { + "description": "Returned columns", + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "explain": { + "description": "Query explanation output", + "items": { + "type": "string" + }, + "type": "array" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "metadata": { + "$ref": "#/definitions/HogQLMetadataResponse", + "description": "Query metadata output" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query": { + "description": "Input query string", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "description": "Types of returned columns", + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "errors": { + "items": { + "$ref": "#/definitions/HogQLNotice" + }, + "type": "array" + }, + "isValid": { + "type": "boolean" + }, + "isValidView": { + "type": "boolean" + }, + "notices": { + "items": { + "$ref": "#/definitions/HogQLNotice" + }, + "type": "array" + }, + "query": { + "type": "string" + }, + "table_names": { + "items": { + "type": "string" + }, + "type": "array" + }, + "warnings": { + "items": { + "$ref": "#/definitions/HogQLNotice" + }, + "type": "array" + } + }, + "required": ["errors", "warnings", "notices"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "incomplete_list": { + "description": "Whether or not the suggestions returned are complete", + "type": "boolean" + }, + "suggestions": { + "items": { + "$ref": "#/definitions/AutocompleteCompletionItem" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["suggestions", "incomplete_list"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "dateFrom": { + "type": "string" + }, + "dateTo": { + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/WebOverviewItem" + }, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": {}, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/ErrorTrackingIssue" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "expected_loss": { + "type": "number" + }, + "funnels_query": { + "$ref": "#/definitions/FunnelsQuery" + }, + "insight": { + "items": { + "items": { + "type": "object" + }, + "type": "array" + }, + "type": "array" + }, + "kind": { + "const": "ExperimentFunnelsQuery", + "type": "string" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantFunnelsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "kind", + "insight", + "variants", + "probability", + "significant", + "significance_code", + "expected_loss", + "credible_intervals" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "count_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "exposure_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "insight": { + "items": { + "type": "object" + }, + "type": "array" + }, + "kind": { + "const": "ExperimentTrendsQuery", + "type": "string" + }, + "p_value": { + "type": "number" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantTrendsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "kind", + "insight", + "variants", + "probability", + "significant", + "significance_code", + "p_value", + "credible_intervals" + ], + "type": "object" + }, + { + "properties": {}, + "type": "object" + }, + { + "not": {} + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["columns", "hogql", "results", "types"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "missing_actors_count": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "items": {}, + "type": "array" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["columns", "hogql", "limit", "offset", "results", "types"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "clickhouse": { + "description": "Executed ClickHouse query", + "type": "string" + }, + "columns": { + "description": "Returned columns", + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "explain": { + "description": "Query explanation output", + "items": { + "type": "string" + }, + "type": "array" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "metadata": { + "$ref": "#/definitions/HogQLMetadataResponse", + "description": "Query metadata output" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query": { + "description": "Input query string", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "description": "Types of returned columns", + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "dateFrom": { + "type": "string" + }, + "dateTo": { + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/WebOverviewItem" + }, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": {}, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/ErrorTrackingIssue" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "expected_loss": { + "type": "number" + }, + "funnels_query": { + "$ref": "#/definitions/FunnelsQuery" + }, + "insight": { + "items": { + "items": { + "type": "object" + }, + "type": "array" + }, + "type": "array" + }, + "kind": { + "const": "ExperimentFunnelsQuery", + "type": "string" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantFunnelsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "credible_intervals", + "expected_loss", + "insight", + "kind", + "probability", + "significance_code", + "significant", + "variants" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "count_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "credible_intervals": { + "additionalProperties": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "object" + }, + "exposure_query": { + "$ref": "#/definitions/TrendsQuery" + }, + "insight": { + "items": { + "type": "object" + }, + "type": "array" + }, + "kind": { + "const": "ExperimentTrendsQuery", + "type": "string" + }, + "p_value": { + "type": "number" + }, + "probability": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "significance_code": { + "$ref": "#/definitions/ExperimentSignificanceCode" + }, + "significant": { + "type": "boolean" + }, + "stats_version": { + "$ref": "#/definitions/integer" + }, + "variants": { + "items": { + "$ref": "#/definitions/ExperimentVariantTrendsBaseStats" + }, + "type": "array" + } + }, + "required": [ + "credible_intervals", + "insight", + "kind", + "p_value", + "probability", + "significance_code", + "significant", + "variants" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "description": "Wether more breakdown values are available.", + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "isUdf": { + "type": "boolean" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "anyOf": [ + { + "$ref": "#/definitions/FunnelStepsResults" + }, + { + "$ref": "#/definitions/FunnelStepsBreakdownResults" + }, + { + "$ref": "#/definitions/FunnelTimeToConvertResults" + }, + { + "$ref": "#/definitions/FunnelTrendsResults" + } + ] + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/RetentionResult" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/FunnelCorrelationResult" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "tables": { + "additionalProperties": { + "$ref": "#/definitions/DatabaseSchemaTable" + }, + "type": "object" + } + }, + "required": ["tables"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "questions": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["questions"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/TeamTaxonomyResponse" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/EventTaxonomyResponse" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/ActorsPropertyTaxonomyResponse" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + } + ] + }, + "QuerySchema": { + "discriminator": { + "propertyName": "kind" + }, + "oneOf": [ + { + "$ref": "#/definitions/EventsNode" + }, + { + "$ref": "#/definitions/ActionsNode" + }, + { + "$ref": "#/definitions/PersonsNode" + }, + { + "$ref": "#/definitions/DataWarehouseNode" + }, + { + "$ref": "#/definitions/EventsQuery" + }, + { + "$ref": "#/definitions/ActorsQuery" + }, + { + "$ref": "#/definitions/InsightActorsQuery" + }, + { + "$ref": "#/definitions/InsightActorsQueryOptions" + }, + { + "$ref": "#/definitions/SessionsTimelineQuery" + }, + { + "$ref": "#/definitions/HogQuery" + }, + { + "$ref": "#/definitions/HogQLQuery" + }, + { + "$ref": "#/definitions/HogQLMetadata" + }, + { + "$ref": "#/definitions/HogQLAutocomplete" + }, + { + "$ref": "#/definitions/WebOverviewQuery" + }, + { + "$ref": "#/definitions/WebStatsTableQuery" + }, + { + "$ref": "#/definitions/WebExternalClicksTableQuery" + }, + { + "$ref": "#/definitions/WebGoalsQuery" + }, + { + "$ref": "#/definitions/SessionAttributionExplorerQuery" + }, + { + "$ref": "#/definitions/ErrorTrackingQuery" + }, + { + "$ref": "#/definitions/ExperimentFunnelsQuery" + }, + { + "$ref": "#/definitions/ExperimentTrendsQuery" + }, + { + "$ref": "#/definitions/DataVisualizationNode" + }, + { + "$ref": "#/definitions/DataTableNode" + }, + { + "$ref": "#/definitions/SavedInsightNode" + }, + { + "$ref": "#/definitions/InsightVizNode" + }, + { + "$ref": "#/definitions/TrendsQuery" + }, + { + "$ref": "#/definitions/FunnelsQuery" + }, + { + "$ref": "#/definitions/RetentionQuery" + }, + { + "$ref": "#/definitions/PathsQuery" + }, + { + "$ref": "#/definitions/StickinessQuery" + }, + { + "$ref": "#/definitions/LifecycleQuery" + }, + { + "$ref": "#/definitions/FunnelCorrelationQuery" + }, + { + "$ref": "#/definitions/DatabaseSchemaQuery" + }, + { + "$ref": "#/definitions/SuggestedQuestionsQuery" + }, + { + "$ref": "#/definitions/TeamTaxonomyQuery" + }, + { + "$ref": "#/definitions/EventTaxonomyQuery" + }, + { + "$ref": "#/definitions/ActorsPropertyTaxonomyQuery" + } + ], + "required": ["kind"], + "type": "object" + }, + "QuerySchemaRoot": { + "$ref": "#/definitions/QuerySchema" + }, + "QueryStatus": { + "additionalProperties": false, + "properties": { + "complete": { + "default": false, + "description": "Whether the query is still running. Will be true if the query is complete, even if it errored. Either result or error will be set.", + "type": "boolean" + }, + "dashboard_id": { + "$ref": "#/definitions/integer" + }, + "end_time": { + "description": "When did the query execution task finish (whether successfully or not).", + "format": "date-time", + "type": "string" + }, + "error": { + "default": false, + "description": "If the query failed, this will be set to true. More information can be found in the error_message field.", + "type": "boolean" + }, + "error_message": { + "default": null, + "type": ["string", "null"] + }, + "expiration_time": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "insight_id": { + "$ref": "#/definitions/integer" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "pickup_time": { + "description": "When was the query execution task picked up by a worker.", + "format": "date-time", + "type": "string" + }, + "query_async": { + "const": true, + "default": true, + "description": "ONLY async queries use QueryStatus.", + "type": "boolean" + }, + "query_progress": { + "$ref": "#/definitions/ClickhouseQueryProgress" + }, + "results": {}, + "start_time": { + "description": "When was query execution task enqueued.", + "format": "date-time", + "type": "string" + }, + "task_id": { + "type": "string" + }, + "team_id": { + "$ref": "#/definitions/integer" + } + }, + "required": ["id", "query_async", "team_id", "error", "complete", "error_message"], + "type": "object" + }, + "QueryStatusResponse": { + "additionalProperties": false, + "properties": { + "query_status": { + "$ref": "#/definitions/QueryStatus" + } + }, + "required": ["query_status"], + "type": "object" + }, + "QueryTiming": { + "additionalProperties": false, + "properties": { + "k": { + "description": "Key. Shortened to 'k' to save on data.", + "type": "string" + }, + "t": { + "description": "Time in seconds. Shortened to 't' to save on data.", + "type": "number" + } + }, + "required": ["k", "t"], + "type": "object" + }, + "ReasoningMessage": { + "additionalProperties": false, + "properties": { + "content": { + "type": "string" + }, + "id": { + "type": "string" + }, + "substeps": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "const": "ai/reasoning", + "type": "string" + } + }, + "required": ["type", "content"], + "type": "object" + }, + "RecordingOrder": { + "enum": [ + "duration", + "recording_duration", + "inactive_seconds", + "active_seconds", + "start_time", + "console_error_count", + "click_count", + "keypress_count", + "mouse_activity_count", + "activity_score" + ], + "type": "string" + }, + "RecordingPropertyFilter": { + "additionalProperties": false, + "properties": { + "key": { + "anyOf": [ + { + "$ref": "#/definitions/DurationType" + }, + { + "const": "snapshot_source", + "type": "string" + }, + { + "const": "visited_page", + "type": "string" + } + ] + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator" + }, + "type": { + "const": "recording", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "RecordingsQuery": { + "additionalProperties": false, + "properties": { + "actions": { + "items": { + "type": "object" + }, + "type": "array" + }, + "console_log_filters": { + "items": { + "$ref": "#/definitions/LogEntryPropertyFilter" + }, + "type": "array" + }, + "date_from": { + "default": "-3d", + "type": ["string", "null"] + }, + "date_to": { + "type": ["string", "null"] + }, + "events": { + "items": { + "type": "object" + }, + "type": "array" + }, + "filter_test_accounts": { + "type": "boolean" + }, + "having_predicates": { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "kind": { + "const": "RecordingsQuery", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "operand": { + "$ref": "#/definitions/FilterLogicalOperator", + "default": "AND" + }, + "order": { + "$ref": "#/definitions/RecordingOrder", + "default": "start_time" + }, + "person_uuid": { + "type": "string" + }, + "properties": { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + "response": { + "$ref": "#/definitions/RecordingsQueryResponse" + }, + "session_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "user_modified_filters": { + "type": "object" + } + }, + "required": ["kind"], + "type": "object" + }, + "RecordingsQueryResponse": { + "additionalProperties": false, + "properties": { + "has_next": { + "type": "boolean" + }, + "results": { + "items": { + "$ref": "#/definitions/SessionRecordingType" + }, + "type": "array" + } + }, + "required": ["results", "has_next"], + "type": "object" + }, + "RefreshType": { + "anyOf": [ + { + "type": "boolean" + }, + { + "const": "async", + "type": "string" + }, + { + "const": "async_except_on_cache_miss", + "type": "string" + }, + { + "const": "blocking", + "type": "string" + }, + { + "const": "force_async", + "type": "string" + }, + { + "const": "force_blocking", + "type": "string" + }, + { + "const": "force_cache", + "type": "string" + }, + { + "const": "lazy_async", + "type": "string" + } + ] + }, + "ResultCustomization": { + "anyOf": [ + { + "$ref": "#/definitions/ResultCustomizationByValue" + }, + { + "$ref": "#/definitions/ResultCustomizationByPosition" + } + ] + }, + "ResultCustomizationBase": { + "additionalProperties": false, + "properties": { + "color": { + "$ref": "#/definitions/DataColorToken" + } + }, + "required": ["color"], + "type": "object" + }, + "ResultCustomizationBy": { + "enum": ["value", "position"], + "type": "string" + }, + "ResultCustomizationByPosition": { + "additionalProperties": false, + "properties": { + "assignmentBy": { + "const": "position", + "type": "string" + }, + "color": { + "$ref": "#/definitions/DataColorToken" + } + }, + "required": ["assignmentBy", "color"], + "type": "object" + }, + "ResultCustomizationByValue": { + "additionalProperties": false, + "properties": { + "assignmentBy": { + "const": "value", + "type": "string" + }, + "color": { + "$ref": "#/definitions/DataColorToken" + } + }, + "required": ["assignmentBy", "color"], + "type": "object" + }, + "RetentionEntity": { + "additionalProperties": false, + "properties": { + "custom_name": { + "type": "string" + }, + "id": { + "type": ["string", "number"] + }, + "kind": { + "$ref": "#/definitions/RetentionEntityKind" + }, + "name": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "type": { + "$ref": "#/definitions/EntityType" + }, + "uuid": { + "type": "string" + } + }, + "type": "object" + }, + "RetentionEntityKind": { + "enum": ["ActionsNode", "EventsNode"], + "type": "string" + }, + "RetentionFilter": { + "additionalProperties": false, + "properties": { + "cumulative": { + "type": "boolean" + }, + "period": { + "$ref": "#/definitions/RetentionPeriod", + "default": "Day" + }, + "retentionReference": { + "description": "Whether retention is with regard to initial cohort size, or that of the previous period.", + "enum": ["total", "previous"], + "type": "string" + }, + "retentionType": { + "$ref": "#/definitions/RetentionType" + }, + "returningEntity": { + "$ref": "#/definitions/RetentionEntity" + }, + "showMean": { + "type": "boolean" + }, + "targetEntity": { + "$ref": "#/definitions/RetentionEntity" + }, + "totalIntervals": { + "$ref": "#/definitions/integer", + "default": 11 + } + }, + "type": "object" + }, + "RetentionFilterLegacy": { + "additionalProperties": false, + "description": "`RetentionFilterType` minus everything inherited from `FilterType`", + "properties": { + "cumulative": { + "type": "boolean" + }, + "period": { + "$ref": "#/definitions/RetentionPeriod" + }, + "retention_reference": { + "description": "Whether retention is with regard to initial cohort size, or that of the previous period.", + "enum": ["total", "previous"], + "type": "string" + }, + "retention_type": { + "$ref": "#/definitions/RetentionType" + }, + "returning_entity": { + "$ref": "#/definitions/RetentionEntity" + }, + "show_mean": { + "type": "boolean" + }, + "target_entity": { + "$ref": "#/definitions/RetentionEntity" + }, + "total_intervals": { + "type": "integer" + } + }, + "type": "object" + }, + "RetentionPeriod": { + "enum": ["Hour", "Day", "Week", "Month"], + "type": "string" + }, + "RetentionQuery": { + "additionalProperties": false, + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "kind": { + "const": "RetentionQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/RetentionQueryResponse" + }, + "retentionFilter": { + "$ref": "#/definitions/RetentionFilter", + "description": "Properties specific to the retention insight" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + } + }, + "required": ["kind", "retentionFilter"], + "type": "object" + }, + "RetentionQueryResponse": { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/RetentionResult" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "RetentionResult": { + "additionalProperties": false, + "properties": { + "date": { + "format": "date-time", + "type": "string" + }, + "label": { + "type": "string" + }, + "values": { + "items": { + "$ref": "#/definitions/RetentionValue" + }, + "type": "array" + } + }, + "required": ["values", "label", "date"], + "type": "object" + }, + "RetentionType": { + "enum": ["retention_recurring", "retention_first_time"], + "type": "string" + }, + "RetentionValue": { + "additionalProperties": false, + "properties": { + "count": { + "$ref": "#/definitions/integer" + } + }, + "required": ["count"], + "type": "object" + }, + "RootAssistantMessage": { + "anyOf": [ + { + "$ref": "#/definitions/VisualizationMessage" + }, + { + "$ref": "#/definitions/ReasoningMessage" + }, + { + "$ref": "#/definitions/AssistantMessage" + }, + { + "$ref": "#/definitions/HumanMessage" + }, + { + "$ref": "#/definitions/FailureMessage" + }, + { + "$ref": "#/definitions/RouterMessage" + } + ] + }, + "RouterMessage": { + "additionalProperties": false, + "properties": { + "content": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "const": "ai/router", + "type": "string" + } + }, + "required": ["type", "content"], + "type": "object" + }, + "SamplingRate": { + "additionalProperties": false, + "properties": { + "denominator": { + "type": "number" + }, + "numerator": { + "type": "number" + } + }, + "required": ["numerator"], + "type": "object" + }, + "SavedInsightNode": { + "additionalProperties": false, + "properties": { + "allowSorting": { + "description": "Can the user click on column headers to sort the table? (default: true)", + "type": "boolean" + }, + "embedded": { + "description": "Query is embedded inside another bordered component", + "type": "boolean" + }, + "expandable": { + "description": "Can expand row to show raw event data (default: true)", + "type": "boolean" + }, + "full": { + "description": "Show with most visual options enabled. Used in insight scene.", + "type": "boolean" + }, + "hidePersonsModal": { + "type": "boolean" + }, + "kind": { + "const": "SavedInsightNode", + "type": "string" + }, + "propertiesViaUrl": { + "description": "Link properties via the URL (default: false)", + "type": "boolean" + }, + "shortId": { + "$ref": "#/definitions/InsightShortId" + }, + "showActions": { + "description": "Show the kebab menu at the end of the row", + "type": "boolean" + }, + "showColumnConfigurator": { + "description": "Show a button to configure the table's columns if possible", + "type": "boolean" + }, + "showCorrelationTable": { + "type": "boolean" + }, + "showDateRange": { + "description": "Show date range selector", + "type": "boolean" + }, + "showElapsedTime": { + "description": "Show the time it takes to run a query", + "type": "boolean" + }, + "showEventFilter": { + "description": "Include an event filter above the table (EventsNode only)", + "type": "boolean" + }, + "showExport": { + "description": "Show the export button", + "type": "boolean" + }, + "showFilters": { + "type": "boolean" + }, + "showHeader": { + "type": "boolean" + }, + "showHogQLEditor": { + "description": "Include a HogQL query editor above HogQL tables", + "type": "boolean" + }, + "showLastComputation": { + "type": "boolean" + }, + "showLastComputationRefresh": { + "type": "boolean" + }, + "showOpenEditorButton": { + "description": "Show a button to open the current query as a new insight. (default: true)", + "type": "boolean" + }, + "showPersistentColumnConfigurator": { + "description": "Show a button to configure and persist the table's default columns if possible", + "type": "boolean" + }, + "showPropertyFilter": { + "anyOf": [ + { + "type": "boolean" + }, + { + "items": { + "$ref": "#/definitions/TaxonomicFilterGroupType" + }, + "type": "array" + } + ], + "description": "Include a property filter above the table" + }, + "showReload": { + "description": "Show a reload button", + "type": "boolean" + }, + "showResults": { + "type": "boolean" + }, + "showResultsTable": { + "description": "Show a results table", + "type": "boolean" + }, + "showSavedQueries": { + "description": "Shows a list of saved queries", + "type": "boolean" + }, + "showSearch": { + "description": "Include a free text search field (PersonsNode only)", + "type": "boolean" + }, + "showTable": { + "type": "boolean" + }, + "showTestAccountFilters": { + "description": "Show filter to exclude test accounts", + "type": "boolean" + }, + "showTimings": { + "description": "Show a detailed query timing breakdown", + "type": "boolean" + }, + "suppressSessionAnalysisWarning": { + "type": "boolean" + }, + "vizSpecificOptions": { + "$ref": "#/definitions/VizSpecificOptions" + } + }, + "required": ["kind", "shortId"], + "type": "object" + }, + "SessionAttributionExplorerQuery": { + "additionalProperties": false, + "properties": { + "filters": { + "additionalProperties": false, + "properties": { + "dateRange": { + "$ref": "#/definitions/DateRange" + }, + "properties": { + "items": { + "$ref": "#/definitions/SessionPropertyFilter" + }, + "type": "array" + } + }, + "type": "object" + }, + "groupBy": { + "items": { + "$ref": "#/definitions/SessionAttributionGroupBy" + }, + "type": "array" + }, + "kind": { + "const": "SessionAttributionExplorerQuery", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "response": { + "$ref": "#/definitions/SessionAttributionExplorerQueryResponse" + } + }, + "required": ["groupBy", "kind"], + "type": "object" + }, + "SessionAttributionExplorerQueryResponse": { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": {}, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "SessionAttributionGroupBy": { + "enum": ["ChannelType", "Medium", "Source", "Campaign", "AdIds", "ReferringDomain", "InitialURL"], + "type": "string" + }, + "SessionPropertyFilter": { + "additionalProperties": false, + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/PropertyOperator" + }, + "type": { + "const": "session", + "type": "string" + }, + "value": { + "$ref": "#/definitions/PropertyFilterValue" + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + "SessionRecordingType": { + "additionalProperties": false, + "properties": { + "active_seconds": { + "type": "number" + }, + "activity_score": { + "description": "calculated on the backend so that we can sort by it, definition may change over time", + "type": "number" + }, + "click_count": { + "type": "number" + }, + "console_error_count": { + "type": "number" + }, + "console_log_count": { + "type": "number" + }, + "console_warn_count": { + "type": "number" + }, + "distinct_id": { + "type": "string" + }, + "email": { + "type": "string" + }, + "end_time": { + "description": "When the recording ends in ISO format.", + "type": "string" + }, + "id": { + "type": "string" + }, + "inactive_seconds": { + "type": "number" + }, + "keypress_count": { + "type": "number" + }, + "matching_events": { + "description": "List of matching events. *", + "items": { + "$ref": "#/definitions/MatchedRecording" + }, + "type": "array" + }, + "mouse_activity_count": { + "description": "count of all mouse activity in the recording, not just clicks", + "type": "number" + }, + "ongoing": { + "description": "whether we have received data for this recording in the last 5 minutes (assumes the recording was loaded from ClickHouse)\n*", + "type": "boolean" + }, + "person": { + "$ref": "#/definitions/PersonType" + }, + "recording_duration": { + "description": "Length of recording in seconds.", + "type": "number" + }, + "snapshot_source": { + "enum": ["web", "mobile", "unknown"], + "type": "string" + }, + "start_time": { + "description": "When the recording starts in ISO format.", + "type": "string" + }, + "start_url": { + "type": "string" + }, + "storage": { + "description": "Where this recording information was loaded from", + "enum": ["object_storage_lts", "object_storage"], + "type": "string" + }, + "summary": { + "type": "string" + }, + "viewed": { + "description": "Whether this recording has been viewed already.", + "type": "boolean" + } + }, + "required": ["id", "viewed", "recording_duration", "start_time", "end_time", "snapshot_source"], + "type": "object" + }, + "SessionsTimelineQuery": { + "additionalProperties": false, + "properties": { + "after": { + "description": "Only fetch sessions that started after this timestamp (default: '-24h')", + "type": "string" + }, + "before": { + "description": "Only fetch sessions that started before this timestamp (default: '+5s')", + "type": "string" + }, + "kind": { + "const": "SessionsTimelineQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "personId": { + "description": "Fetch sessions only for a given person", + "type": "string" + }, + "response": { + "$ref": "#/definitions/SessionsTimelineQueryResponse" + } + }, + "required": ["kind"], + "type": "object" + }, + "SessionsTimelineQueryResponse": { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/TimelineEntry" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "StepOrderValue": { + "enum": ["strict", "unordered", "ordered"], + "type": "string" + }, + "StickinessFilter": { + "additionalProperties": false, + "properties": { + "display": { + "$ref": "#/definitions/ChartDisplayType" + }, + "hiddenLegendIndexes": { + "items": { + "$ref": "#/definitions/integer" + }, + "type": "array" + }, + "showLegend": { + "type": "boolean" + }, + "showValuesOnSeries": { + "type": "boolean" + }, + "stickinessCriteria": { + "additionalProperties": false, + "properties": { + "operator": { + "$ref": "#/definitions/StickinessOperator" + }, + "value": { + "$ref": "#/definitions/integer" + } + }, + "required": ["operator", "value"], + "type": "object" + } + }, + "type": "object" + }, + "StickinessFilterLegacy": { + "additionalProperties": false, + "description": "`StickinessFilterType` minus everything inherited from `FilterType` and persons modal related params", + "properties": { + "compare": { + "type": "boolean" + }, + "compare_to": { + "type": "string" + }, + "display": { + "$ref": "#/definitions/ChartDisplayType" + }, + "hidden_legend_keys": { + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "not": {} + } + ] + }, + "type": "object" + }, + "show_legend": { + "type": "boolean" + }, + "show_values_on_series": { + "type": "boolean" + } + }, + "type": "object" + }, + "StickinessOperator": { + "enum": ["gte", "lte", "exact"], + "type": "string" + }, + "StickinessQuery": { + "additionalProperties": false, + "properties": { + "compareFilter": { + "$ref": "#/definitions/CompareFilter", + "description": "Compare to date range" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "interval": { + "$ref": "#/definitions/IntervalType", + "default": "day", + "description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`" + }, + "kind": { + "const": "StickinessQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/StickinessQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + }, + "series": { + "description": "Events and actions to include", + "items": { + "$ref": "#/definitions/AnyEntityNode" + }, + "type": "array" + }, + "stickinessFilter": { + "$ref": "#/definitions/StickinessFilter", + "description": "Properties specific to the stickiness insight" + } + }, + "required": ["kind", "series"], + "type": "object" + }, + "StickinessQueryResponse": { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "SuggestedQuestionsQuery": { + "additionalProperties": false, + "properties": { + "kind": { + "const": "SuggestedQuestionsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "response": { + "$ref": "#/definitions/SuggestedQuestionsQueryResponse" + } + }, + "required": ["kind"], + "type": "object" + }, + "SuggestedQuestionsQueryResponse": { + "additionalProperties": false, + "properties": { + "questions": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["questions"], + "type": "object" + }, + "TableSettings": { + "additionalProperties": false, + "properties": { + "columns": { + "items": { + "$ref": "#/definitions/ChartAxis" + }, + "type": "array" + }, + "conditionalFormatting": { + "items": { + "$ref": "#/definitions/ConditionalFormattingRule" + }, + "type": "array" + } + }, + "type": "object" + }, + "TaxonomicFilterGroupType": { + "enum": [ + "metadata", + "actions", + "cohorts", + "cohorts_with_all", + "data_warehouse", + "data_warehouse_properties", + "data_warehouse_person_properties", + "elements", + "events", + "event_properties", + "event_feature_flags", + "numerical_event_properties", + "person_properties", + "pageview_urls", + "screens", + "custom_events", + "wildcard", + "groups", + "persons", + "feature_flags", + "insights", + "experiments", + "plugins", + "dashboards", + "name_groups", + "session_properties", + "hogql_expression", + "notebooks", + "log_entries", + "replay" + ], + "type": "string" + }, + "TeamTaxonomyItem": { + "additionalProperties": false, + "properties": { + "count": { + "$ref": "#/definitions/integer" + }, + "event": { + "type": "string" + } + }, + "required": ["event", "count"], + "type": "object" + }, + "TeamTaxonomyQuery": { + "additionalProperties": false, + "properties": { + "kind": { + "const": "TeamTaxonomyQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "response": { + "$ref": "#/definitions/TeamTaxonomyQueryResponse" + } + }, + "required": ["kind"], + "type": "object" + }, + "TeamTaxonomyQueryResponse": { + "additionalProperties": false, + "description": "All analytics query responses must inherit from this.", + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "$ref": "#/definitions/TeamTaxonomyResponse" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "TeamTaxonomyResponse": { + "items": { + "$ref": "#/definitions/TeamTaxonomyItem" + }, + "type": "array" + }, + "TestBasicQueryResponse": { + "additionalProperties": false, + "deprecated": "Only exported for use in test_query_runner.py! Don't use anywhere else.", + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "TestCachedBasicQueryResponse": { + "additionalProperties": false, + "deprecated": "Only exported for use in test_query_runner.py! Don't use anywhere else.", + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "timezone": { + "type": "string" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "results", + "timezone" + ], + "type": "object" + }, + "TimelineEntry": { + "additionalProperties": false, + "properties": { + "events": { + "items": { + "$ref": "#/definitions/EventType" + }, + "type": "array" + }, + "recording_duration_s": { + "description": "Duration of the recording in seconds.", + "type": "number" + }, + "sessionId": { + "description": "Session ID. None means out-of-session events", + "type": "string" + } + }, + "required": ["events"], + "type": "object" + }, + "TrendsAlertConfig": { + "additionalProperties": false, + "properties": { + "check_ongoing_interval": { + "type": "boolean" + }, + "series_index": { + "$ref": "#/definitions/integer" + }, + "type": { + "const": "TrendsAlertConfig", + "type": "string" + } + }, + "required": ["type", "series_index"], + "type": "object" + }, + "TrendsFilter": { + "additionalProperties": false, + "properties": { + "aggregationAxisFormat": { + "$ref": "#/definitions/AggregationAxisFormat", + "default": "numeric" + }, + "aggregationAxisPostfix": { + "type": "string" + }, + "aggregationAxisPrefix": { + "type": "string" + }, + "breakdown_histogram_bin_count": { + "type": "number" + }, + "decimalPlaces": { + "type": "number" + }, + "display": { + "$ref": "#/definitions/ChartDisplayType", + "default": "ActionsLineGraph" + }, + "formula": { + "type": "string" + }, + "hiddenLegendIndexes": { + "items": { + "$ref": "#/definitions/integer" + }, + "type": "array" + }, + "resultCustomizationBy": { + "$ref": "#/definitions/ResultCustomizationBy", + "default": "value", + "description": "Wether result datasets are associated by their values or by their order." + }, + "resultCustomizations": { + "anyOf": [ + { + "additionalProperties": { + "$ref": "#/definitions/ResultCustomizationByValue" + }, + "type": "object" + }, + { + "additionalProperties": { + "$ref": "#/definitions/ResultCustomizationByPosition" + }, + "propertyNames": { + "type": "string" + }, + "type": "object" + } + ], + "description": "Customizations for the appearance of result datasets." + }, + "showAlertThresholdLines": { + "default": false, + "type": "boolean" + }, + "showLabelsOnSeries": { + "type": "boolean" + }, + "showLegend": { + "default": false, + "type": "boolean" + }, + "showPercentStackView": { + "default": false, + "type": "boolean" + }, + "showValuesOnSeries": { + "default": false, + "type": "boolean" + }, + "smoothingIntervals": { + "$ref": "#/definitions/integer", + "default": 1 + }, + "yAxisScaleType": { + "enum": ["log10", "linear"], + "type": "string" + } + }, + "type": "object" + }, + "TrendsFilterLegacy": { + "additionalProperties": false, + "description": "`TrendsFilterType` minus everything inherited from `FilterType` and `shown_as`", + "properties": { + "aggregation_axis_format": { + "$ref": "#/definitions/AggregationAxisFormat" + }, + "aggregation_axis_postfix": { + "type": "string" + }, + "aggregation_axis_prefix": { + "type": "string" + }, + "breakdown_histogram_bin_count": { + "type": "number" + }, + "compare": { + "type": "boolean" + }, + "compare_to": { + "type": "string" + }, + "decimal_places": { + "type": "number" + }, + "display": { + "$ref": "#/definitions/ChartDisplayType" + }, + "formula": { + "type": "string" + }, + "hidden_legend_keys": { + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "not": {} + } + ] + }, + "type": "object" + }, + "show_alert_threshold_lines": { + "type": "boolean" + }, + "show_labels_on_series": { + "type": "boolean" + }, + "show_legend": { + "type": "boolean" + }, + "show_percent_stack_view": { + "type": "boolean" + }, + "show_values_on_series": { + "type": "boolean" + }, + "smoothing_intervals": { + "type": "number" + }, + "y_axis_scale_type": { + "enum": ["log10", "linear"], + "type": "string" + } + }, + "type": "object" + }, + "TrendsQuery": { + "additionalProperties": false, + "properties": { + "aggregation_group_type_index": { + "anyOf": [ + { + "$ref": "#/definitions/integer" + }, + { + "type": "null" + } + ], + "description": "Groups aggregation" + }, + "breakdownFilter": { + "$ref": "#/definitions/BreakdownFilter", + "description": "Breakdown of the events and actions" + }, + "compareFilter": { + "$ref": "#/definitions/CompareFilter", + "description": "Compare to date range" + }, + "conversionGoal": { + "anyOf": [ + { + "$ref": "#/definitions/WebAnalyticsConversionGoal" + }, + { + "type": "null" + } + ], + "description": "Whether we should be comparing against a specific conversion goal" + }, + "dataColorTheme": { + "description": "Colors used in the insight's visualization", + "type": ["number", "null"] + }, + "dateRange": { + "$ref": "#/definitions/DateRange", + "description": "Date range for the query" + }, + "filterTestAccounts": { + "default": false, + "description": "Exclude internal and test users by applying the respective filters", + "type": "boolean" + }, + "interval": { + "$ref": "#/definitions/IntervalType", + "default": "day", + "description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`" + }, + "kind": { + "const": "TrendsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/AnyPropertyFilter" + }, + "type": "array" + }, + { + "$ref": "#/definitions/PropertyGroupFilter" + } + ], + "default": [], + "description": "Property filters for all series" + }, + "response": { + "$ref": "#/definitions/TrendsQueryResponse" + }, + "samplingFactor": { + "description": "Sampling rate", + "type": ["number", "null"] + }, + "series": { + "description": "Events and actions to include", + "items": { + "$ref": "#/definitions/AnyEntityNode" + }, + "type": "array" + }, + "trendsFilter": { + "$ref": "#/definitions/TrendsFilter", + "description": "Properties specific to the trends insight" + } + }, + "required": ["kind", "series"], + "type": "object" + }, + "TrendsQueryResponse": { + "additionalProperties": false, + "properties": { + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "description": "Wether more breakdown values are available.", + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "type": "object" + }, + "type": "array" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "VisualizationMessage": { + "additionalProperties": false, + "properties": { + "answer": { + "anyOf": [ + { + "$ref": "#/definitions/AssistantTrendsQuery" + }, + { + "$ref": "#/definitions/AssistantFunnelsQuery" + }, + { + "$ref": "#/definitions/AssistantRetentionQuery" + } + ] + }, + "id": { + "type": "string" + }, + "initiator": { + "type": "string" + }, + "plan": { + "type": "string" + }, + "type": { + "const": "ai/viz", + "type": "string" + } + }, + "required": ["type"], + "type": "object" + }, + "VizSpecificOptions": { + "additionalProperties": false, + "description": "Chart specific rendering options. Use ChartRenderingMetadata for non-serializable values, e.g. onClick handlers", + "properties": { + "ActionsPie": { + "additionalProperties": false, + "properties": { + "disableHoverOffset": { + "type": "boolean" + }, + "hideAggregation": { + "type": "boolean" + } + }, + "type": "object" + }, + "RETENTION": { + "additionalProperties": false, + "properties": { + "hideLineGraph": { + "type": "boolean" + }, + "hideSizeColumn": { + "type": "boolean" + }, + "useSmallLayout": { + "type": "boolean" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "WebAnalyticsConversionGoal": { + "anyOf": [ + { + "$ref": "#/definitions/ActionConversionGoal" + }, + { + "$ref": "#/definitions/CustomEventConversionGoal" + } + ] + }, + "WebAnalyticsPropertyFilter": { + "anyOf": [ + { + "$ref": "#/definitions/EventPropertyFilter" + }, + { + "$ref": "#/definitions/PersonPropertyFilter" + }, + { + "$ref": "#/definitions/SessionPropertyFilter" + } + ] + }, + "WebAnalyticsPropertyFilters": { + "items": { + "$ref": "#/definitions/WebAnalyticsPropertyFilter" + }, + "type": "array" + }, + "WebExternalClicksTableQuery": { + "additionalProperties": false, + "properties": { + "compareFilter": { + "$ref": "#/definitions/CompareFilter" + }, + "conversionGoal": { + "anyOf": [ + { + "$ref": "#/definitions/WebAnalyticsConversionGoal" + }, + { + "type": "null" + } + ] + }, + "dateRange": { + "$ref": "#/definitions/DateRange" + }, + "filterTestAccounts": { + "type": "boolean" + }, + "kind": { + "const": "WebExternalClicksTableQuery", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "$ref": "#/definitions/WebAnalyticsPropertyFilters" + }, + "response": { + "$ref": "#/definitions/WebExternalClicksTableQueryResponse" + }, + "sampling": { + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "forceSamplingRate": { + "$ref": "#/definitions/SamplingRate" + } + }, + "type": "object" + }, + "stripQueryParams": { + "type": "boolean" + }, + "useSessionsTable": { + "deprecated": "ignored, always treated as enabled *", + "type": "boolean" + } + }, + "required": ["kind", "properties"], + "type": "object" + }, + "WebExternalClicksTableQueryResponse": { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "WebGoalsQuery": { + "additionalProperties": false, + "properties": { + "compareFilter": { + "$ref": "#/definitions/CompareFilter" + }, + "conversionGoal": { + "anyOf": [ + { + "$ref": "#/definitions/WebAnalyticsConversionGoal" + }, + { + "type": "null" + } + ] + }, + "dateRange": { + "$ref": "#/definitions/DateRange" + }, + "filterTestAccounts": { + "type": "boolean" + }, + "kind": { + "const": "WebGoalsQuery", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "$ref": "#/definitions/WebAnalyticsPropertyFilters" + }, + "response": { + "$ref": "#/definitions/WebGoalsQueryResponse" + }, + "sampling": { + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "forceSamplingRate": { + "$ref": "#/definitions/SamplingRate" + } + }, + "type": "object" + }, + "useSessionsTable": { + "deprecated": "ignored, always treated as enabled *", + "type": "boolean" + } + }, + "required": ["kind", "properties"], + "type": "object" + }, + "WebGoalsQueryResponse": { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "WebOverviewItem": { + "additionalProperties": false, + "properties": { + "changeFromPreviousPct": { + "type": "number" + }, + "isIncreaseBad": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/WebOverviewItemKind" + }, + "previous": { + "type": "number" + }, + "value": { + "type": "number" + } + }, + "required": ["key", "kind"], + "type": "object" + }, + "WebOverviewItemKind": { + "enum": ["unit", "duration_s", "percentage"], + "type": "string" + }, + "WebOverviewQuery": { + "additionalProperties": false, + "properties": { + "compareFilter": { + "$ref": "#/definitions/CompareFilter" + }, + "conversionGoal": { + "anyOf": [ + { + "$ref": "#/definitions/WebAnalyticsConversionGoal" + }, + { + "type": "null" + } + ] + }, + "dateRange": { + "$ref": "#/definitions/DateRange" + }, + "filterTestAccounts": { + "type": "boolean" + }, + "includeLCPScore": { + "type": "boolean" + }, + "kind": { + "const": "WebOverviewQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "$ref": "#/definitions/WebAnalyticsPropertyFilters" + }, + "response": { + "$ref": "#/definitions/WebOverviewQueryResponse" + }, + "sampling": { + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "forceSamplingRate": { + "$ref": "#/definitions/SamplingRate" + } + }, + "type": "object" + }, + "useSessionsTable": { + "deprecated": "ignored, always treated as enabled *", + "type": "boolean" + } + }, + "required": ["kind", "properties"], + "type": "object" + }, + "WebOverviewQueryResponse": { + "additionalProperties": false, + "properties": { + "dateFrom": { + "type": "string" + }, + "dateTo": { + "type": "string" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": { + "$ref": "#/definitions/WebOverviewItem" + }, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "WebStatsBreakdown": { + "enum": [ + "Page", + "InitialPage", + "ExitPage", + "ExitClick", + "ScreenName", + "InitialChannelType", + "InitialReferringDomain", + "InitialUTMSource", + "InitialUTMCampaign", + "InitialUTMMedium", + "InitialUTMTerm", + "InitialUTMContent", + "InitialUTMSourceMediumCampaign", + "Browser", + "OS", + "Viewport", + "DeviceType", + "Country", + "Region", + "City", + "Timezone", + "Language" + ], + "type": "string" + }, + "WebStatsTableQuery": { + "additionalProperties": false, + "properties": { + "breakdownBy": { + "$ref": "#/definitions/WebStatsBreakdown" + }, + "compareFilter": { + "$ref": "#/definitions/CompareFilter" + }, + "conversionGoal": { + "anyOf": [ + { + "$ref": "#/definitions/WebAnalyticsConversionGoal" + }, + { + "type": "null" + } + ] + }, + "dateRange": { + "$ref": "#/definitions/DateRange" + }, + "doPathCleaning": { + "type": "boolean" + }, + "filterTestAccounts": { + "type": "boolean" + }, + "includeBounceRate": { + "type": "boolean" + }, + "includeScrollDepth": { + "type": "boolean" + }, + "kind": { + "const": "WebStatsTableQuery", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "properties": { + "$ref": "#/definitions/WebAnalyticsPropertyFilters" + }, + "response": { + "$ref": "#/definitions/WebStatsTableQueryResponse" + }, + "sampling": { + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "forceSamplingRate": { + "$ref": "#/definitions/SamplingRate" + } + }, + "type": "object" + }, + "useSessionsTable": { + "deprecated": "ignored, always treated as enabled *", + "type": "boolean" + } + }, + "required": ["breakdownBy", "kind", "properties"], + "type": "object" + }, + "WebStatsTableQueryResponse": { + "additionalProperties": false, + "properties": { + "columns": { + "items": {}, + "type": "array" + }, + "error": { + "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + "type": "string" + }, + "hasMore": { + "type": "boolean" + }, + "hogql": { + "description": "Generated HogQL query.", + "type": "string" + }, + "limit": { + "$ref": "#/definitions/integer" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "offset": { + "$ref": "#/definitions/integer" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "results": { + "items": {}, + "type": "array" + }, + "samplingRate": { + "$ref": "#/definitions/SamplingRate" + }, + "timings": { + "description": "Measured timings for different parts of the query generation process", + "items": { + "$ref": "#/definitions/QueryTiming" + }, + "type": "array" + }, + "types": { + "items": {}, + "type": "array" + } + }, + "required": ["results"], + "type": "object" + }, + "YAxisSettings": { + "additionalProperties": false, + "properties": { + "scale": { + "enum": ["linear", "logarithmic"], + "type": "string" + }, + "startAtZero": { + "description": "Whether the Y axis should start at zero", + "type": "boolean" + } + }, + "type": "object" + }, + "integer": { + "type": "integer" + } + } } diff --git a/posthog/schema.py b/posthog/schema.py index 805c7387b4e6e..f5a8ac1c42466 100644 --- a/posthog/schema.py +++ b/posthog/schema.py @@ -2,10 +2,7310 @@ from __future__ import annotations -from typing import Any +from enum import Enum, StrEnum +from typing import Any, Literal, Optional, Union -from pydantic import RootModel +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel class SchemaRoot(RootModel[Any]): root: Any + + +class MathGroupTypeIndex(float, Enum): + NUMBER_0 = 0 + NUMBER_1 = 1 + NUMBER_2 = 2 + NUMBER_3 = 3 + NUMBER_4 = 4 + + +class AggregationAxisFormat(StrEnum): + NUMERIC = "numeric" + DURATION = "duration" + DURATION_MS = "duration_ms" + PERCENTAGE = "percentage" + PERCENTAGE_SCALED = "percentage_scaled" + + +class AlertCalculationInterval(StrEnum): + HOURLY = "hourly" + DAILY = "daily" + WEEKLY = "weekly" + MONTHLY = "monthly" + + +class AlertConditionType(StrEnum): + ABSOLUTE_VALUE = "absolute_value" + RELATIVE_INCREASE = "relative_increase" + RELATIVE_DECREASE = "relative_decrease" + + +class AlertState(StrEnum): + FIRING = "Firing" + NOT_FIRING = "Not firing" + ERRORED = "Errored" + SNOOZED = "Snoozed" + + +class AssistantArrayPropertyFilterOperator(StrEnum): + EXACT = "exact" + IS_NOT = "is_not" + + +class AssistantBaseMultipleBreakdownFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + property: str = Field(..., description="Property name from the plan to break down by.") + + +class AssistantDateTimePropertyFilterOperator(StrEnum): + IS_DATE_EXACT = "is_date_exact" + IS_DATE_BEFORE = "is_date_before" + IS_DATE_AFTER = "is_date_after" + + +class AssistantEventMultipleBreakdownFilterType(StrEnum): + PERSON = "person" + EVENT = "event" + SESSION = "session" + HOGQL = "hogql" + + +class AssistantEventType(StrEnum): + STATUS = "status" + MESSAGE = "message" + CONVERSATION = "conversation" + + +class AssistantFunnelsBreakdownType(StrEnum): + PERSON = "person" + EVENT = "event" + GROUP = "group" + SESSION = "session" + + +class AssistantGenerationStatusType(StrEnum): + ACK = "ack" + GENERATION_ERROR = "generation_error" + + +class AssistantGenericMultipleBreakdownFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + property: str = Field(..., description="Property name from the plan to break down by.") + type: AssistantEventMultipleBreakdownFilterType + + +class AssistantGenericPropertyFilter2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str = Field(..., description="Use one of the properties the user has provided in the plan.") + operator: AssistantArrayPropertyFilterOperator = Field( + ..., description="`exact` - exact match of any of the values. `is_not` - does not match any of the values." + ) + type: str + value: list[str] = Field( + ..., + description=( + "Only use property values from the plan. Always use strings as values. If you have a number, convert it to" + ' a string first. If you have a boolean, convert it to a string "true" or "false".' + ), + ) + + +class AssistantGenericPropertyFilter3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str = Field(..., description="Use one of the properties the user has provided in the plan.") + operator: AssistantDateTimePropertyFilterOperator + type: str + value: str = Field(..., description="Value must be a date in ISO 8601 format.") + + +class AssistantMessage(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + content: str + id: Optional[str] = None + type: Literal["ai"] = "ai" + + +class AssistantMessageType(StrEnum): + HUMAN = "human" + AI = "ai" + AI_REASONING = "ai/reasoning" + AI_VIZ = "ai/viz" + AI_FAILURE = "ai/failure" + AI_ROUTER = "ai/router" + + +class RetentionReference(StrEnum): + TOTAL = "total" + PREVIOUS = "previous" + + +class AssistantSetPropertyFilterOperator(StrEnum): + IS_SET = "is_set" + IS_NOT_SET = "is_not_set" + + +class AssistantSingleValuePropertyFilterOperator(StrEnum): + EXACT = "exact" + IS_NOT = "is_not" + ICONTAINS = "icontains" + NOT_ICONTAINS = "not_icontains" + REGEX = "regex" + NOT_REGEX = "not_regex" + + +class AssistantTrendsDisplayType(RootModel[Union[str, Any]]): + root: Union[str, Any] + + +class Display(StrEnum): + ACTIONS_LINE_GRAPH = "ActionsLineGraph" + ACTIONS_BAR = "ActionsBar" + ACTIONS_AREA_GRAPH = "ActionsAreaGraph" + ACTIONS_LINE_GRAPH_CUMULATIVE = "ActionsLineGraphCumulative" + BOLD_NUMBER = "BoldNumber" + ACTIONS_PIE = "ActionsPie" + ACTIONS_BAR_VALUE = "ActionsBarValue" + ACTIONS_TABLE = "ActionsTable" + WORLD_MAP = "WorldMap" + + +class YAxisScaleType(StrEnum): + LOG10 = "log10" + LINEAR = "linear" + + +class AssistantTrendsFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregationAxisFormat: Optional[AggregationAxisFormat] = Field( + default=AggregationAxisFormat.NUMERIC, + description=( + "Formats the trends value axis. Do not use the formatting unless you are absolutely sure that formatting" + " will match the data. `numeric` - no formatting. Prefer this option by default. `duration` - formats the" + " value in seconds to a human-readable duration, e.g., `132` becomes `2 minutes 12 seconds`. Use this" + " option only if you are sure that the values are in seconds. `duration_ms` - formats the value in" + " miliseconds to a human-readable duration, e.g., `1050` becomes `1 second 50 milliseconds`. Use this" + " option only if you are sure that the values are in miliseconds. `percentage` - adds a percentage sign to" + " the value, e.g., `50` becomes `50%`. `percentage_scaled` - formats the value as a percentage scaled to" + " 0-100, e.g., `0.5` becomes `50%`." + ), + ) + aggregationAxisPostfix: Optional[str] = Field( + default=None, + description=( + "Custom postfix to add to the aggregation axis, e.g., ` clicks` to format 5 as `5 clicks`. You may need to" + " add a space before postfix." + ), + ) + aggregationAxisPrefix: Optional[str] = Field( + default=None, + description=( + "Custom prefix to add to the aggregation axis, e.g., `$` for USD dollars. You may need to add a space after" + " prefix." + ), + ) + decimalPlaces: Optional[float] = Field( + default=None, + description=( + "Number of decimal places to show. Do not add this unless you are sure that values will have a decimal" + " point." + ), + ) + display: Optional[Display] = Field( + default=Display.ACTIONS_LINE_GRAPH, + description=( + "Visualization type. Available values: `ActionsLineGraph` - time-series line chart; most common option, as" + " it shows change over time. `ActionsBar` - time-series bar chart. `ActionsAreaGraph` - time-series area" + " chart. `ActionsLineGraphCumulative` - cumulative time-series line chart; good for cumulative metrics." + " `BoldNumber` - total value single large number. You can't use this with breakdown; use when user" + " explicitly asks for a single output number. `ActionsBarValue` - total value (NOT time-series) bar chart;" + " good for categorical data. `ActionsPie` - total value pie chart; good for visualizing proportions." + " `ActionsTable` - total value table; good when using breakdown to list users or other entities. `WorldMap`" + " - total value world map; use when breaking down by country name using property `$geoip_country_name`, and" + " only then." + ), + ) + formula: Optional[str] = Field(default=None, description="If the formula is provided, apply it here.") + showLegend: Optional[bool] = Field( + default=False, description="Whether to show the legend describing series and breakdowns." + ) + showPercentStackView: Optional[bool] = Field( + default=False, description="Whether to show a percentage of each series. Use only with" + ) + showValuesOnSeries: Optional[bool] = Field(default=False, description="Whether to show a value on each data point.") + yAxisScaleType: Optional[YAxisScaleType] = Field( + default=YAxisScaleType.LINEAR, description="Whether to scale the y-axis." + ) + + +class AssistantTrendsMath(StrEnum): + FIRST_TIME_FOR_USER = "first_time_for_user" + FIRST_TIME_FOR_USER_WITH_FILTERS = "first_time_for_user_with_filters" + + +class AutocompleteCompletionItemKind(StrEnum): + METHOD = "Method" + FUNCTION = "Function" + CONSTRUCTOR = "Constructor" + FIELD = "Field" + VARIABLE = "Variable" + CLASS_ = "Class" + STRUCT = "Struct" + INTERFACE = "Interface" + MODULE = "Module" + PROPERTY = "Property" + EVENT = "Event" + OPERATOR = "Operator" + UNIT = "Unit" + VALUE = "Value" + CONSTANT = "Constant" + ENUM = "Enum" + ENUM_MEMBER = "EnumMember" + KEYWORD = "Keyword" + TEXT = "Text" + COLOR = "Color" + FILE = "File" + REFERENCE = "Reference" + CUSTOMCOLOR = "Customcolor" + FOLDER = "Folder" + TYPE_PARAMETER = "TypeParameter" + USER = "User" + ISSUE = "Issue" + SNIPPET = "Snippet" + + +class BaseAssistantMessage(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Optional[str] = None + + +class BaseMathType(StrEnum): + TOTAL = "total" + DAU = "dau" + WEEKLY_ACTIVE = "weekly_active" + MONTHLY_ACTIVE = "monthly_active" + UNIQUE_SESSION = "unique_session" + FIRST_TIME_FOR_USER = "first_time_for_user" + FIRST_MATCHING_EVENT_FOR_USER = "first_matching_event_for_user" + + +class BreakdownAttributionType(StrEnum): + FIRST_TOUCH = "first_touch" + LAST_TOUCH = "last_touch" + ALL_EVENTS = "all_events" + STEP = "step" + + +class BreakdownType(StrEnum): + COHORT = "cohort" + PERSON = "person" + EVENT = "event" + GROUP = "group" + SESSION = "session" + HOGQL = "hogql" + DATA_WAREHOUSE = "data_warehouse" + DATA_WAREHOUSE_PERSON_PROPERTY = "data_warehouse_person_property" + + +class CompareItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + label: str + value: str + + +class StatusItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + label: str + value: str + + +class ChartDisplayCategory(StrEnum): + TIME_SERIES = "TimeSeries" + CUMULATIVE_TIME_SERIES = "CumulativeTimeSeries" + TOTAL_VALUE = "TotalValue" + + +class ChartDisplayType(StrEnum): + ACTIONS_LINE_GRAPH = "ActionsLineGraph" + ACTIONS_BAR = "ActionsBar" + ACTIONS_STACKED_BAR = "ActionsStackedBar" + ACTIONS_AREA_GRAPH = "ActionsAreaGraph" + ACTIONS_LINE_GRAPH_CUMULATIVE = "ActionsLineGraphCumulative" + BOLD_NUMBER = "BoldNumber" + ACTIONS_PIE = "ActionsPie" + ACTIONS_BAR_VALUE = "ActionsBarValue" + ACTIONS_TABLE = "ActionsTable" + WORLD_MAP = "WorldMap" + + +class DisplayType(StrEnum): + AUTO = "auto" + LINE = "line" + BAR = "bar" + + +class YAxisPosition(StrEnum): + LEFT = "left" + RIGHT = "right" + + +class ChartSettingsDisplay(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + color: Optional[str] = None + displayType: Optional[DisplayType] = None + label: Optional[str] = None + trendLine: Optional[bool] = None + yAxisPosition: Optional[YAxisPosition] = None + + +class Style(StrEnum): + NONE = "none" + NUMBER = "number" + PERCENT = "percent" + + +class ChartSettingsFormatting(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + decimalPlaces: Optional[float] = None + prefix: Optional[str] = None + style: Optional[Style] = None + suffix: Optional[str] = None + + +class CompareFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + compare: Optional[bool] = Field( + default=False, description="Whether to compare the current date range to a previous date range." + ) + compare_to: Optional[str] = Field( + default=None, + description=( + "The date range to compare to. The value is a relative date. Examples of relative dates are: `-1y` for 1" + " year ago, `-14m` for 14 months ago, `-100w` for 100 weeks ago, `-14d` for 14 days ago, `-30h` for 30" + " hours ago." + ), + ) + + +class ColorMode(StrEnum): + LIGHT = "light" + DARK = "dark" + + +class ConditionalFormattingRule(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bytecode: list + color: str + colorMode: Optional[ColorMode] = None + columnName: str + id: str + input: str + templateId: str + + +class CountPerActorMathType(StrEnum): + AVG_COUNT_PER_ACTOR = "avg_count_per_actor" + MIN_COUNT_PER_ACTOR = "min_count_per_actor" + MAX_COUNT_PER_ACTOR = "max_count_per_actor" + MEDIAN_COUNT_PER_ACTOR = "median_count_per_actor" + P90_COUNT_PER_ACTOR = "p90_count_per_actor" + P95_COUNT_PER_ACTOR = "p95_count_per_actor" + P99_COUNT_PER_ACTOR = "p99_count_per_actor" + + +class CustomChannelField(StrEnum): + UTM_SOURCE = "utm_source" + UTM_MEDIUM = "utm_medium" + UTM_CAMPAIGN = "utm_campaign" + REFERRING_DOMAIN = "referring_domain" + URL = "url" + PATHNAME = "pathname" + HOSTNAME = "hostname" + + +class CustomChannelOperator(StrEnum): + EXACT = "exact" + IS_NOT = "is_not" + IS_SET = "is_set" + IS_NOT_SET = "is_not_set" + ICONTAINS = "icontains" + NOT_ICONTAINS = "not_icontains" + REGEX = "regex" + NOT_REGEX = "not_regex" + + +class CustomEventConversionGoal(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + customEventName: str + + +class DataColorToken(StrEnum): + PRESET_1 = "preset-1" + PRESET_2 = "preset-2" + PRESET_3 = "preset-3" + PRESET_4 = "preset-4" + PRESET_5 = "preset-5" + PRESET_6 = "preset-6" + PRESET_7 = "preset-7" + PRESET_8 = "preset-8" + PRESET_9 = "preset-9" + PRESET_10 = "preset-10" + PRESET_11 = "preset-11" + PRESET_12 = "preset-12" + PRESET_13 = "preset-13" + PRESET_14 = "preset-14" + PRESET_15 = "preset-15" + + +class DataWarehouseEventsModifier(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + distinct_id_field: str + id_field: str + table_name: str + timestamp_field: str + + +class DatabaseSchemaSchema(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: str + incremental: bool + last_synced_at: Optional[str] = None + name: str + should_sync: bool + status: Optional[str] = None + + +class DatabaseSchemaSource(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: str + last_synced_at: Optional[str] = None + prefix: str + source_type: str + status: str + + +class Type(StrEnum): + POSTHOG = "posthog" + DATA_WAREHOUSE = "data_warehouse" + VIEW = "view" + BATCH_EXPORT = "batch_export" + MATERIALIZED_VIEW = "materialized_view" + + +class DatabaseSerializedFieldType(StrEnum): + INTEGER = "integer" + FLOAT = "float" + STRING = "string" + DATETIME = "datetime" + DATE = "date" + BOOLEAN = "boolean" + ARRAY = "array" + JSON = "json" + LAZY_TABLE = "lazy_table" + VIRTUAL_TABLE = "virtual_table" + FIELD_TRAVERSER = "field_traverser" + EXPRESSION = "expression" + VIEW = "view" + MATERIALIZED_VIEW = "materialized_view" + + +class DateRange(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + date_from: Optional[str] = None + date_to: Optional[str] = None + explicitDate: Optional[bool] = Field( + default=False, + description=( + "Whether the date_from and date_to should be used verbatim. Disables rounding to the start and end of" + " period." + ), + ) + + +class DatetimeDay(RootModel[AwareDatetime]): + root: AwareDatetime + + +class DefaultChannelTypes(StrEnum): + CROSS_NETWORK = "Cross Network" + PAID_SEARCH = "Paid Search" + PAID_SOCIAL = "Paid Social" + PAID_VIDEO = "Paid Video" + PAID_SHOPPING = "Paid Shopping" + PAID_UNKNOWN = "Paid Unknown" + DIRECT = "Direct" + ORGANIC_SEARCH = "Organic Search" + ORGANIC_SOCIAL = "Organic Social" + ORGANIC_VIDEO = "Organic Video" + ORGANIC_SHOPPING = "Organic Shopping" + PUSH = "Push" + SMS = "SMS" + AUDIO = "Audio" + EMAIL = "Email" + REFERRAL = "Referral" + AFFILIATE = "Affiliate" + UNKNOWN = "Unknown" + + +class DurationType(StrEnum): + DURATION = "duration" + ACTIVE_SECONDS = "active_seconds" + INACTIVE_SECONDS = "inactive_seconds" + + +class Key(StrEnum): + TAG_NAME = "tag_name" + TEXT = "text" + HREF = "href" + SELECTOR = "selector" + + +class ElementType(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + attr_class: Optional[list[str]] = None + attr_id: Optional[str] = None + attributes: dict[str, str] + href: Optional[str] = None + nth_child: Optional[float] = None + nth_of_type: Optional[float] = None + order: Optional[float] = None + tag_name: str + text: Optional[str] = None + + +class EmptyPropertyFilter(BaseModel): + pass + model_config = ConfigDict( + extra="forbid", + ) + + +class EntityType(StrEnum): + ACTIONS = "actions" + EVENTS = "events" + DATA_WAREHOUSE = "data_warehouse" + NEW_ENTITY = "new_entity" + + +class Status(StrEnum): + ARCHIVED = "archived" + ACTIVE = "active" + RESOLVED = "resolved" + PENDING_RELEASE = "pending_release" + + +class ErrorTrackingIssue(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + assignee: Optional[float] = None + description: Optional[str] = None + earliest: str + first_seen: AwareDatetime + id: str + last_seen: AwareDatetime + name: Optional[str] = None + occurrences: float + sessions: float + status: Status + users: float + volume: Optional[Any] = None + + +class OrderBy(StrEnum): + LAST_SEEN = "last_seen" + FIRST_SEEN = "first_seen" + OCCURRENCES = "occurrences" + USERS = "users" + SESSIONS = "sessions" + + +class EventDefinition(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + elements: list + event: str + properties: dict[str, Any] + + +class CorrelationType(StrEnum): + SUCCESS = "success" + FAILURE = "failure" + + +class Person(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + distinct_ids: list[str] + is_identified: Optional[bool] = None + properties: dict[str, Any] + + +class EventType(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + distinct_id: str + elements: list[ElementType] + elements_chain: Optional[str] = None + event: str + id: str + person: Optional[Person] = None + properties: dict[str, Any] + timestamp: str + uuid: Optional[str] = None + + +class Properties(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + email: Optional[str] = None + name: Optional[str] = None + + +class EventsQueryPersonColumn(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + created_at: str + distinct_id: str + properties: Properties + uuid: str + + +class ExperimentSignificanceCode(StrEnum): + SIGNIFICANT = "significant" + NOT_ENOUGH_EXPOSURE = "not_enough_exposure" + LOW_WIN_PROBABILITY = "low_win_probability" + HIGH_LOSS = "high_loss" + HIGH_P_VALUE = "high_p_value" + + +class ExperimentVariantFunnelsBaseStats(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + failure_count: float + key: str + success_count: float + + +class ExperimentVariantTrendsBaseStats(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + absolute_exposure: float + count: float + exposure: float + key: str + + +class FailureMessage(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + content: Optional[str] = None + id: Optional[str] = None + type: Literal["ai/failure"] = "ai/failure" + + +class FilterLogicalOperator(StrEnum): + AND_ = "AND" + OR_ = "OR" + + +class FunnelConversionWindowTimeUnit(StrEnum): + SECOND = "second" + MINUTE = "minute" + HOUR = "hour" + DAY = "day" + WEEK = "week" + MONTH = "month" + + +class FunnelCorrelationResultsType(StrEnum): + EVENTS = "events" + PROPERTIES = "properties" + EVENT_WITH_PROPERTIES = "event_with_properties" + + +class FunnelExclusionLegacy(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = None + funnel_from_step: float + funnel_to_step: float + id: Optional[Union[str, float]] = None + index: Optional[float] = None + name: Optional[str] = None + order: Optional[float] = None + type: Optional[EntityType] = None + + +class FunnelLayout(StrEnum): + HORIZONTAL = "horizontal" + VERTICAL = "vertical" + + +class FunnelMathType(StrEnum): + TOTAL = "total" + FIRST_TIME_FOR_USER = "first_time_for_user" + FIRST_TIME_FOR_USER_WITH_FILTERS = "first_time_for_user_with_filters" + + +class FunnelPathType(StrEnum): + FUNNEL_PATH_BEFORE_STEP = "funnel_path_before_step" + FUNNEL_PATH_BETWEEN_STEPS = "funnel_path_between_steps" + FUNNEL_PATH_AFTER_STEP = "funnel_path_after_step" + + +class FunnelStepReference(StrEnum): + TOTAL = "total" + PREVIOUS = "previous" + + +class FunnelTimeToConvertResults(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + average_conversion_time: Optional[float] = None + bins: list[list[int]] + + +class FunnelVizType(StrEnum): + STEPS = "steps" + TIME_TO_CONVERT = "time_to_convert" + TRENDS = "trends" + + +class GoalLine(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + label: str + value: float + + +class HogCompileResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bytecode: list + locals: list + + +class HogLanguage(StrEnum): + HOG = "hog" + HOG_JSON = "hogJson" + HOG_QL = "hogQL" + HOG_QL_EXPR = "hogQLExpr" + HOG_TEMPLATE = "hogTemplate" + + +class BounceRatePageViewMode(StrEnum): + COUNT_PAGEVIEWS = "count_pageviews" + UNIQ_URLS = "uniq_urls" + UNIQ_PAGE_SCREEN_AUTOCAPTURES = "uniq_page_screen_autocaptures" + + +class InCohortVia(StrEnum): + AUTO = "auto" + LEFTJOIN = "leftjoin" + SUBQUERY = "subquery" + LEFTJOIN_CONJOINED = "leftjoin_conjoined" + + +class MaterializationMode(StrEnum): + AUTO = "auto" + LEGACY_NULL_AS_STRING = "legacy_null_as_string" + LEGACY_NULL_AS_NULL = "legacy_null_as_null" + DISABLED = "disabled" + + +class PersonsArgMaxVersion(StrEnum): + AUTO = "auto" + V1 = "v1" + V2 = "v2" + + +class PersonsJoinMode(StrEnum): + INNER = "inner" + LEFT = "left" + + +class PersonsOnEventsMode(StrEnum): + DISABLED = "disabled" + PERSON_ID_NO_OVERRIDE_PROPERTIES_ON_EVENTS = "person_id_no_override_properties_on_events" + PERSON_ID_OVERRIDE_PROPERTIES_ON_EVENTS = "person_id_override_properties_on_events" + PERSON_ID_OVERRIDE_PROPERTIES_JOINED = "person_id_override_properties_joined" + + +class PropertyGroupsMode(StrEnum): + ENABLED = "enabled" + DISABLED = "disabled" + OPTIMIZED = "optimized" + + +class SessionTableVersion(StrEnum): + AUTO = "auto" + V1 = "v1" + V2 = "v2" + + +class HogQLVariable(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code_name: str + value: Optional[Any] = None + variableId: str + + +class HogQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bytecode: Optional[list] = None + coloredBytecode: Optional[list] = None + results: Any + stdout: Optional[str] = None + + +class HumanMessage(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + content: str + id: Optional[str] = None + type: Literal["human"] = "human" + + +class Compare(StrEnum): + CURRENT = "current" + PREVIOUS = "previous" + + +class InsightFilterProperty(StrEnum): + TRENDS_FILTER = "trendsFilter" + FUNNELS_FILTER = "funnelsFilter" + RETENTION_FILTER = "retentionFilter" + PATHS_FILTER = "pathsFilter" + STICKINESS_FILTER = "stickinessFilter" + LIFECYCLE_FILTER = "lifecycleFilter" + + +class InsightNodeKind(StrEnum): + TRENDS_QUERY = "TrendsQuery" + FUNNELS_QUERY = "FunnelsQuery" + RETENTION_QUERY = "RetentionQuery" + PATHS_QUERY = "PathsQuery" + STICKINESS_QUERY = "StickinessQuery" + LIFECYCLE_QUERY = "LifecycleQuery" + + +class InsightThresholdType(StrEnum): + ABSOLUTE = "absolute" + PERCENTAGE = "percentage" + + +class InsightsThresholdBounds(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + lower: Optional[float] = None + upper: Optional[float] = None + + +class IntervalType(StrEnum): + MINUTE = "minute" + HOUR = "hour" + DAY = "day" + WEEK = "week" + MONTH = "month" + + +class LifecycleToggle(StrEnum): + NEW = "new" + RESURRECTING = "resurrecting" + RETURNING = "returning" + DORMANT = "dormant" + + +class MatchedRecordingEvent(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + uuid: str + + +class MultipleBreakdownType(StrEnum): + PERSON = "person" + EVENT = "event" + GROUP = "group" + SESSION = "session" + HOGQL = "hogql" + + +class NodeKind(StrEnum): + EVENTS_NODE = "EventsNode" + ACTIONS_NODE = "ActionsNode" + DATA_WAREHOUSE_NODE = "DataWarehouseNode" + EVENTS_QUERY = "EventsQuery" + PERSONS_NODE = "PersonsNode" + HOG_QUERY = "HogQuery" + HOG_QL_QUERY = "HogQLQuery" + HOG_QL_METADATA = "HogQLMetadata" + HOG_QL_AUTOCOMPLETE = "HogQLAutocomplete" + ACTORS_QUERY = "ActorsQuery" + FUNNELS_ACTORS_QUERY = "FunnelsActorsQuery" + FUNNEL_CORRELATION_ACTORS_QUERY = "FunnelCorrelationActorsQuery" + SESSIONS_TIMELINE_QUERY = "SessionsTimelineQuery" + RECORDINGS_QUERY = "RecordingsQuery" + SESSION_ATTRIBUTION_EXPLORER_QUERY = "SessionAttributionExplorerQuery" + ERROR_TRACKING_QUERY = "ErrorTrackingQuery" + DATA_TABLE_NODE = "DataTableNode" + DATA_VISUALIZATION_NODE = "DataVisualizationNode" + SAVED_INSIGHT_NODE = "SavedInsightNode" + INSIGHT_VIZ_NODE = "InsightVizNode" + TRENDS_QUERY = "TrendsQuery" + FUNNELS_QUERY = "FunnelsQuery" + RETENTION_QUERY = "RetentionQuery" + PATHS_QUERY = "PathsQuery" + STICKINESS_QUERY = "StickinessQuery" + LIFECYCLE_QUERY = "LifecycleQuery" + INSIGHT_ACTORS_QUERY = "InsightActorsQuery" + INSIGHT_ACTORS_QUERY_OPTIONS = "InsightActorsQueryOptions" + FUNNEL_CORRELATION_QUERY = "FunnelCorrelationQuery" + WEB_OVERVIEW_QUERY = "WebOverviewQuery" + WEB_STATS_TABLE_QUERY = "WebStatsTableQuery" + WEB_EXTERNAL_CLICKS_TABLE_QUERY = "WebExternalClicksTableQuery" + WEB_GOALS_QUERY = "WebGoalsQuery" + EXPERIMENT_FUNNELS_QUERY = "ExperimentFunnelsQuery" + EXPERIMENT_TRENDS_QUERY = "ExperimentTrendsQuery" + DATABASE_SCHEMA_QUERY = "DatabaseSchemaQuery" + SUGGESTED_QUESTIONS_QUERY = "SuggestedQuestionsQuery" + TEAM_TAXONOMY_QUERY = "TeamTaxonomyQuery" + EVENT_TAXONOMY_QUERY = "EventTaxonomyQuery" + ACTORS_PROPERTY_TAXONOMY_QUERY = "ActorsPropertyTaxonomyQuery" + + +class PathCleaningFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + alias: Optional[str] = None + regex: Optional[str] = None + + +class PathType(StrEnum): + FIELD_PAGEVIEW = "$pageview" + FIELD_SCREEN = "$screen" + CUSTOM_EVENT = "custom_event" + HOGQL = "hogql" + + +class PathsFilterLegacy(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + edge_limit: Optional[int] = None + end_point: Optional[str] = None + exclude_events: Optional[list[str]] = None + funnel_filter: Optional[dict[str, Any]] = None + funnel_paths: Optional[FunnelPathType] = None + include_event_types: Optional[list[PathType]] = None + local_path_cleaning_filters: Optional[list[PathCleaningFilter]] = None + max_edge_weight: Optional[int] = None + min_edge_weight: Optional[int] = None + path_groupings: Optional[list[str]] = None + path_replacements: Optional[bool] = None + path_type: Optional[PathType] = None + paths_hogql_expression: Optional[str] = None + start_point: Optional[str] = None + step_limit: Optional[int] = None + + +class PersonType(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + created_at: Optional[str] = None + distinct_ids: list[str] + id: Optional[str] = None + is_identified: Optional[bool] = None + name: Optional[str] = None + properties: dict[str, Any] + uuid: Optional[str] = None + + +class PropertyFilterType(StrEnum): + META = "meta" + EVENT = "event" + PERSON = "person" + ELEMENT = "element" + FEATURE = "feature" + SESSION = "session" + COHORT = "cohort" + RECORDING = "recording" + LOG_ENTRY = "log_entry" + GROUP = "group" + HOGQL = "hogql" + DATA_WAREHOUSE = "data_warehouse" + DATA_WAREHOUSE_PERSON_PROPERTY = "data_warehouse_person_property" + + +class PropertyMathType(StrEnum): + AVG = "avg" + SUM = "sum" + MIN = "min" + MAX = "max" + MEDIAN = "median" + P90 = "p90" + P95 = "p95" + P99 = "p99" + + +class PropertyOperator(StrEnum): + EXACT = "exact" + IS_NOT = "is_not" + ICONTAINS = "icontains" + NOT_ICONTAINS = "not_icontains" + REGEX = "regex" + NOT_REGEX = "not_regex" + GT = "gt" + GTE = "gte" + LT = "lt" + LTE = "lte" + IS_SET = "is_set" + IS_NOT_SET = "is_not_set" + IS_DATE_EXACT = "is_date_exact" + IS_DATE_BEFORE = "is_date_before" + IS_DATE_AFTER = "is_date_after" + BETWEEN = "between" + NOT_BETWEEN = "not_between" + MIN = "min" + MAX = "max" + IN_ = "in" + NOT_IN = "not_in" + + +class QueryResponseAlternative5(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bytecode: Optional[list] = None + coloredBytecode: Optional[list] = None + results: Any + stdout: Optional[str] = None + + +class QueryResponseAlternative36(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + questions: list[str] + + +class QueryTiming(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + k: str = Field(..., description="Key. Shortened to 'k' to save on data.") + t: float = Field(..., description="Time in seconds. Shortened to 't' to save on data.") + + +class ReasoningMessage(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + content: str + id: Optional[str] = None + substeps: Optional[list[str]] = None + type: Literal["ai/reasoning"] = "ai/reasoning" + + +class RecordingOrder(StrEnum): + DURATION = "duration" + RECORDING_DURATION = "recording_duration" + INACTIVE_SECONDS = "inactive_seconds" + ACTIVE_SECONDS = "active_seconds" + START_TIME = "start_time" + CONSOLE_ERROR_COUNT = "console_error_count" + CLICK_COUNT = "click_count" + KEYPRESS_COUNT = "keypress_count" + MOUSE_ACTIVITY_COUNT = "mouse_activity_count" + ACTIVITY_SCORE = "activity_score" + + +class RecordingPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: Union[DurationType, str] + label: Optional[str] = None + operator: PropertyOperator + type: Literal["recording"] = "recording" + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class ResultCustomizationBase(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + color: DataColorToken + + +class ResultCustomizationBy(StrEnum): + VALUE = "value" + POSITION = "position" + + +class ResultCustomizationByPosition(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + assignmentBy: Literal["position"] = "position" + color: DataColorToken + + +class ResultCustomizationByValue(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + assignmentBy: Literal["value"] = "value" + color: DataColorToken + + +class RetentionEntityKind(StrEnum): + ACTIONS_NODE = "ActionsNode" + EVENTS_NODE = "EventsNode" + + +class RetentionPeriod(StrEnum): + HOUR = "Hour" + DAY = "Day" + WEEK = "Week" + MONTH = "Month" + + +class RetentionType(StrEnum): + RETENTION_RECURRING = "retention_recurring" + RETENTION_FIRST_TIME = "retention_first_time" + + +class RouterMessage(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + content: str + id: Optional[str] = None + type: Literal["ai/router"] = "ai/router" + + +class SamplingRate(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + denominator: Optional[float] = None + numerator: float + + +class SessionAttributionGroupBy(StrEnum): + CHANNEL_TYPE = "ChannelType" + MEDIUM = "Medium" + SOURCE = "Source" + CAMPAIGN = "Campaign" + AD_IDS = "AdIds" + REFERRING_DOMAIN = "ReferringDomain" + INITIAL_URL = "InitialURL" + + +class SessionPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str + label: Optional[str] = None + operator: PropertyOperator + type: Literal["session"] = "session" + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class SnapshotSource(StrEnum): + WEB = "web" + MOBILE = "mobile" + UNKNOWN = "unknown" + + +class Storage(StrEnum): + OBJECT_STORAGE_LTS = "object_storage_lts" + OBJECT_STORAGE = "object_storage" + + +class StepOrderValue(StrEnum): + STRICT = "strict" + UNORDERED = "unordered" + ORDERED = "ordered" + + +class StickinessFilterLegacy(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + compare: Optional[bool] = None + compare_to: Optional[str] = None + display: Optional[ChartDisplayType] = None + hidden_legend_keys: Optional[dict[str, Union[bool, Any]]] = None + show_legend: Optional[bool] = None + show_values_on_series: Optional[bool] = None + + +class StickinessOperator(StrEnum): + GTE = "gte" + LTE = "lte" + EXACT = "exact" + + +class SuggestedQuestionsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + questions: list[str] + + +class TaxonomicFilterGroupType(StrEnum): + METADATA = "metadata" + ACTIONS = "actions" + COHORTS = "cohorts" + COHORTS_WITH_ALL = "cohorts_with_all" + DATA_WAREHOUSE = "data_warehouse" + DATA_WAREHOUSE_PROPERTIES = "data_warehouse_properties" + DATA_WAREHOUSE_PERSON_PROPERTIES = "data_warehouse_person_properties" + ELEMENTS = "elements" + EVENTS = "events" + EVENT_PROPERTIES = "event_properties" + EVENT_FEATURE_FLAGS = "event_feature_flags" + NUMERICAL_EVENT_PROPERTIES = "numerical_event_properties" + PERSON_PROPERTIES = "person_properties" + PAGEVIEW_URLS = "pageview_urls" + SCREENS = "screens" + CUSTOM_EVENTS = "custom_events" + WILDCARD = "wildcard" + GROUPS = "groups" + PERSONS = "persons" + FEATURE_FLAGS = "feature_flags" + INSIGHTS = "insights" + EXPERIMENTS = "experiments" + PLUGINS = "plugins" + DASHBOARDS = "dashboards" + NAME_GROUPS = "name_groups" + SESSION_PROPERTIES = "session_properties" + HOGQL_EXPRESSION = "hogql_expression" + NOTEBOOKS = "notebooks" + LOG_ENTRIES = "log_entries" + REPLAY = "replay" + + +class TimelineEntry(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + events: list[EventType] + recording_duration_s: Optional[float] = Field(default=None, description="Duration of the recording in seconds.") + sessionId: Optional[str] = Field(default=None, description="Session ID. None means out-of-session events") + + +class TrendsFilterLegacy(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_axis_format: Optional[AggregationAxisFormat] = None + aggregation_axis_postfix: Optional[str] = None + aggregation_axis_prefix: Optional[str] = None + breakdown_histogram_bin_count: Optional[float] = None + compare: Optional[bool] = None + compare_to: Optional[str] = None + decimal_places: Optional[float] = None + display: Optional[ChartDisplayType] = None + formula: Optional[str] = None + hidden_legend_keys: Optional[dict[str, Union[bool, Any]]] = None + show_alert_threshold_lines: Optional[bool] = None + show_labels_on_series: Optional[bool] = None + show_legend: Optional[bool] = None + show_percent_stack_view: Optional[bool] = None + show_values_on_series: Optional[bool] = None + smoothing_intervals: Optional[float] = None + y_axis_scale_type: Optional[YAxisScaleType] = YAxisScaleType.LINEAR + + +class ActionsPie(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + disableHoverOffset: Optional[bool] = None + hideAggregation: Optional[bool] = None + + +class RETENTION(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + hideLineGraph: Optional[bool] = None + hideSizeColumn: Optional[bool] = None + useSmallLayout: Optional[bool] = None + + +class VizSpecificOptions(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + ActionsPie: Optional[ActionsPie] = None + RETENTION: Optional[RETENTION] = None + + +class Sampling(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + enabled: Optional[bool] = None + forceSamplingRate: Optional[SamplingRate] = None + + +class WebOverviewItemKind(StrEnum): + UNIT = "unit" + DURATION_S = "duration_s" + PERCENTAGE = "percentage" + + +class WebStatsBreakdown(StrEnum): + PAGE = "Page" + INITIAL_PAGE = "InitialPage" + EXIT_PAGE = "ExitPage" + EXIT_CLICK = "ExitClick" + SCREEN_NAME = "ScreenName" + INITIAL_CHANNEL_TYPE = "InitialChannelType" + INITIAL_REFERRING_DOMAIN = "InitialReferringDomain" + INITIAL_UTM_SOURCE = "InitialUTMSource" + INITIAL_UTM_CAMPAIGN = "InitialUTMCampaign" + INITIAL_UTM_MEDIUM = "InitialUTMMedium" + INITIAL_UTM_TERM = "InitialUTMTerm" + INITIAL_UTM_CONTENT = "InitialUTMContent" + INITIAL_UTM_SOURCE_MEDIUM_CAMPAIGN = "InitialUTMSourceMediumCampaign" + BROWSER = "Browser" + OS = "OS" + VIEWPORT = "Viewport" + DEVICE_TYPE = "DeviceType" + COUNTRY = "Country" + REGION = "Region" + CITY = "City" + TIMEZONE = "Timezone" + LANGUAGE = "Language" + + +class Scale(StrEnum): + LINEAR = "linear" + LOGARITHMIC = "logarithmic" + + +class YAxisSettings(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + scale: Optional[Scale] = None + startAtZero: Optional[bool] = Field(default=None, description="Whether the Y axis should start at zero") + + +class Integer(RootModel[int]): + root: int + + +class ActionConversionGoal(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + actionId: int + + +class ActorsPropertyTaxonomyResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + sample_count: int + sample_values: list[Union[str, float, bool, int]] + + +class AlertCondition(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: AlertConditionType + + +class AssistantArrayPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + operator: AssistantArrayPropertyFilterOperator = Field( + ..., description="`exact` - exact match of any of the values. `is_not` - does not match any of the values." + ) + value: list[str] = Field( + ..., + description=( + "Only use property values from the plan. Always use strings as values. If you have a number, convert it to" + ' a string first. If you have a boolean, convert it to a string "true" or "false".' + ), + ) + + +class AssistantBreakdownFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdown_limit: Optional[int] = Field(default=25, description="How many distinct values to show.") + + +class AssistantDateTimePropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + operator: AssistantDateTimePropertyFilterOperator + value: str = Field(..., description="Value must be a date in ISO 8601 format.") + + +class AssistantFunnelsBreakdownFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdown: str = Field(..., description="The entity property to break down by.") + breakdown_group_type_index: Optional[int] = Field( + default=None, + description=( + "If `breakdown_type` is `group`, this is the index of the group. Use the index from the group mapping." + ), + ) + breakdown_limit: Optional[int] = Field(default=25, description="How many distinct values to show.") + breakdown_type: Optional[AssistantFunnelsBreakdownType] = Field( + default=AssistantFunnelsBreakdownType.EVENT, + description=( + "Type of the entity to break down by. If `group` is used, you must also provide" + " `breakdown_group_type_index` from the group mapping." + ), + ) + + +class AssistantFunnelsExclusionEventsNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + event: str + funnelFromStep: int + funnelToStep: int + kind: Literal["EventsNode"] = "EventsNode" + + +class AssistantFunnelsFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + binCount: Optional[int] = Field( + default=None, + description=( + "Use this setting only when `funnelVizType` is `time_to_convert`: number of bins to show in histogram." + ), + ) + exclusions: Optional[list[AssistantFunnelsExclusionEventsNode]] = Field( + default=[], + description=( + "Users may want to use exclusion events to filter out conversions in which a particular event occurred" + " between specific steps. These events must not be included in the main sequence. You must include start" + " and end indexes for each exclusion where the minimum index is one and the maximum index is the number of" + " steps in the funnel. For example, there is a sequence with three steps: sign up, finish onboarding," + " purchase. If the user wants to exclude all conversions in which users left the page before finishing the" + " onboarding, the exclusion step would be the event `$pageleave` with start index 2 and end index 3." + ), + ) + funnelAggregateByHogQL: Literal["properties.$session_id"] = Field( + default="properties.$session_id", + description="Use this field only if the user explicitly asks to aggregate the funnel by unique sessions.", + ) + funnelOrderType: Optional[StepOrderValue] = Field( + default=StepOrderValue.ORDERED, + description=( + "Defines the behavior of event matching between steps. Prefer the `strict` option unless explicitly told to" + " use a different one. `ordered` - defines a sequential funnel. Step B must happen after Step A, but any" + " number of events can happen between A and B. `strict` - defines a funnel where all events must happen in" + " order. Step B must happen directly after Step A without any events in between. `any` - order doesn't" + " matter. Steps can be completed in any sequence." + ), + ) + funnelStepReference: Optional[FunnelStepReference] = Field( + default=FunnelStepReference.TOTAL, + description=( + "Whether conversion shown in the graph should be across all steps or just relative to the previous step." + ), + ) + funnelVizType: Optional[FunnelVizType] = Field( + default=FunnelVizType.STEPS, + description=( + "Defines the type of visualization to use. The `steps` option is recommended. `steps` - shows a" + " step-by-step funnel. Perfect to show a conversion rate of a sequence of events (default)." + " `time_to_convert` - shows a histogram of the time it took to complete the funnel. Use this if the user" + " asks about the average time it takes to complete the funnel. `trends` - shows a trend of the whole" + " sequence's conversion rate over time. Use this if the user wants to see how the conversion rate changes" + " over time." + ), + ) + funnelWindowInterval: Optional[int] = Field( + default=14, + description=( + "Controls a time frame value for a conversion to be considered. Select a reasonable value based on the" + " user's query. Use in combination with `funnelWindowIntervalUnit`. The default value is 14 days." + ), + ) + funnelWindowIntervalUnit: Optional[FunnelConversionWindowTimeUnit] = Field( + default=FunnelConversionWindowTimeUnit.DAY, + description=( + "Controls a time frame interval for a conversion to be considered. Select a reasonable value based on the" + " user's query. Use in combination with `funnelWindowInterval`. The default value is 14 days." + ), + ) + layout: Optional[FunnelLayout] = Field( + default=FunnelLayout.VERTICAL, + description="Controls how the funnel chart is displayed: vertically (preferred) or horizontally.", + ) + + +class AssistantGenerationStatusEvent(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: AssistantGenerationStatusType + + +class AssistantGenericPropertyFilter1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str = Field(..., description="Use one of the properties the user has provided in the plan.") + operator: AssistantSingleValuePropertyFilterOperator = Field( + ..., + description=( + "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` -" + " matches the regex pattern. `not_regex` - does not match the regex pattern." + ), + ) + type: str + value: str = Field( + ..., + description=( + "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a" + " valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be" + " matched against the property value." + ), + ) + + +class AssistantGenericPropertyFilter4(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str = Field(..., description="Use one of the properties the user has provided in the plan.") + operator: AssistantSetPropertyFilterOperator = Field( + ..., + description=( + "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't" + " collected." + ), + ) + type: str + + +class AssistantGroupMultipleBreakdownFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + group_type_index: Optional[int] = Field(default=None, description="Index of the group type from the group mapping.") + property: str = Field(..., description="Property name from the plan to break down by.") + type: Literal["group"] = "group" + + +class AssistantGroupPropertyFilter1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + group_type_index: int = Field(..., description="Index of the group type from the group mapping.") + key: str = Field(..., description="Use one of the properties the user has provided in the plan.") + operator: AssistantSingleValuePropertyFilterOperator = Field( + ..., + description=( + "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` -" + " matches the regex pattern. `not_regex` - does not match the regex pattern." + ), + ) + type: Literal["group"] = "group" + value: str = Field( + ..., + description=( + "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a" + " valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be" + " matched against the property value." + ), + ) + + +class AssistantGroupPropertyFilter2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + group_type_index: int = Field(..., description="Index of the group type from the group mapping.") + key: str = Field(..., description="Use one of the properties the user has provided in the plan.") + operator: AssistantArrayPropertyFilterOperator = Field( + ..., description="`exact` - exact match of any of the values. `is_not` - does not match any of the values." + ) + type: Literal["group"] = "group" + value: list[str] = Field( + ..., + description=( + "Only use property values from the plan. Always use strings as values. If you have a number, convert it to" + ' a string first. If you have a boolean, convert it to a string "true" or "false".' + ), + ) + + +class AssistantGroupPropertyFilter3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + group_type_index: int = Field(..., description="Index of the group type from the group mapping.") + key: str = Field(..., description="Use one of the properties the user has provided in the plan.") + operator: AssistantDateTimePropertyFilterOperator + type: Literal["group"] = "group" + value: str = Field(..., description="Value must be a date in ISO 8601 format.") + + +class AssistantGroupPropertyFilter4(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + group_type_index: int = Field(..., description="Index of the group type from the group mapping.") + key: str = Field(..., description="Use one of the properties the user has provided in the plan.") + operator: AssistantSetPropertyFilterOperator = Field( + ..., + description=( + "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't" + " collected." + ), + ) + type: Literal["group"] = "group" + + +class AssistantSetPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + operator: AssistantSetPropertyFilterOperator = Field( + ..., + description=( + "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't" + " collected." + ), + ) + + +class AssistantSingleValuePropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + operator: AssistantSingleValuePropertyFilterOperator = Field( + ..., + description=( + "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` -" + " matches the regex pattern. `not_regex` - does not match the regex pattern." + ), + ) + value: str = Field( + ..., + description=( + "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a" + " valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be" + " matched against the property value." + ), + ) + + +class AssistantTrendsBreakdownFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdown_limit: Optional[int] = Field(default=25, description="How many distinct values to show.") + breakdowns: list[Union[AssistantGroupMultipleBreakdownFilter, AssistantGenericMultipleBreakdownFilter]] = Field( + ..., description="Use this field to define breakdowns.", max_length=3 + ) + + +class AutocompleteCompletionItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + detail: Optional[str] = Field( + default=None, + description=( + "A human-readable string with additional information about this item, like type or symbol information." + ), + ) + documentation: Optional[str] = Field( + default=None, description="A human-readable string that represents a doc-comment." + ) + insertText: str = Field( + ..., description="A string or snippet that should be inserted in a document when selecting this completion." + ) + kind: AutocompleteCompletionItemKind = Field( + ..., description="The kind of this completion item. Based on the kind an icon is chosen by the editor." + ) + label: str = Field( + ..., + description=( + "The label of this completion item. By default this is also the text that is inserted when selecting this" + " completion." + ), + ) + + +class Breakdown(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + group_type_index: Optional[int] = None + histogram_bin_count: Optional[int] = None + normalize_url: Optional[bool] = None + property: str + type: Optional[MultipleBreakdownType] = None + + +class BreakdownFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdown: Optional[Union[str, list[Union[str, int]], int]] = None + breakdown_group_type_index: Optional[int] = None + breakdown_hide_other_aggregation: Optional[bool] = None + breakdown_histogram_bin_count: Optional[int] = None + breakdown_limit: Optional[int] = None + breakdown_normalize_url: Optional[bool] = None + breakdown_type: Optional[BreakdownType] = BreakdownType.EVENT + breakdowns: Optional[list[Breakdown]] = Field(default=None, max_length=3) + + +class IntervalItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + label: str + value: int = Field(..., description="An interval selected out of available intervals in source query") + + +class Series(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + label: str + value: int + + +class Settings(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + display: Optional[ChartSettingsDisplay] = None + formatting: Optional[ChartSettingsFormatting] = None + + +class ChartAxis(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + column: str + settings: Optional[Settings] = None + + +class ChartSettings(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + goalLines: Optional[list[GoalLine]] = None + leftYAxisSettings: Optional[YAxisSettings] = None + rightYAxisSettings: Optional[YAxisSettings] = None + seriesBreakdownColumn: Optional[str] = None + stackBars100: Optional[bool] = Field(default=None, description="Whether we fill the bars to 100% in stacked mode") + xAxis: Optional[ChartAxis] = None + yAxis: Optional[list[ChartAxis]] = None + yAxisAtZero: Optional[bool] = Field( + default=None, description="Deprecated: use `[left|right]YAxisSettings`. Whether the Y axis should start at zero" + ) + + +class ClickhouseQueryProgress(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + active_cpu_time: int + bytes_read: int + estimated_rows_total: int + rows_read: int + time_elapsed: int + + +class CohortPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: Literal["id"] = "id" + label: Optional[str] = None + operator: Optional[PropertyOperator] = PropertyOperator.IN_ + type: Literal["cohort"] = "cohort" + value: int + + +class CustomChannelCondition(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: str + key: CustomChannelField + op: CustomChannelOperator + value: Optional[Union[str, list[str]]] = None + + +class CustomChannelRule(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + channel_type: str + combiner: FilterLogicalOperator + id: str + items: list[CustomChannelCondition] + + +class DataWarehousePersonPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str + label: Optional[str] = None + operator: PropertyOperator + type: Literal["data_warehouse_person_property"] = "data_warehouse_person_property" + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class DataWarehousePropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str + label: Optional[str] = None + operator: PropertyOperator + type: Literal["data_warehouse"] = "data_warehouse" + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class DatabaseSchemaField(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + chain: Optional[list[Union[str, int]]] = None + fields: Optional[list[str]] = None + hogql_value: str + id: Optional[str] = None + name: str + schema_valid: bool + table: Optional[str] = None + type: DatabaseSerializedFieldType + + +class DatabaseSchemaPostHogTable(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + fields: dict[str, DatabaseSchemaField] + id: str + name: str + type: Literal["posthog"] = "posthog" + + +class DatabaseSchemaTableCommon(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + fields: dict[str, DatabaseSchemaField] + id: str + name: str + type: Type + + +class Day(RootModel[int]): + root: int + + +class ElementPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: Key + label: Optional[str] = None + operator: PropertyOperator + type: Literal["element"] = "element" + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class EventOddsRatioSerialized(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + correlation_type: CorrelationType + event: EventDefinition + failure_count: int + odds_ratio: float + success_count: int + + +class EventPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str + label: Optional[str] = None + operator: Optional[PropertyOperator] = PropertyOperator.EXACT + type: Literal["event"] = Field(default="event", description="Event properties") + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class EventTaxonomyItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + property: str + sample_count: int + sample_values: list[str] + + +class FeaturePropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str + label: Optional[str] = None + operator: PropertyOperator + type: Literal["feature"] = Field(default="feature", description='Event property with "$feature/" prepended') + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class FunnelCorrelationResult(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + events: list[EventOddsRatioSerialized] + skewed: bool + + +class FunnelExclusionSteps(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + funnelFromStep: int + funnelToStep: int + + +class FunnelsFilterLegacy(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bin_count: Optional[Union[float, str]] = None + breakdown_attribution_type: Optional[BreakdownAttributionType] = None + breakdown_attribution_value: Optional[float] = None + exclusions: Optional[list[FunnelExclusionLegacy]] = None + funnel_aggregate_by_hogql: Optional[str] = None + funnel_from_step: Optional[float] = None + funnel_order_type: Optional[StepOrderValue] = None + funnel_step_reference: Optional[FunnelStepReference] = None + funnel_to_step: Optional[float] = None + funnel_viz_type: Optional[FunnelVizType] = None + funnel_window_interval: Optional[float] = None + funnel_window_interval_unit: Optional[FunnelConversionWindowTimeUnit] = None + hidden_legend_keys: Optional[dict[str, Union[bool, Any]]] = None + layout: Optional[FunnelLayout] = None + + +class GroupPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + group_type_index: Optional[int] = None + key: str + label: Optional[str] = None + operator: PropertyOperator + type: Literal["group"] = "group" + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class HogQLAutocompleteResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + incomplete_list: bool = Field(..., description="Whether or not the suggestions returned are complete") + suggestions: list[AutocompleteCompletionItem] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class HogQLNotice(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + end: Optional[int] = None + fix: Optional[str] = None + message: str + start: Optional[int] = None + + +class HogQLPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str + label: Optional[str] = None + type: Literal["hogql"] = "hogql" + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class HogQLQueryModifiers(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bounceRateDurationSeconds: Optional[float] = None + bounceRatePageViewMode: Optional[BounceRatePageViewMode] = None + customChannelTypeRules: Optional[list[CustomChannelRule]] = None + dataWarehouseEventsModifiers: Optional[list[DataWarehouseEventsModifier]] = None + debug: Optional[bool] = None + inCohortVia: Optional[InCohortVia] = None + materializationMode: Optional[MaterializationMode] = None + optimizeJoinedFilters: Optional[bool] = None + personsArgMaxVersion: Optional[PersonsArgMaxVersion] = None + personsJoinMode: Optional[PersonsJoinMode] = None + personsOnEventsMode: Optional[PersonsOnEventsMode] = None + propertyGroupsMode: Optional[PropertyGroupsMode] = None + s3TableUseInvalidColumns: Optional[bool] = None + sessionTableVersion: Optional[SessionTableVersion] = None + useMaterializedViews: Optional[bool] = None + + +class HogQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Optional[str] = None + kind: Literal["HogQuery"] = "HogQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + response: Optional[HogQueryResponse] = None + + +class DayItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + label: str + value: Union[str, AwareDatetime, int] + + +class InsightThreshold(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bounds: Optional[InsightsThresholdBounds] = None + type: InsightThresholdType + + +class LifecycleFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + showLegend: Optional[bool] = False + showValuesOnSeries: Optional[bool] = None + toggledLifecycles: Optional[list[LifecycleToggle]] = None + + +class LifecycleFilterLegacy(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + show_legend: Optional[bool] = None + show_values_on_series: Optional[bool] = None + toggledLifecycles: Optional[list[LifecycleToggle]] = None + + +class LogEntryPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str + label: Optional[str] = None + operator: PropertyOperator + type: Literal["log_entry"] = "log_entry" + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class MatchedRecording(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + events: list[MatchedRecordingEvent] + session_id: Optional[str] = None + + +class PathsFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + edgeLimit: Optional[int] = 50 + endPoint: Optional[str] = None + excludeEvents: Optional[list[str]] = None + includeEventTypes: Optional[list[PathType]] = None + localPathCleaningFilters: Optional[list[PathCleaningFilter]] = None + maxEdgeWeight: Optional[int] = None + minEdgeWeight: Optional[int] = None + pathDropoffKey: Optional[str] = Field(default=None, description="Relevant only within actors query") + pathEndKey: Optional[str] = Field(default=None, description="Relevant only within actors query") + pathGroupings: Optional[list[str]] = None + pathReplacements: Optional[bool] = None + pathStartKey: Optional[str] = Field(default=None, description="Relevant only within actors query") + pathsHogQLExpression: Optional[str] = None + startPoint: Optional[str] = None + stepLimit: Optional[int] = 5 + + +class PersonPropertyFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + key: str + label: Optional[str] = None + operator: PropertyOperator + type: Literal["person"] = Field(default="person", description="Person properties") + value: Optional[Union[str, float, list[Union[str, float]]]] = None + + +class QueryResponseAlternative7(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + errors: list[HogQLNotice] + isValid: Optional[bool] = None + isValidView: Optional[bool] = None + notices: list[HogQLNotice] + query: Optional[str] = None + table_names: Optional[list[str]] = None + warnings: list[HogQLNotice] + + +class QueryResponseAlternative8(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + incomplete_list: bool = Field(..., description="Whether or not the suggestions returned are complete") + suggestions: list[AutocompleteCompletionItem] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryStatus(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + complete: Optional[bool] = Field( + default=False, + description=( + "Whether the query is still running. Will be true if the query is complete, even if it errored. Either" + " result or error will be set." + ), + ) + dashboard_id: Optional[int] = None + end_time: Optional[AwareDatetime] = Field( + default=None, description="When did the query execution task finish (whether successfully or not)." + ) + error: Optional[bool] = Field( + default=False, + description=( + "If the query failed, this will be set to true. More information can be found in the error_message field." + ), + ) + error_message: Optional[str] = None + expiration_time: Optional[AwareDatetime] = None + id: str + insight_id: Optional[int] = None + labels: Optional[list[str]] = None + pickup_time: Optional[AwareDatetime] = Field( + default=None, description="When was the query execution task picked up by a worker." + ) + query_async: Literal[True] = Field(default=True, description="ONLY async queries use QueryStatus.") + query_progress: Optional[ClickhouseQueryProgress] = None + results: Optional[Any] = None + start_time: Optional[AwareDatetime] = Field(default=None, description="When was query execution task enqueued.") + task_id: Optional[str] = None + team_id: int + + +class QueryStatusResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + query_status: QueryStatus + + +class ResultCustomization(RootModel[Union[ResultCustomizationByValue, ResultCustomizationByPosition]]): + root: Union[ResultCustomizationByValue, ResultCustomizationByPosition] + + +class RetentionEntity(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = None + id: Optional[Union[str, float]] = None + kind: Optional[RetentionEntityKind] = None + name: Optional[str] = None + order: Optional[int] = None + type: Optional[EntityType] = None + uuid: Optional[str] = None + + +class RetentionFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cumulative: Optional[bool] = None + period: Optional[RetentionPeriod] = RetentionPeriod.DAY + retentionReference: Optional[RetentionReference] = Field( + default=None, + description="Whether retention is with regard to initial cohort size, or that of the previous period.", + ) + retentionType: Optional[RetentionType] = None + returningEntity: Optional[RetentionEntity] = None + showMean: Optional[bool] = None + targetEntity: Optional[RetentionEntity] = None + totalIntervals: Optional[int] = 11 + + +class RetentionFilterLegacy(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cumulative: Optional[bool] = None + period: Optional[RetentionPeriod] = None + retention_reference: Optional[RetentionReference] = Field( + default=None, + description="Whether retention is with regard to initial cohort size, or that of the previous period.", + ) + retention_type: Optional[RetentionType] = None + returning_entity: Optional[RetentionEntity] = None + show_mean: Optional[bool] = None + target_entity: Optional[RetentionEntity] = None + total_intervals: Optional[int] = None + + +class RetentionValue(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + count: int + + +class SavedInsightNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + allowSorting: Optional[bool] = Field( + default=None, description="Can the user click on column headers to sort the table? (default: true)" + ) + embedded: Optional[bool] = Field(default=None, description="Query is embedded inside another bordered component") + expandable: Optional[bool] = Field( + default=None, description="Can expand row to show raw event data (default: true)" + ) + full: Optional[bool] = Field( + default=None, description="Show with most visual options enabled. Used in insight scene." + ) + hidePersonsModal: Optional[bool] = None + kind: Literal["SavedInsightNode"] = "SavedInsightNode" + propertiesViaUrl: Optional[bool] = Field(default=None, description="Link properties via the URL (default: false)") + shortId: str + showActions: Optional[bool] = Field(default=None, description="Show the kebab menu at the end of the row") + showColumnConfigurator: Optional[bool] = Field( + default=None, description="Show a button to configure the table's columns if possible" + ) + showCorrelationTable: Optional[bool] = None + showDateRange: Optional[bool] = Field(default=None, description="Show date range selector") + showElapsedTime: Optional[bool] = Field(default=None, description="Show the time it takes to run a query") + showEventFilter: Optional[bool] = Field( + default=None, description="Include an event filter above the table (EventsNode only)" + ) + showExport: Optional[bool] = Field(default=None, description="Show the export button") + showFilters: Optional[bool] = None + showHeader: Optional[bool] = None + showHogQLEditor: Optional[bool] = Field(default=None, description="Include a HogQL query editor above HogQL tables") + showLastComputation: Optional[bool] = None + showLastComputationRefresh: Optional[bool] = None + showOpenEditorButton: Optional[bool] = Field( + default=None, description="Show a button to open the current query as a new insight. (default: true)" + ) + showPersistentColumnConfigurator: Optional[bool] = Field( + default=None, description="Show a button to configure and persist the table's default columns if possible" + ) + showPropertyFilter: Optional[Union[bool, list[TaxonomicFilterGroupType]]] = Field( + default=None, description="Include a property filter above the table" + ) + showReload: Optional[bool] = Field(default=None, description="Show a reload button") + showResults: Optional[bool] = None + showResultsTable: Optional[bool] = Field(default=None, description="Show a results table") + showSavedQueries: Optional[bool] = Field(default=None, description="Shows a list of saved queries") + showSearch: Optional[bool] = Field(default=None, description="Include a free text search field (PersonsNode only)") + showTable: Optional[bool] = None + showTestAccountFilters: Optional[bool] = Field(default=None, description="Show filter to exclude test accounts") + showTimings: Optional[bool] = Field(default=None, description="Show a detailed query timing breakdown") + suppressSessionAnalysisWarning: Optional[bool] = None + vizSpecificOptions: Optional[VizSpecificOptions] = None + + +class Filters(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dateRange: Optional[DateRange] = None + properties: Optional[list[SessionPropertyFilter]] = None + + +class SessionAttributionExplorerQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: Any + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class SessionRecordingType(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + active_seconds: Optional[float] = None + activity_score: Optional[float] = Field( + default=None, description="calculated on the backend so that we can sort by it, definition may change over time" + ) + click_count: Optional[float] = None + console_error_count: Optional[float] = None + console_log_count: Optional[float] = None + console_warn_count: Optional[float] = None + distinct_id: Optional[str] = None + email: Optional[str] = None + end_time: str = Field(..., description="When the recording ends in ISO format.") + id: str + inactive_seconds: Optional[float] = None + keypress_count: Optional[float] = None + matching_events: Optional[list[MatchedRecording]] = Field(default=None, description="List of matching events. *") + mouse_activity_count: Optional[float] = Field( + default=None, description="count of all mouse activity in the recording, not just clicks" + ) + ongoing: Optional[bool] = Field( + default=None, + description=( + "whether we have received data for this recording in the last 5 minutes (assumes the recording was loaded" + " from ClickHouse)\n*" + ), + ) + person: Optional[PersonType] = None + recording_duration: float = Field(..., description="Length of recording in seconds.") + snapshot_source: SnapshotSource + start_time: str = Field(..., description="When the recording starts in ISO format.") + start_url: Optional[str] = None + storage: Optional[Storage] = Field(default=None, description="Where this recording information was loaded from") + summary: Optional[str] = None + viewed: bool = Field(..., description="Whether this recording has been viewed already.") + + +class SessionsTimelineQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[TimelineEntry] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class StickinessCriteria(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + operator: StickinessOperator + value: int + + +class StickinessFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + display: Optional[ChartDisplayType] = None + hiddenLegendIndexes: Optional[list[int]] = None + showLegend: Optional[bool] = None + showValuesOnSeries: Optional[bool] = None + stickinessCriteria: Optional[StickinessCriteria] = None + + +class StickinessQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class SuggestedQuestionsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + kind: Literal["SuggestedQuestionsQuery"] = "SuggestedQuestionsQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + response: Optional[SuggestedQuestionsQueryResponse] = None + + +class TableSettings(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list[ChartAxis]] = None + conditionalFormatting: Optional[list[ConditionalFormattingRule]] = None + + +class TeamTaxonomyItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + count: int + event: str + + +class TestBasicQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class TestCachedBasicQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class TrendsAlertConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + check_ongoing_interval: Optional[bool] = None + series_index: int + type: Literal["TrendsAlertConfig"] = "TrendsAlertConfig" + + +class TrendsFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregationAxisFormat: Optional[AggregationAxisFormat] = AggregationAxisFormat.NUMERIC + aggregationAxisPostfix: Optional[str] = None + aggregationAxisPrefix: Optional[str] = None + breakdown_histogram_bin_count: Optional[float] = None + decimalPlaces: Optional[float] = None + display: Optional[ChartDisplayType] = ChartDisplayType.ACTIONS_LINE_GRAPH + formula: Optional[str] = None + hiddenLegendIndexes: Optional[list[int]] = None + resultCustomizationBy: Optional[ResultCustomizationBy] = Field( + default=ResultCustomizationBy.VALUE, + description="Wether result datasets are associated by their values or by their order.", + ) + resultCustomizations: Optional[ + Union[dict[str, ResultCustomizationByValue], dict[str, ResultCustomizationByPosition]] + ] = Field(default=None, description="Customizations for the appearance of result datasets.") + showAlertThresholdLines: Optional[bool] = False + showLabelsOnSeries: Optional[bool] = None + showLegend: Optional[bool] = False + showPercentStackView: Optional[bool] = False + showValuesOnSeries: Optional[bool] = False + smoothingIntervals: Optional[int] = 1 + yAxisScaleType: Optional[YAxisScaleType] = YAxisScaleType.LINEAR + + +class TrendsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = Field(default=None, description="Wether more breakdown values are available.") + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class WebExternalClicksTableQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class WebGoalsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class WebOverviewItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + changeFromPreviousPct: Optional[float] = None + isIncreaseBad: Optional[bool] = None + key: str + kind: WebOverviewItemKind + previous: Optional[float] = None + value: Optional[float] = None + + +class WebOverviewQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dateFrom: Optional[str] = None + dateTo: Optional[str] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[WebOverviewItem] + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class WebStatsTableQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class ActorsPropertyTaxonomyQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: ActorsPropertyTaxonomyResponse + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class ActorsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + limit: int + missing_actors_count: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: int + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class AssistantBasePropertyFilter( + RootModel[ + Union[ + AssistantDateTimePropertyFilter, + AssistantSetPropertyFilter, + Union[AssistantSingleValuePropertyFilter, AssistantArrayPropertyFilter], + ] + ] +): + root: Union[ + AssistantDateTimePropertyFilter, + AssistantSetPropertyFilter, + Union[AssistantSingleValuePropertyFilter, AssistantArrayPropertyFilter], + ] + + +class AssistantFunnelsEventsNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = Field( + default=None, description="Optional custom name for the event if it is needed to be renamed." + ) + event: str = Field(..., description="Name of the event.") + kind: Literal["EventsNode"] = "EventsNode" + math: Optional[AssistantTrendsMath] = Field( + default=None, + description=( + "Optional math aggregation type for the series. Only specify this math type if the user wants one of these." + " `first_time_for_user` - counts the number of users who have completed the event for the first time ever." + " `first_time_for_user_with_filters` - counts the number of users who have completed the event with" + " specified filters for the first time." + ), + ) + properties: Optional[ + list[ + Union[ + Union[ + AssistantGenericPropertyFilter1, + AssistantGenericPropertyFilter2, + AssistantGenericPropertyFilter3, + AssistantGenericPropertyFilter4, + ], + Union[ + AssistantGroupPropertyFilter1, + AssistantGroupPropertyFilter2, + AssistantGroupPropertyFilter3, + AssistantGroupPropertyFilter4, + ], + ] + ] + ] = None + response: Optional[dict[str, Any]] = None + + +class AssistantFunnelsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field( + default=None, + description=( + "Use this field to define the aggregation by a specific group from the group mapping that the user has" + " provided." + ), + ) + breakdownFilter: Optional[AssistantFunnelsBreakdownFilter] = Field( + default=None, description="Breakdown the chart by a property" + ) + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + funnelsFilter: Optional[AssistantFunnelsFilter] = Field( + default=None, description="Properties specific to the funnels insight" + ) + interval: Optional[IntervalType] = Field( + default=None, description="Granularity of the response. Can be one of `hour`, `day`, `week` or `month`" + ) + kind: Literal["FunnelsQuery"] = "FunnelsQuery" + properties: Optional[ + list[ + Union[ + Union[ + AssistantGenericPropertyFilter1, + AssistantGenericPropertyFilter2, + AssistantGenericPropertyFilter3, + AssistantGenericPropertyFilter4, + ], + Union[ + AssistantGroupPropertyFilter1, + AssistantGroupPropertyFilter2, + AssistantGroupPropertyFilter3, + AssistantGroupPropertyFilter4, + ], + ] + ] + ] = Field(default=[], description="Property filters for all series") + samplingFactor: Optional[float] = Field( + default=None, description="Sampling rate from 0 to 1 where 1 is 100% of the data." + ) + series: list[AssistantFunnelsEventsNode] = Field(..., description="Events to include") + + +class AssistantInsightsQueryBase(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + properties: Optional[ + list[ + Union[ + Union[ + AssistantGenericPropertyFilter1, + AssistantGenericPropertyFilter2, + AssistantGenericPropertyFilter3, + AssistantGenericPropertyFilter4, + ], + Union[ + AssistantGroupPropertyFilter1, + AssistantGroupPropertyFilter2, + AssistantGroupPropertyFilter3, + AssistantGroupPropertyFilter4, + ], + ] + ] + ] = Field(default=[], description="Property filters for all series") + samplingFactor: Optional[float] = Field( + default=None, description="Sampling rate from 0 to 1 where 1 is 100% of the data." + ) + + +class AssistantRetentionFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cumulative: Optional[bool] = Field( + default=None, + description=( + "Whether retention should be rolling (aka unbounded, cumulative). Rolling retention means that a user" + " coming back in period 5 makes them count towards all the previous periods." + ), + ) + period: Optional[RetentionPeriod] = Field( + default=RetentionPeriod.DAY, description="Retention period, the interval to track cohorts by." + ) + retentionReference: Optional[RetentionReference] = Field( + default=None, + description="Whether retention is with regard to initial cohort size, or that of the previous period.", + ) + retentionType: Optional[RetentionType] = Field( + default=None, + description=( + "Retention type: recurring or first time. Recurring retention counts a user as part of a cohort if they" + " performed the cohort event during that time period, irrespective of it was their first time or not. First" + " time retention only counts a user as part of the cohort if it was their first time performing the cohort" + " event." + ), + ) + returningEntity: Optional[RetentionEntity] = Field( + default=None, description="Retention event (event marking the user coming back)." + ) + showMean: Optional[bool] = Field( + default=None, + description=( + "Whether an additional series should be shown, showing the mean conversion for each period across cohorts." + ), + ) + targetEntity: Optional[RetentionEntity] = Field( + default=None, description="Activation event (event putting the actor into the initial cohort)." + ) + totalIntervals: Optional[int] = Field( + default=11, + description=( + "How many intervals to show in the chart. The default value is 11 (meaning 10 periods after initial" + " cohort)." + ), + ) + + +class AssistantRetentionQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + kind: Literal["RetentionQuery"] = "RetentionQuery" + properties: Optional[ + list[ + Union[ + Union[ + AssistantGenericPropertyFilter1, + AssistantGenericPropertyFilter2, + AssistantGenericPropertyFilter3, + AssistantGenericPropertyFilter4, + ], + Union[ + AssistantGroupPropertyFilter1, + AssistantGroupPropertyFilter2, + AssistantGroupPropertyFilter3, + AssistantGroupPropertyFilter4, + ], + ] + ] + ] = Field(default=[], description="Property filters for all series") + retentionFilter: AssistantRetentionFilter = Field(..., description="Properties specific to the retention insight") + samplingFactor: Optional[float] = Field( + default=None, description="Sampling rate from 0 to 1 where 1 is 100% of the data." + ) + + +class AssistantTrendsEventsNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = None + event: Optional[str] = Field(default=None, description="The event or `null` for all events.") + kind: Literal["EventsNode"] = "EventsNode" + math: Optional[ + Union[ + BaseMathType, + FunnelMathType, + PropertyMathType, + CountPerActorMathType, + Literal["unique_group"], + Literal["hogql"], + ] + ] = None + math_group_type_index: Optional[MathGroupTypeIndex] = None + math_property: Optional[str] = None + math_property_type: Optional[str] = None + name: Optional[str] = None + orderBy: Optional[list[str]] = Field(default=None, description="Columns to order by") + properties: Optional[ + list[ + Union[ + Union[ + AssistantGenericPropertyFilter1, + AssistantGenericPropertyFilter2, + AssistantGenericPropertyFilter3, + AssistantGenericPropertyFilter4, + ], + Union[ + AssistantGroupPropertyFilter1, + AssistantGroupPropertyFilter2, + AssistantGroupPropertyFilter3, + AssistantGroupPropertyFilter4, + ], + ] + ] + ] = None + response: Optional[dict[str, Any]] = None + + +class AssistantTrendsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdownFilter: Optional[AssistantTrendsBreakdownFilter] = Field( + default=None, description="Breakdown of the events" + ) + compareFilter: Optional[CompareFilter] = Field(default=None, description="Compare to date range") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + interval: Optional[IntervalType] = Field( + default=IntervalType.DAY, + description="Granularity of the response. Can be one of `hour`, `day`, `week` or `month`", + ) + kind: Literal["TrendsQuery"] = "TrendsQuery" + properties: Optional[ + list[ + Union[ + Union[ + AssistantGenericPropertyFilter1, + AssistantGenericPropertyFilter2, + AssistantGenericPropertyFilter3, + AssistantGenericPropertyFilter4, + ], + Union[ + AssistantGroupPropertyFilter1, + AssistantGroupPropertyFilter2, + AssistantGroupPropertyFilter3, + AssistantGroupPropertyFilter4, + ], + ] + ] + ] = Field(default=[], description="Property filters for all series") + samplingFactor: Optional[float] = Field( + default=None, description="Sampling rate from 0 to 1 where 1 is 100% of the data." + ) + series: list[AssistantTrendsEventsNode] = Field(..., description="Events to include") + trendsFilter: Optional[AssistantTrendsFilter] = Field( + default=None, description="Properties specific to the trends insight" + ) + + +class BreakdownItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + label: str + value: Union[str, int] + + +class CacheMissResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: Optional[str] = None + query_status: Optional[QueryStatus] = None + + +class CachedActorsPropertyTaxonomyQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: ActorsPropertyTaxonomyResponse + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedActorsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + limit: int + missing_actors_count: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + offset: int + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class CachedErrorTrackingQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + columns: Optional[list[str]] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[ErrorTrackingIssue] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedEventTaxonomyQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[EventTaxonomyItem] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedEventsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class CachedFunnelCorrelationResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: FunnelCorrelationResult + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class CachedFunnelsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + isUdf: Optional[bool] = None + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: Union[FunnelTimeToConvertResults, list[dict[str, Any]], list[list[dict[str, Any]]]] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedLifecycleQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedPathsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedSessionAttributionExplorerQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: Any + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class CachedSessionsTimelineQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[TimelineEntry] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedStickinessQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedSuggestedQuestionsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + is_cached: bool + last_refresh: AwareDatetime + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + questions: list[str] + timezone: str + + +class CachedTeamTaxonomyQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[TeamTaxonomyItem] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedTrendsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = Field(default=None, description="Wether more breakdown values are available.") + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedWebExternalClicksTableQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + samplingRate: Optional[SamplingRate] = None + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class CachedWebGoalsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + samplingRate: Optional[SamplingRate] = None + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class CachedWebOverviewQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + dateFrom: Optional[str] = None + dateTo: Optional[str] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[WebOverviewItem] + samplingRate: Optional[SamplingRate] = None + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class CachedWebStatsTableQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + samplingRate: Optional[SamplingRate] = None + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class DashboardFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + date_from: Optional[str] = None + date_to: Optional[str] = None + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = None + + +class Response(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class Response1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + limit: int + missing_actors_count: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: int + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class Response3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dateFrom: Optional[str] = None + dateTo: Optional[str] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[WebOverviewItem] + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class Response4(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class Response7(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: Any + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class Response8(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list[str]] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[ErrorTrackingIssue] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class DataWarehouseNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = None + distinct_id_field: str + fixedProperties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field( + default=None, + description="Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + ) + id: str + id_field: str + kind: Literal["DataWarehouseNode"] = "DataWarehouseNode" + math: Optional[ + Union[ + BaseMathType, + FunnelMathType, + PropertyMathType, + CountPerActorMathType, + Literal["unique_group"], + Literal["hogql"], + ] + ] = None + math_group_type_index: Optional[MathGroupTypeIndex] = None + math_hogql: Optional[str] = None + math_property: Optional[str] = None + math_property_type: Optional[str] = None + name: Optional[str] = None + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field(default=None, description="Properties configurable in the interface") + response: Optional[dict[str, Any]] = None + table_name: str + timestamp_field: str + + +class DatabaseSchemaBatchExportTable(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + fields: dict[str, DatabaseSchemaField] + id: str + name: str + type: Literal["batch_export"] = "batch_export" + + +class DatabaseSchemaDataWarehouseTable(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + fields: dict[str, DatabaseSchemaField] + format: str + id: str + name: str + schema_: Optional[DatabaseSchemaSchema] = Field(default=None, alias="schema") + source: Optional[DatabaseSchemaSource] = None + type: Literal["data_warehouse"] = "data_warehouse" + url_pattern: str + + +class EntityNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = None + fixedProperties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field( + default=None, + description="Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + ) + kind: NodeKind + math: Optional[ + Union[ + BaseMathType, + FunnelMathType, + PropertyMathType, + CountPerActorMathType, + Literal["unique_group"], + Literal["hogql"], + ] + ] = None + math_group_type_index: Optional[MathGroupTypeIndex] = None + math_hogql: Optional[str] = None + math_property: Optional[str] = None + math_property_type: Optional[str] = None + name: Optional[str] = None + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field(default=None, description="Properties configurable in the interface") + response: Optional[dict[str, Any]] = None + + +class ErrorTrackingQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list[str]] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[ErrorTrackingIssue] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class EventTaxonomyQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[EventTaxonomyItem] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class EventsNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = None + event: Optional[str] = Field(default=None, description="The event or `null` for all events.") + fixedProperties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field( + default=None, + description="Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + ) + kind: Literal["EventsNode"] = "EventsNode" + limit: Optional[int] = None + math: Optional[ + Union[ + BaseMathType, + FunnelMathType, + PropertyMathType, + CountPerActorMathType, + Literal["unique_group"], + Literal["hogql"], + ] + ] = None + math_group_type_index: Optional[MathGroupTypeIndex] = None + math_hogql: Optional[str] = None + math_property: Optional[str] = None + math_property_type: Optional[str] = None + name: Optional[str] = None + orderBy: Optional[list[str]] = Field(default=None, description="Columns to order by") + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field(default=None, description="Properties configurable in the interface") + response: Optional[dict[str, Any]] = None + + +class EventsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class FunnelCorrelationResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: FunnelCorrelationResult + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class FunnelExclusionActionsNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = None + fixedProperties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field( + default=None, + description="Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + ) + funnelFromStep: int + funnelToStep: int + id: int + kind: Literal["ActionsNode"] = "ActionsNode" + math: Optional[ + Union[ + BaseMathType, + FunnelMathType, + PropertyMathType, + CountPerActorMathType, + Literal["unique_group"], + Literal["hogql"], + ] + ] = None + math_group_type_index: Optional[MathGroupTypeIndex] = None + math_hogql: Optional[str] = None + math_property: Optional[str] = None + math_property_type: Optional[str] = None + name: Optional[str] = None + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field(default=None, description="Properties configurable in the interface") + response: Optional[dict[str, Any]] = None + + +class FunnelExclusionEventsNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = None + event: Optional[str] = Field(default=None, description="The event or `null` for all events.") + fixedProperties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field( + default=None, + description="Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + ) + funnelFromStep: int + funnelToStep: int + kind: Literal["EventsNode"] = "EventsNode" + limit: Optional[int] = None + math: Optional[ + Union[ + BaseMathType, + FunnelMathType, + PropertyMathType, + CountPerActorMathType, + Literal["unique_group"], + Literal["hogql"], + ] + ] = None + math_group_type_index: Optional[MathGroupTypeIndex] = None + math_hogql: Optional[str] = None + math_property: Optional[str] = None + math_property_type: Optional[str] = None + name: Optional[str] = None + orderBy: Optional[list[str]] = Field(default=None, description="Columns to order by") + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field(default=None, description="Properties configurable in the interface") + response: Optional[dict[str, Any]] = None + + +class FunnelsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + isUdf: Optional[bool] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: Union[FunnelTimeToConvertResults, list[dict[str, Any]], list[list[dict[str, Any]]]] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class GenericCachedQueryResponse(BaseModel): + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + is_cached: bool + last_refresh: AwareDatetime + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + timezone: str + + +class HogQLFilters(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dateRange: Optional[DateRange] = None + filterTestAccounts: Optional[bool] = None + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = None + + +class HogQLMetadataResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + errors: list[HogQLNotice] + isValid: Optional[bool] = None + isValidView: Optional[bool] = None + notices: list[HogQLNotice] + query: Optional[str] = None + table_names: Optional[list[str]] = None + warnings: list[HogQLNotice] + + +class HogQLQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + clickhouse: Optional[str] = Field(default=None, description="Executed ClickHouse query") + columns: Optional[list] = Field(default=None, description="Returned columns") + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + explain: Optional[list[str]] = Field(default=None, description="Query explanation output") + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + metadata: Optional[HogQLMetadataResponse] = Field(default=None, description="Query metadata output") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query: Optional[str] = Field(default=None, description="Input query string") + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = Field(default=None, description="Types of returned columns") + + +class InsightActorsQueryBase(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + includeRecordings: Optional[bool] = None + kind: NodeKind + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + response: Optional[ActorsQueryResponse] = None + + +class LifecycleQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class MultipleBreakdownOptions(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + values: list[BreakdownItem] + + +class PathsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class PersonsNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cohort: Optional[int] = None + distinctId: Optional[str] = None + fixedProperties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field( + default=None, + description="Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + ) + kind: Literal["PersonsNode"] = "PersonsNode" + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field(default=None, description="Properties configurable in the interface") + response: Optional[dict[str, Any]] = None + search: Optional[str] = None + + +class PropertyGroupFilterValue(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: FilterLogicalOperator + values: list[ + Union[ + PropertyGroupFilterValue, + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ], + ] + ] + + +class QueryResponseAlternative1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class QueryResponseAlternative2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + limit: int + missing_actors_count: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: int + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class QueryResponseAlternative3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdown: Optional[list[BreakdownItem]] = None + breakdowns: Optional[list[MultipleBreakdownOptions]] = None + compare: Optional[list[CompareItem]] = None + day: Optional[list[DayItem]] = None + interval: Optional[list[IntervalItem]] = None + series: Optional[list[Series]] = None + status: Optional[list[StatusItem]] = None + + +class QueryResponseAlternative4(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[TimelineEntry] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative6(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + clickhouse: Optional[str] = Field(default=None, description="Executed ClickHouse query") + columns: Optional[list] = Field(default=None, description="Returned columns") + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + explain: Optional[list[str]] = Field(default=None, description="Query explanation output") + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + metadata: Optional[HogQLMetadataResponse] = Field(default=None, description="Query metadata output") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query: Optional[str] = Field(default=None, description="Input query string") + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = Field(default=None, description="Types of returned columns") + + +class QueryResponseAlternative9(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dateFrom: Optional[str] = None + dateTo: Optional[str] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[WebOverviewItem] + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative10(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class QueryResponseAlternative13(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: Any + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class QueryResponseAlternative14(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list[str]] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[ErrorTrackingIssue] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative17(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class QueryResponseAlternative18(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: list + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: str = Field(..., description="Generated HogQL query.") + limit: int + missing_actors_count: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: int + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[list] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: list[str] + + +class QueryResponseAlternative19(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + clickhouse: Optional[str] = Field(default=None, description="Executed ClickHouse query") + columns: Optional[list] = Field(default=None, description="Returned columns") + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + explain: Optional[list[str]] = Field(default=None, description="Query explanation output") + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + metadata: Optional[HogQLMetadataResponse] = Field(default=None, description="Query metadata output") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query: Optional[str] = Field(default=None, description="Input query string") + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = Field(default=None, description="Types of returned columns") + + +class QueryResponseAlternative20(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dateFrom: Optional[str] = None + dateTo: Optional[str] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[WebOverviewItem] + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative21(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + samplingRate: Optional[SamplingRate] = None + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class QueryResponseAlternative24(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: Any + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class QueryResponseAlternative25(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list[str]] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[ErrorTrackingIssue] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative28(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = Field(default=None, description="Wether more breakdown values are available.") + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative29(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + isUdf: Optional[bool] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: Union[FunnelTimeToConvertResults, list[dict[str, Any]], list[list[dict[str, Any]]]] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative31(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[dict[str, Any]] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative34(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[list] = None + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: FunnelCorrelationResult + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = None + + +class QueryResponseAlternative37(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[TeamTaxonomyItem] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative38(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[EventTaxonomyItem] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class QueryResponseAlternative39(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: ActorsPropertyTaxonomyResponse + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class RecordingsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + has_next: bool + results: list[SessionRecordingType] + + +class RetentionResult(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + date: AwareDatetime + label: str + values: list[RetentionValue] + + +class SessionAttributionExplorerQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + filters: Optional[Filters] = None + groupBy: list[SessionAttributionGroupBy] + kind: Literal["SessionAttributionExplorerQuery"] = "SessionAttributionExplorerQuery" + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + response: Optional[SessionAttributionExplorerQueryResponse] = None + + +class SessionsTimelineQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + after: Optional[str] = Field( + default=None, description="Only fetch sessions that started after this timestamp (default: '-24h')" + ) + before: Optional[str] = Field( + default=None, description="Only fetch sessions that started before this timestamp (default: '+5s')" + ) + kind: Literal["SessionsTimelineQuery"] = "SessionsTimelineQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + personId: Optional[str] = Field(default=None, description="Fetch sessions only for a given person") + response: Optional[SessionsTimelineQueryResponse] = None + + +class TeamTaxonomyQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[TeamTaxonomyItem] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class VisualizationMessage(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + answer: Optional[Union[AssistantTrendsQuery, AssistantFunnelsQuery, AssistantRetentionQuery]] = None + id: Optional[str] = None + initiator: Optional[str] = None + plan: Optional[str] = None + type: Literal["ai/viz"] = "ai/viz" + + +class WebExternalClicksTableQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + compareFilter: Optional[CompareFilter] = None + conversionGoal: Optional[Union[ActionConversionGoal, CustomEventConversionGoal]] = None + dateRange: Optional[DateRange] = None + filterTestAccounts: Optional[bool] = None + kind: Literal["WebExternalClicksTableQuery"] = "WebExternalClicksTableQuery" + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: list[Union[EventPropertyFilter, PersonPropertyFilter, SessionPropertyFilter]] + response: Optional[WebExternalClicksTableQueryResponse] = None + sampling: Optional[Sampling] = None + stripQueryParams: Optional[bool] = None + useSessionsTable: Optional[bool] = None + + +class WebGoalsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + compareFilter: Optional[CompareFilter] = None + conversionGoal: Optional[Union[ActionConversionGoal, CustomEventConversionGoal]] = None + dateRange: Optional[DateRange] = None + filterTestAccounts: Optional[bool] = None + kind: Literal["WebGoalsQuery"] = "WebGoalsQuery" + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: list[Union[EventPropertyFilter, PersonPropertyFilter, SessionPropertyFilter]] + response: Optional[WebGoalsQueryResponse] = None + sampling: Optional[Sampling] = None + useSessionsTable: Optional[bool] = None + + +class WebOverviewQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + compareFilter: Optional[CompareFilter] = None + conversionGoal: Optional[Union[ActionConversionGoal, CustomEventConversionGoal]] = None + dateRange: Optional[DateRange] = None + filterTestAccounts: Optional[bool] = None + includeLCPScore: Optional[bool] = None + kind: Literal["WebOverviewQuery"] = "WebOverviewQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: list[Union[EventPropertyFilter, PersonPropertyFilter, SessionPropertyFilter]] + response: Optional[WebOverviewQueryResponse] = None + sampling: Optional[Sampling] = None + useSessionsTable: Optional[bool] = None + + +class WebStatsTableQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdownBy: WebStatsBreakdown + compareFilter: Optional[CompareFilter] = None + conversionGoal: Optional[Union[ActionConversionGoal, CustomEventConversionGoal]] = None + dateRange: Optional[DateRange] = None + doPathCleaning: Optional[bool] = None + filterTestAccounts: Optional[bool] = None + includeBounceRate: Optional[bool] = None + includeScrollDepth: Optional[bool] = None + kind: Literal["WebStatsTableQuery"] = "WebStatsTableQuery" + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: list[Union[EventPropertyFilter, PersonPropertyFilter, SessionPropertyFilter]] + response: Optional[WebStatsTableQueryResponse] = None + sampling: Optional[Sampling] = None + useSessionsTable: Optional[bool] = None + + +class ActionsNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custom_name: Optional[str] = None + fixedProperties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field( + default=None, + description="Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + ) + id: int + kind: Literal["ActionsNode"] = "ActionsNode" + math: Optional[ + Union[ + BaseMathType, + FunnelMathType, + PropertyMathType, + CountPerActorMathType, + Literal["unique_group"], + Literal["hogql"], + ] + ] = None + math_group_type_index: Optional[MathGroupTypeIndex] = None + math_hogql: Optional[str] = None + math_property: Optional[str] = None + math_property_type: Optional[str] = None + name: Optional[str] = None + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field(default=None, description="Properties configurable in the interface") + response: Optional[dict[str, Any]] = None + + +class ActorsPropertyTaxonomyQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + group_type_index: Optional[int] = None + kind: Literal["ActorsPropertyTaxonomyQuery"] = "ActorsPropertyTaxonomyQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + property: str + response: Optional[ActorsPropertyTaxonomyQueryResponse] = None + + +class AnyResponseType( + RootModel[ + Union[ + dict[str, Any], + HogQueryResponse, + HogQLQueryResponse, + HogQLMetadataResponse, + HogQLAutocompleteResponse, + Any, + EventsQueryResponse, + ErrorTrackingQueryResponse, + ] + ] +): + root: Union[ + dict[str, Any], + HogQueryResponse, + HogQLQueryResponse, + HogQLMetadataResponse, + HogQLAutocompleteResponse, + Any, + EventsQueryResponse, + ErrorTrackingQueryResponse, + ] + + +class CachedHogQLQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + clickhouse: Optional[str] = Field(default=None, description="Executed ClickHouse query") + columns: Optional[list] = Field(default=None, description="Returned columns") + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + explain: Optional[list[str]] = Field(default=None, description="Query explanation output") + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + limit: Optional[int] = None + metadata: Optional[HogQLMetadataResponse] = Field(default=None, description="Query metadata output") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + offset: Optional[int] = None + query: Optional[str] = Field(default=None, description="Input query string") + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = Field(default=None, description="Types of returned columns") + + +class CachedInsightActorsQueryOptionsResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdown: Optional[list[BreakdownItem]] = None + breakdowns: Optional[list[MultipleBreakdownOptions]] = None + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + compare: Optional[list[CompareItem]] = None + day: Optional[list[DayItem]] = None + interval: Optional[list[IntervalItem]] = None + is_cached: bool + last_refresh: AwareDatetime + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + series: Optional[list[Series]] = None + status: Optional[list[StatusItem]] = None + timezone: str + + +class CachedRetentionQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + is_cached: bool + last_refresh: AwareDatetime + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + next_allowed_client_refresh: AwareDatetime + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[RetentionResult] + timezone: str + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class Response2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + clickhouse: Optional[str] = Field(default=None, description="Executed ClickHouse query") + columns: Optional[list] = Field(default=None, description="Returned columns") + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + explain: Optional[list[str]] = Field(default=None, description="Query explanation output") + hasMore: Optional[bool] = None + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + limit: Optional[int] = None + metadata: Optional[HogQLMetadataResponse] = Field(default=None, description="Query metadata output") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + query: Optional[str] = Field(default=None, description="Input query string") + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + types: Optional[list] = Field(default=None, description="Types of returned columns") + + +class EventTaxonomyQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + event: str + kind: Literal["EventTaxonomyQuery"] = "EventTaxonomyQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[list[str]] = None + response: Optional[EventTaxonomyQueryResponse] = None + + +class FunnelsFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + binCount: Optional[int] = None + breakdownAttributionType: Optional[BreakdownAttributionType] = BreakdownAttributionType.FIRST_TOUCH + breakdownAttributionValue: Optional[int] = None + exclusions: Optional[list[Union[FunnelExclusionEventsNode, FunnelExclusionActionsNode]]] = [] + funnelAggregateByHogQL: Optional[str] = None + funnelFromStep: Optional[int] = None + funnelOrderType: Optional[StepOrderValue] = StepOrderValue.ORDERED + funnelStepReference: Optional[FunnelStepReference] = FunnelStepReference.TOTAL + funnelToStep: Optional[int] = None + funnelVizType: Optional[FunnelVizType] = FunnelVizType.STEPS + funnelWindowInterval: Optional[int] = 14 + funnelWindowIntervalUnit: Optional[FunnelConversionWindowTimeUnit] = FunnelConversionWindowTimeUnit.DAY + hiddenLegendBreakdowns: Optional[list[str]] = None + layout: Optional[FunnelLayout] = FunnelLayout.VERTICAL + resultCustomizations: Optional[dict[str, ResultCustomizationByValue]] = Field( + default=None, description="Customizations for the appearance of result datasets." + ) + useUdf: Optional[bool] = None + + +class HogQLQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + explain: Optional[bool] = None + filters: Optional[HogQLFilters] = None + kind: Literal["HogQLQuery"] = "HogQLQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query: str + response: Optional[HogQLQueryResponse] = None + values: Optional[dict[str, Any]] = Field( + default=None, description="Constant values that can be referenced with the {placeholder} syntax in the query" + ) + variables: Optional[dict[str, HogQLVariable]] = Field( + default=None, description="Variables to be subsituted into the query" + ) + + +class InsightActorsQueryOptionsResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdown: Optional[list[BreakdownItem]] = None + breakdowns: Optional[list[MultipleBreakdownOptions]] = None + compare: Optional[list[CompareItem]] = None + day: Optional[list[DayItem]] = None + interval: Optional[list[IntervalItem]] = None + series: Optional[list[Series]] = None + status: Optional[list[StatusItem]] = None + + +class InsightFilter( + RootModel[Union[TrendsFilter, FunnelsFilter, RetentionFilter, PathsFilter, StickinessFilter, LifecycleFilter]] +): + root: Union[TrendsFilter, FunnelsFilter, RetentionFilter, PathsFilter, StickinessFilter, LifecycleFilter] + + +class PropertyGroupFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: FilterLogicalOperator + values: list[PropertyGroupFilterValue] + + +class QueryResponseAlternative30(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[RetentionResult] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class RecordingsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + actions: Optional[list[dict[str, Any]]] = None + console_log_filters: Optional[list[LogEntryPropertyFilter]] = None + date_from: Optional[str] = "-3d" + date_to: Optional[str] = None + events: Optional[list[dict[str, Any]]] = None + filter_test_accounts: Optional[bool] = None + having_predicates: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = None + kind: Literal["RecordingsQuery"] = "RecordingsQuery" + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + operand: Optional[FilterLogicalOperator] = FilterLogicalOperator.AND_ + order: Optional[RecordingOrder] = RecordingOrder.START_TIME + person_uuid: Optional[str] = None + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = None + response: Optional[RecordingsQueryResponse] = None + session_ids: Optional[list[str]] = None + user_modified_filters: Optional[dict[str, Any]] = None + + +class RetentionQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error: Optional[str] = Field( + default=None, + description="Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.", + ) + hogql: Optional[str] = Field(default=None, description="Generated HogQL query.") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + results: list[RetentionResult] + timings: Optional[list[QueryTiming]] = Field( + default=None, description="Measured timings for different parts of the query generation process" + ) + + +class RootAssistantMessage( + RootModel[ + Union[VisualizationMessage, ReasoningMessage, AssistantMessage, HumanMessage, FailureMessage, RouterMessage] + ] +): + root: Union[VisualizationMessage, ReasoningMessage, AssistantMessage, HumanMessage, FailureMessage, RouterMessage] + + +class StickinessQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + compareFilter: Optional[CompareFilter] = Field(default=None, description="Compare to date range") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + interval: Optional[IntervalType] = Field( + default=IntervalType.DAY, + description="Granularity of the response. Can be one of `hour`, `day`, `week` or `month`", + ) + kind: Literal["StickinessQuery"] = "StickinessQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[StickinessQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + series: list[Union[EventsNode, ActionsNode, DataWarehouseNode]] = Field( + ..., description="Events and actions to include" + ) + stickinessFilter: Optional[StickinessFilter] = Field( + default=None, description="Properties specific to the stickiness insight" + ) + + +class TeamTaxonomyQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + kind: Literal["TeamTaxonomyQuery"] = "TeamTaxonomyQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + response: Optional[TeamTaxonomyQueryResponse] = None + + +class TrendsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + breakdownFilter: Optional[BreakdownFilter] = Field(default=None, description="Breakdown of the events and actions") + compareFilter: Optional[CompareFilter] = Field(default=None, description="Compare to date range") + conversionGoal: Optional[Union[ActionConversionGoal, CustomEventConversionGoal]] = Field( + default=None, description="Whether we should be comparing against a specific conversion goal" + ) + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + interval: Optional[IntervalType] = Field( + default=IntervalType.DAY, + description="Granularity of the response. Can be one of `hour`, `day`, `week` or `month`", + ) + kind: Literal["TrendsQuery"] = "TrendsQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[TrendsQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + series: list[Union[EventsNode, ActionsNode, DataWarehouseNode]] = Field( + ..., description="Events and actions to include" + ) + trendsFilter: Optional[TrendsFilter] = Field(default=None, description="Properties specific to the trends insight") + + +class CachedExperimentTrendsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + count_query: Optional[TrendsQuery] = None + credible_intervals: dict[str, list[float]] + exposure_query: Optional[TrendsQuery] = None + insight: list[dict[str, Any]] + is_cached: bool + kind: Literal["ExperimentTrendsQuery"] = "ExperimentTrendsQuery" + last_refresh: AwareDatetime + next_allowed_client_refresh: AwareDatetime + p_value: float + probability: dict[str, float] + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + timezone: str + variants: list[ExperimentVariantTrendsBaseStats] + + +class Response10(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + count_query: Optional[TrendsQuery] = None + credible_intervals: dict[str, list[float]] + exposure_query: Optional[TrendsQuery] = None + insight: list[dict[str, Any]] + kind: Literal["ExperimentTrendsQuery"] = "ExperimentTrendsQuery" + p_value: float + probability: dict[str, float] + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + variants: list[ExperimentVariantTrendsBaseStats] + + +class DataVisualizationNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + chartSettings: Optional[ChartSettings] = None + display: Optional[ChartDisplayType] = None + kind: Literal["DataVisualizationNode"] = "DataVisualizationNode" + source: HogQLQuery + tableSettings: Optional[TableSettings] = None + + +class DatabaseSchemaMaterializedViewTable(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + fields: dict[str, DatabaseSchemaField] + id: str + last_run_at: Optional[str] = None + name: str + query: HogQLQuery + status: Optional[str] = None + type: Literal["materialized_view"] = "materialized_view" + + +class DatabaseSchemaViewTable(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + fields: dict[str, DatabaseSchemaField] + id: str + name: str + query: HogQLQuery + type: Literal["view"] = "view" + + +class ErrorTrackingQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + assignee: Optional[int] = None + dateRange: DateRange + filterGroup: Optional[PropertyGroupFilter] = None + filterTestAccounts: Optional[bool] = None + issueId: Optional[str] = None + kind: Literal["ErrorTrackingQuery"] = "ErrorTrackingQuery" + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + orderBy: Optional[OrderBy] = None + response: Optional[ErrorTrackingQueryResponse] = None + searchQuery: Optional[str] = None + select: Optional[list[str]] = None + + +class EventsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + actionId: Optional[int] = Field(default=None, description="Show events matching a given action") + after: Optional[str] = Field(default=None, description="Only fetch events that happened after this timestamp") + before: Optional[str] = Field(default=None, description="Only fetch events that happened before this timestamp") + event: Optional[str] = Field(default=None, description="Limit to events matching this string") + filterTestAccounts: Optional[bool] = Field(default=None, description="Filter test accounts") + fixedProperties: Optional[ + list[ + Union[ + PropertyGroupFilter, + PropertyGroupFilterValue, + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ], + ] + ] + ] = Field( + default=None, + description="Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)", + ) + kind: Literal["EventsQuery"] = "EventsQuery" + limit: Optional[int] = Field(default=None, description="Number of rows to return") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = Field(default=None, description="Number of rows to skip before returning rows") + orderBy: Optional[list[str]] = Field(default=None, description="Columns to order by") + personId: Optional[str] = Field(default=None, description="Show events for a given person") + properties: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = Field(default=None, description="Properties configurable in the interface") + response: Optional[EventsQueryResponse] = None + select: list[str] = Field(..., description="Return a limited set of data. Required.") + where: Optional[list[str]] = Field(default=None, description="HogQL filters to apply on returned data") + + +class ExperimentTrendsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + count_query: Optional[TrendsQuery] = None + credible_intervals: dict[str, list[float]] + exposure_query: Optional[TrendsQuery] = None + insight: list[dict[str, Any]] + kind: Literal["ExperimentTrendsQuery"] = "ExperimentTrendsQuery" + p_value: float + probability: dict[str, float] + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + variants: list[ExperimentVariantTrendsBaseStats] + + +class FunnelsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + breakdownFilter: Optional[BreakdownFilter] = Field(default=None, description="Breakdown of the events and actions") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + funnelsFilter: Optional[FunnelsFilter] = Field( + default=None, description="Properties specific to the funnels insight" + ) + interval: Optional[IntervalType] = Field( + default=None, description="Granularity of the response. Can be one of `hour`, `day`, `week` or `month`" + ) + kind: Literal["FunnelsQuery"] = "FunnelsQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[FunnelsQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + series: list[Union[EventsNode, ActionsNode, DataWarehouseNode]] = Field( + ..., description="Events and actions to include" + ) + + +class HasPropertiesNode(RootModel[Union[EventsNode, EventsQuery, PersonsNode]]): + root: Union[EventsNode, EventsQuery, PersonsNode] + + +class InsightsQueryBaseFunnelsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + kind: NodeKind + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[FunnelsQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + + +class InsightsQueryBaseLifecycleQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + kind: NodeKind + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[LifecycleQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + + +class InsightsQueryBasePathsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + kind: NodeKind + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[PathsQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + + +class InsightsQueryBaseRetentionQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + kind: NodeKind + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[RetentionQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + + +class InsightsQueryBaseTrendsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + kind: NodeKind + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[TrendsQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + + +class LifecycleQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + interval: Optional[IntervalType] = Field( + default=IntervalType.DAY, + description="Granularity of the response. Can be one of `hour`, `day`, `week` or `month`", + ) + kind: Literal["LifecycleQuery"] = "LifecycleQuery" + lifecycleFilter: Optional[LifecycleFilter] = Field( + default=None, description="Properties specific to the lifecycle insight" + ) + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[LifecycleQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + series: list[Union[EventsNode, ActionsNode, DataWarehouseNode]] = Field( + ..., description="Events and actions to include" + ) + + +class QueryResponseAlternative15(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + credible_intervals: dict[str, list[float]] + expected_loss: float + funnels_query: Optional[FunnelsQuery] = None + insight: list[list[dict[str, Any]]] + kind: Literal["ExperimentFunnelsQuery"] = "ExperimentFunnelsQuery" + probability: dict[str, float] + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + variants: list[ExperimentVariantFunnelsBaseStats] + + +class QueryResponseAlternative16(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + count_query: Optional[TrendsQuery] = None + credible_intervals: dict[str, list[float]] + exposure_query: Optional[TrendsQuery] = None + insight: list[dict[str, Any]] + kind: Literal["ExperimentTrendsQuery"] = "ExperimentTrendsQuery" + p_value: float + probability: dict[str, float] + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + variants: list[ExperimentVariantTrendsBaseStats] + + +class QueryResponseAlternative26(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + credible_intervals: dict[str, list[float]] + expected_loss: float + funnels_query: Optional[FunnelsQuery] = None + insight: list[list[dict[str, Any]]] + kind: Literal["ExperimentFunnelsQuery"] = "ExperimentFunnelsQuery" + probability: dict[str, float] + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + variants: list[ExperimentVariantFunnelsBaseStats] + + +class QueryResponseAlternative27(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + count_query: Optional[TrendsQuery] = None + credible_intervals: dict[str, list[float]] + exposure_query: Optional[TrendsQuery] = None + insight: list[dict[str, Any]] + kind: Literal["ExperimentTrendsQuery"] = "ExperimentTrendsQuery" + p_value: float + probability: dict[str, float] + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + variants: list[ExperimentVariantTrendsBaseStats] + + +class RetentionQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + kind: Literal["RetentionQuery"] = "RetentionQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[RetentionQueryResponse] = None + retentionFilter: RetentionFilter = Field(..., description="Properties specific to the retention insight") + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + + +class CachedExperimentFunnelsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + cache_key: str + cache_target_age: Optional[AwareDatetime] = None + calculation_trigger: Optional[str] = Field( + default=None, description="What triggered the calculation of the query, leave empty if user/immediate" + ) + credible_intervals: dict[str, list[float]] + expected_loss: float + funnels_query: Optional[FunnelsQuery] = None + insight: list[list[dict[str, Any]]] + is_cached: bool + kind: Literal["ExperimentFunnelsQuery"] = "ExperimentFunnelsQuery" + last_refresh: AwareDatetime + next_allowed_client_refresh: AwareDatetime + probability: dict[str, float] + query_status: Optional[QueryStatus] = Field( + default=None, description="Query status indicates whether next to the provided data, a query is still running." + ) + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + timezone: str + variants: list[ExperimentVariantFunnelsBaseStats] + + +class Response9(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + credible_intervals: dict[str, list[float]] + expected_loss: float + funnels_query: Optional[FunnelsQuery] = None + insight: list[list[dict[str, Any]]] + kind: Literal["ExperimentFunnelsQuery"] = "ExperimentFunnelsQuery" + probability: dict[str, float] + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + variants: list[ExperimentVariantFunnelsBaseStats] + + +class ExperimentFunnelsQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + credible_intervals: dict[str, list[float]] + expected_loss: float + funnels_query: Optional[FunnelsQuery] = None + insight: list[list[dict[str, Any]]] + kind: Literal["ExperimentFunnelsQuery"] = "ExperimentFunnelsQuery" + probability: dict[str, float] + significance_code: ExperimentSignificanceCode + significant: bool + stats_version: Optional[int] = None + variants: list[ExperimentVariantFunnelsBaseStats] + + +class ExperimentTrendsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + count_query: TrendsQuery + experiment_id: Optional[int] = None + exposure_query: Optional[TrendsQuery] = None + kind: Literal["ExperimentTrendsQuery"] = "ExperimentTrendsQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + name: Optional[str] = None + response: Optional[ExperimentTrendsQueryResponse] = None + + +class FunnelPathsFilter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + funnelPathType: Optional[FunnelPathType] = None + funnelSource: FunnelsQuery + funnelStep: Optional[int] = None + + +class FunnelsActorsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + funnelCustomSteps: Optional[list[int]] = Field( + default=None, + description=( + "Custom step numbers to get persons for. This overrides `funnelStep`. Primarily for correlation use." + ), + ) + funnelStep: Optional[int] = Field( + default=None, + description=( + "Index of the step for which we want to get the timestamp for, per person. Positive for converted persons," + " negative for dropped of persons." + ), + ) + funnelStepBreakdown: Optional[Union[int, str, float, list[Union[int, str, float]]]] = Field( + default=None, + description=( + "The breakdown value for which to get persons for. This is an array for person and event properties, a" + " string for groups and an integer for cohorts." + ), + ) + funnelTrendsDropOff: Optional[bool] = None + funnelTrendsEntrancePeriodStart: Optional[str] = Field( + default=None, + description="Used together with `funnelTrendsDropOff` for funnels time conversion date for the persons modal.", + ) + includeRecordings: Optional[bool] = None + kind: Literal["FunnelsActorsQuery"] = "FunnelsActorsQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + response: Optional[ActorsQueryResponse] = None + source: FunnelsQuery + + +class PathsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + aggregation_group_type_index: Optional[int] = Field(default=None, description="Groups aggregation") + dataColorTheme: Optional[float] = Field(default=None, description="Colors used in the insight's visualization") + dateRange: Optional[DateRange] = Field(default=None, description="Date range for the query") + filterTestAccounts: Optional[bool] = Field( + default=False, description="Exclude internal and test users by applying the respective filters" + ) + funnelPathsFilter: Optional[FunnelPathsFilter] = Field( + default=None, description="Used for displaying paths in relation to funnel steps." + ) + kind: Literal["PathsQuery"] = "PathsQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + pathsFilter: PathsFilter = Field(..., description="Properties specific to the paths insight") + properties: Optional[ + Union[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ], + PropertyGroupFilter, + ] + ] = Field(default=[], description="Property filters for all series") + response: Optional[PathsQueryResponse] = None + samplingFactor: Optional[float] = Field(default=None, description="Sampling rate") + + +class QueryResponseAlternative35(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + tables: dict[ + str, + Union[ + DatabaseSchemaPostHogTable, + DatabaseSchemaDataWarehouseTable, + DatabaseSchemaViewTable, + DatabaseSchemaBatchExportTable, + DatabaseSchemaMaterializedViewTable, + ], + ] + + +class QueryResponseAlternative( + RootModel[ + Union[ + dict[str, Any], + QueryResponseAlternative1, + QueryResponseAlternative2, + QueryResponseAlternative3, + QueryResponseAlternative4, + QueryResponseAlternative5, + QueryResponseAlternative6, + QueryResponseAlternative7, + QueryResponseAlternative8, + QueryResponseAlternative9, + QueryResponseAlternative10, + QueryResponseAlternative13, + QueryResponseAlternative14, + QueryResponseAlternative15, + QueryResponseAlternative16, + Any, + QueryResponseAlternative17, + QueryResponseAlternative18, + QueryResponseAlternative19, + QueryResponseAlternative20, + QueryResponseAlternative21, + QueryResponseAlternative24, + QueryResponseAlternative25, + QueryResponseAlternative26, + QueryResponseAlternative27, + QueryResponseAlternative28, + QueryResponseAlternative29, + QueryResponseAlternative30, + QueryResponseAlternative31, + QueryResponseAlternative34, + QueryResponseAlternative35, + QueryResponseAlternative36, + QueryResponseAlternative37, + QueryResponseAlternative38, + QueryResponseAlternative39, + ] + ] +): + root: Union[ + dict[str, Any], + QueryResponseAlternative1, + QueryResponseAlternative2, + QueryResponseAlternative3, + QueryResponseAlternative4, + QueryResponseAlternative5, + QueryResponseAlternative6, + QueryResponseAlternative7, + QueryResponseAlternative8, + QueryResponseAlternative9, + QueryResponseAlternative10, + QueryResponseAlternative13, + QueryResponseAlternative14, + QueryResponseAlternative15, + QueryResponseAlternative16, + Any, + QueryResponseAlternative17, + QueryResponseAlternative18, + QueryResponseAlternative19, + QueryResponseAlternative20, + QueryResponseAlternative21, + QueryResponseAlternative24, + QueryResponseAlternative25, + QueryResponseAlternative26, + QueryResponseAlternative27, + QueryResponseAlternative28, + QueryResponseAlternative29, + QueryResponseAlternative30, + QueryResponseAlternative31, + QueryResponseAlternative34, + QueryResponseAlternative35, + QueryResponseAlternative36, + QueryResponseAlternative37, + QueryResponseAlternative38, + QueryResponseAlternative39, + ] + + +class DatabaseSchemaQueryResponse(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + tables: dict[ + str, + Union[ + DatabaseSchemaPostHogTable, + DatabaseSchemaDataWarehouseTable, + DatabaseSchemaViewTable, + DatabaseSchemaBatchExportTable, + DatabaseSchemaMaterializedViewTable, + ], + ] + + +class ExperimentFunnelsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + experiment_id: Optional[int] = None + funnels_query: FunnelsQuery + kind: Literal["ExperimentFunnelsQuery"] = "ExperimentFunnelsQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + name: Optional[str] = None + response: Optional[ExperimentFunnelsQueryResponse] = None + + +class FunnelCorrelationQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + funnelCorrelationEventExcludePropertyNames: Optional[list[str]] = None + funnelCorrelationEventNames: Optional[list[str]] = None + funnelCorrelationExcludeEventNames: Optional[list[str]] = None + funnelCorrelationExcludeNames: Optional[list[str]] = None + funnelCorrelationNames: Optional[list[str]] = None + funnelCorrelationType: FunnelCorrelationResultsType + kind: Literal["FunnelCorrelationQuery"] = "FunnelCorrelationQuery" + response: Optional[FunnelCorrelationResponse] = None + source: FunnelsActorsQuery + + +class InsightVizNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + embedded: Optional[bool] = Field(default=None, description="Query is embedded inside another bordered component") + full: Optional[bool] = Field( + default=None, description="Show with most visual options enabled. Used in insight scene." + ) + hidePersonsModal: Optional[bool] = None + kind: Literal["InsightVizNode"] = "InsightVizNode" + showCorrelationTable: Optional[bool] = None + showFilters: Optional[bool] = None + showHeader: Optional[bool] = None + showLastComputation: Optional[bool] = None + showLastComputationRefresh: Optional[bool] = None + showResults: Optional[bool] = None + showTable: Optional[bool] = None + source: Union[TrendsQuery, FunnelsQuery, RetentionQuery, PathsQuery, StickinessQuery, LifecycleQuery] = Field( + ..., discriminator="kind" + ) + suppressSessionAnalysisWarning: Optional[bool] = None + vizSpecificOptions: Optional[VizSpecificOptions] = None + + +class DatabaseSchemaQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + kind: Literal["DatabaseSchemaQuery"] = "DatabaseSchemaQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + response: Optional[DatabaseSchemaQueryResponse] = None + + +class FunnelCorrelationActorsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + funnelCorrelationPersonConverted: Optional[bool] = None + funnelCorrelationPersonEntity: Optional[Union[EventsNode, ActionsNode, DataWarehouseNode]] = None + funnelCorrelationPropertyValues: Optional[ + list[ + Union[ + EventPropertyFilter, + PersonPropertyFilter, + ElementPropertyFilter, + SessionPropertyFilter, + CohortPropertyFilter, + RecordingPropertyFilter, + LogEntryPropertyFilter, + GroupPropertyFilter, + FeaturePropertyFilter, + HogQLPropertyFilter, + EmptyPropertyFilter, + DataWarehousePropertyFilter, + DataWarehousePersonPropertyFilter, + ] + ] + ] = None + includeRecordings: Optional[bool] = None + kind: Literal["FunnelCorrelationActorsQuery"] = "FunnelCorrelationActorsQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + response: Optional[ActorsQueryResponse] = None + source: FunnelCorrelationQuery + + +class InsightActorsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + breakdown: Optional[Union[str, list[str], int]] = None + compare: Optional[Compare] = None + day: Optional[Union[str, int]] = None + includeRecordings: Optional[bool] = None + interval: Optional[int] = Field( + default=None, description="An interval selected out of available intervals in source query." + ) + kind: Literal["InsightActorsQuery"] = "InsightActorsQuery" + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + response: Optional[ActorsQueryResponse] = None + series: Optional[int] = None + source: Union[TrendsQuery, FunnelsQuery, RetentionQuery, PathsQuery, StickinessQuery, LifecycleQuery] = Field( + ..., discriminator="kind" + ) + status: Optional[str] = None + + +class InsightActorsQueryOptions(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + kind: Literal["InsightActorsQueryOptions"] = "InsightActorsQueryOptions" + response: Optional[InsightActorsQueryOptionsResponse] = None + source: Union[InsightActorsQuery, FunnelsActorsQuery, FunnelCorrelationActorsQuery] + + +class ActorsQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + fixedProperties: Optional[ + list[Union[PersonPropertyFilter, CohortPropertyFilter, HogQLPropertyFilter, EmptyPropertyFilter]] + ] = Field( + default=None, + description=( + "Currently only person filters supported. No filters for querying groups. See `filter_conditions()` in" + " actor_strategies.py." + ), + ) + kind: Literal["ActorsQuery"] = "ActorsQuery" + limit: Optional[int] = None + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + offset: Optional[int] = None + orderBy: Optional[list[str]] = None + properties: Optional[ + list[Union[PersonPropertyFilter, CohortPropertyFilter, HogQLPropertyFilter, EmptyPropertyFilter]] + ] = Field( + default=None, + description=( + "Currently only person filters supported. No filters for querying groups. See `filter_conditions()` in" + " actor_strategies.py." + ), + ) + response: Optional[ActorsQueryResponse] = None + search: Optional[str] = None + select: Optional[list[str]] = None + source: Optional[Union[InsightActorsQuery, FunnelsActorsQuery, FunnelCorrelationActorsQuery, HogQLQuery]] = None + + +class DataTableNode(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + allowSorting: Optional[bool] = Field( + default=None, description="Can the user click on column headers to sort the table? (default: true)" + ) + columns: Optional[list[str]] = Field( + default=None, description="Columns shown in the table, unless the `source` provides them." + ) + embedded: Optional[bool] = Field(default=None, description="Uses the embedded version of LemonTable") + expandable: Optional[bool] = Field( + default=None, description="Can expand row to show raw event data (default: true)" + ) + full: Optional[bool] = Field(default=None, description="Show with most visual options enabled. Used in scenes.") + hiddenColumns: Optional[list[str]] = Field( + default=None, description="Columns that aren't shown in the table, even if in columns or returned data" + ) + kind: Literal["DataTableNode"] = "DataTableNode" + propertiesViaUrl: Optional[bool] = Field(default=None, description="Link properties via the URL (default: false)") + response: Optional[ + Union[ + dict[str, Any], + Response, + Response1, + Response2, + Response3, + Response4, + Response7, + Response8, + Response9, + Response10, + ] + ] = None + showActions: Optional[bool] = Field(default=None, description="Show the kebab menu at the end of the row") + showColumnConfigurator: Optional[bool] = Field( + default=None, description="Show a button to configure the table's columns if possible" + ) + showDateRange: Optional[bool] = Field(default=None, description="Show date range selector") + showElapsedTime: Optional[bool] = Field(default=None, description="Show the time it takes to run a query") + showEventFilter: Optional[bool] = Field( + default=None, description="Include an event filter above the table (EventsNode only)" + ) + showExport: Optional[bool] = Field(default=None, description="Show the export button") + showHogQLEditor: Optional[bool] = Field(default=None, description="Include a HogQL query editor above HogQL tables") + showOpenEditorButton: Optional[bool] = Field( + default=None, description="Show a button to open the current query as a new insight. (default: true)" + ) + showPersistentColumnConfigurator: Optional[bool] = Field( + default=None, description="Show a button to configure and persist the table's default columns if possible" + ) + showPropertyFilter: Optional[Union[bool, list[TaxonomicFilterGroupType]]] = Field( + default=None, description="Include a property filter above the table" + ) + showReload: Optional[bool] = Field(default=None, description="Show a reload button") + showResultsTable: Optional[bool] = Field(default=None, description="Show a results table") + showSavedQueries: Optional[bool] = Field(default=None, description="Shows a list of saved queries") + showSearch: Optional[bool] = Field(default=None, description="Include a free text search field (PersonsNode only)") + showTestAccountFilters: Optional[bool] = Field(default=None, description="Show filter to exclude test accounts") + showTimings: Optional[bool] = Field(default=None, description="Show a detailed query timing breakdown") + source: Union[ + EventsNode, + EventsQuery, + PersonsNode, + ActorsQuery, + HogQLQuery, + WebOverviewQuery, + WebStatsTableQuery, + WebExternalClicksTableQuery, + WebGoalsQuery, + SessionAttributionExplorerQuery, + ErrorTrackingQuery, + ExperimentFunnelsQuery, + ExperimentTrendsQuery, + ] = Field(..., description="Source of the events") + + +class HogQLAutocomplete(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + endPosition: int = Field(..., description="End position of the editor word") + filters: Optional[HogQLFilters] = Field(default=None, description="Table to validate the expression against") + globals: Optional[dict[str, Any]] = Field(default=None, description="Global values in scope") + kind: Literal["HogQLAutocomplete"] = "HogQLAutocomplete" + language: HogLanguage = Field(..., description="Language to validate") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query: str = Field(..., description="Query to validate") + response: Optional[HogQLAutocompleteResponse] = None + sourceQuery: Optional[ + Union[ + EventsNode, + ActionsNode, + PersonsNode, + EventsQuery, + ActorsQuery, + InsightActorsQuery, + InsightActorsQueryOptions, + SessionsTimelineQuery, + HogQuery, + HogQLQuery, + HogQLMetadata, + HogQLAutocomplete, + WebOverviewQuery, + WebStatsTableQuery, + WebExternalClicksTableQuery, + WebGoalsQuery, + SessionAttributionExplorerQuery, + ErrorTrackingQuery, + ExperimentFunnelsQuery, + ExperimentTrendsQuery, + RecordingsQuery, + ] + ] = Field(default=None, description="Query in whose context to validate.") + startPosition: int = Field(..., description="Start position of the editor word") + + +class HogQLMetadata(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + debug: Optional[bool] = Field( + default=None, description="Enable more verbose output, usually run from the /debug page" + ) + filters: Optional[HogQLFilters] = Field(default=None, description="Extra filters applied to query via {filters}") + globals: Optional[dict[str, Any]] = Field(default=None, description="Extra globals for the query") + kind: Literal["HogQLMetadata"] = "HogQLMetadata" + language: HogLanguage = Field(..., description="Language to validate") + modifiers: Optional[HogQLQueryModifiers] = Field( + default=None, description="Modifiers used when performing the query" + ) + query: str = Field(..., description="Query to validate") + response: Optional[HogQLMetadataResponse] = None + sourceQuery: Optional[ + Union[ + EventsNode, + ActionsNode, + PersonsNode, + EventsQuery, + ActorsQuery, + InsightActorsQuery, + InsightActorsQueryOptions, + SessionsTimelineQuery, + HogQuery, + HogQLQuery, + HogQLMetadata, + HogQLAutocomplete, + WebOverviewQuery, + WebStatsTableQuery, + WebExternalClicksTableQuery, + WebGoalsQuery, + SessionAttributionExplorerQuery, + ErrorTrackingQuery, + ExperimentFunnelsQuery, + ExperimentTrendsQuery, + RecordingsQuery, + ] + ] = Field( + default=None, + description='Query within which "expr" and "template" are validated. Defaults to "select * from events"', + ) + variables: Optional[dict[str, HogQLVariable]] = Field( + default=None, description="Variables to be subsituted into the query" + ) + + +class QueryRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + async_: Optional[bool] = Field(default=None, alias="async") + client_query_id: Optional[str] = Field( + default=None, description="Client provided query ID. Can be used to retrieve the status or cancel the query." + ) + filters_override: Optional[DashboardFilter] = None + query: Union[ + EventsNode, + ActionsNode, + PersonsNode, + DataWarehouseNode, + EventsQuery, + ActorsQuery, + InsightActorsQuery, + InsightActorsQueryOptions, + SessionsTimelineQuery, + HogQuery, + HogQLQuery, + HogQLMetadata, + HogQLAutocomplete, + WebOverviewQuery, + WebStatsTableQuery, + WebExternalClicksTableQuery, + WebGoalsQuery, + SessionAttributionExplorerQuery, + ErrorTrackingQuery, + ExperimentFunnelsQuery, + ExperimentTrendsQuery, + DataVisualizationNode, + DataTableNode, + SavedInsightNode, + InsightVizNode, + TrendsQuery, + FunnelsQuery, + RetentionQuery, + PathsQuery, + StickinessQuery, + LifecycleQuery, + FunnelCorrelationQuery, + DatabaseSchemaQuery, + SuggestedQuestionsQuery, + TeamTaxonomyQuery, + EventTaxonomyQuery, + ActorsPropertyTaxonomyQuery, + ] = Field( + ..., + description=( + "Submit a JSON string representing a query for PostHog data analysis, for example a HogQL query.\n\nExample" + ' payload:\n\n```\n\n{"query": {"kind": "HogQLQuery", "query": "select * from events limit' + ' 100"}}\n\n```\n\nFor more details on HogQL queries, see the [PostHog HogQL' + " documentation](/docs/hogql#api-access)." + ), + discriminator="kind", + ) + refresh: Optional[Union[bool, str]] = Field( + default="blocking", + description=( + "Whether results should be calculated sync or async, and how much to rely on the cache:\n- `'blocking'` -" + " calculate synchronously (returning only when the query is done), UNLESS there are very fresh results in" + " the cache\n- `'async'` - kick off background calculation (returning immediately with a query status)," + " UNLESS there are very fresh results in the cache\n- `'lazy_async'` - kick off background calculation," + " UNLESS there are somewhat fresh results in the cache\n- `'force_blocking'` - calculate synchronously," + " even if fresh results are already cached\n- `'force_async'` - kick off background calculation, even if" + " fresh results are already cached\n- `'force_cache'` - return cached data or a cache miss; always" + " completes immediately as it never calculates Background calculation can be tracked using the" + " `query_status` response field." + ), + ) + variables_override: Optional[dict[str, dict[str, Any]]] = None + + +class QuerySchemaRoot( + RootModel[ + Union[ + EventsNode, + ActionsNode, + PersonsNode, + DataWarehouseNode, + EventsQuery, + ActorsQuery, + InsightActorsQuery, + InsightActorsQueryOptions, + SessionsTimelineQuery, + HogQuery, + HogQLQuery, + HogQLMetadata, + HogQLAutocomplete, + WebOverviewQuery, + WebStatsTableQuery, + WebExternalClicksTableQuery, + WebGoalsQuery, + SessionAttributionExplorerQuery, + ErrorTrackingQuery, + ExperimentFunnelsQuery, + ExperimentTrendsQuery, + DataVisualizationNode, + DataTableNode, + SavedInsightNode, + InsightVizNode, + TrendsQuery, + FunnelsQuery, + RetentionQuery, + PathsQuery, + StickinessQuery, + LifecycleQuery, + FunnelCorrelationQuery, + DatabaseSchemaQuery, + SuggestedQuestionsQuery, + TeamTaxonomyQuery, + EventTaxonomyQuery, + ActorsPropertyTaxonomyQuery, + ] + ] +): + root: Union[ + EventsNode, + ActionsNode, + PersonsNode, + DataWarehouseNode, + EventsQuery, + ActorsQuery, + InsightActorsQuery, + InsightActorsQueryOptions, + SessionsTimelineQuery, + HogQuery, + HogQLQuery, + HogQLMetadata, + HogQLAutocomplete, + WebOverviewQuery, + WebStatsTableQuery, + WebExternalClicksTableQuery, + WebGoalsQuery, + SessionAttributionExplorerQuery, + ErrorTrackingQuery, + ExperimentFunnelsQuery, + ExperimentTrendsQuery, + DataVisualizationNode, + DataTableNode, + SavedInsightNode, + InsightVizNode, + TrendsQuery, + FunnelsQuery, + RetentionQuery, + PathsQuery, + StickinessQuery, + LifecycleQuery, + FunnelCorrelationQuery, + DatabaseSchemaQuery, + SuggestedQuestionsQuery, + TeamTaxonomyQuery, + EventTaxonomyQuery, + ActorsPropertyTaxonomyQuery, + ] = Field(..., discriminator="kind") + + +PropertyGroupFilterValue.model_rebuild() +QueryRequest.model_rebuild()