:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"compareFilter": {
"description": "Compare to date range. When enabled, shows the current and previous period side by side.",
"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"
},
"dateRange": {
"anyOf": [
{
"properties": {
"date_from": {
"description": "ISO8601 date string.",
"type": "string"
},
"date_to": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
"type": "object"
},
{
"properties": {
"date_from": {
"description": "Duration in the past. Supported units are: `h` (hour), `d` (day), `w` (week), `m` (month), `y` (year), `all` (all time). Use the `Start` suffix to define the exact left date boundary. Examples: `-1d` last day from now, `-180d` last 180 days from now, `mStart` this month start, `-1dStart` yesterday's start.",
"type": "string"
}
},
"required": ["date_from"],
"type": "object"
}
],
"description": "Date range for the query"
},
"filterTestAccounts": {
"description": "Exclude internal and test users by applying the respective filters. When omitted, follows the project's \"Filter out internal and test users\" default setting.",
"type": "boolean"
},
"interval": {
"default": "day",
"description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`. This determines what counts as one \"interval\" for stickiness measurement. For example, with `day` interval over a 30-day range, the X-axis shows 1 through 30 days, and each bar/point shows how many users performed the event on exactly that many days.",
"enum": ["second", "minute", "hour", "day", "week", "month", "quarter", "year"],
"type": "string"
},
"intervalCount": {
"description": "How many base intervals comprise one stickiness period. Defaults to 1. For example, `interval: \"day\"` with `intervalCount: 7` groups by 7-day periods.",
"maximum": 9007199254740991,
"minimum": 1,
"type": "integer"
},
"kind": {
"const": "StickinessQuery",
"default": "StickinessQuery",
"type": "string"
},
"output_format": {
"default": "optimized",
"description": "Output format. \"optimized\" returns a human-readable summary from server-side formatters (recommended for analysis). \"json\" returns the raw query results as JSON.",
"enum": ["optimized", "json"],
"type": "string"
},
"properties": {
"default": [],
"description": "Property filters for all series",
"items": {
"anyOf": [
{
"anyOf": [
{
"anyOf": [
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"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.",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"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. Use the string values `true` or `false` for boolean properties.",
"type": "string"
}
},
"required": ["key", "operator", "type", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": ["exact", "gt", "lt"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["key", "operator", "type", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
"enum": ["exact", "is_not"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"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"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": ["is_date_exact", "is_date_before", "is_date_after"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"type": "string"
},
"value": {
"description": "Value must be a date in ISO 8601 format.",
"type": "string"
}
},
"required": ["key", "operator", "type", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"type": "string"
}
},
"required": ["key", "operator", "type"],
"type": "object"
}
]
},
{
"anyOf": [
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"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.",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"type": {
"const": "group",
"default": "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. Use the string values `true` or `false` for boolean properties.",
"type": "string"
}
},
"required": ["group_type_index", "key", "operator", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": ["exact", "gt", "lt"],
"type": "string"
},
"type": {
"const": "group",
"default": "group",
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["group_type_index", "key", "operator", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
"enum": ["exact", "is_not"],
"type": "string"
},
"type": {
"const": "group",
"default": "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", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": ["is_date_exact", "is_date_before", "is_date_after"],
"type": "string"
},
"type": {
"const": "group",
"default": "group",
"type": "string"
},
"value": {
"description": "Value must be a date in ISO 8601 format.",
"type": "string"
}
},
"required": ["group_type_index", "key", "operator", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"const": "group",
"default": "group",
"type": "string"
}
},
"required": ["group_type_index", "key", "operator"],
"type": "object"
}
]
},
{
"properties": {
"key": {
"const": "id",
"default": "id",
"type": "string"
},
"operator": {
"default": "in",
"enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
"description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
"description": "The cohort ID to filter by.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
}
},
"required": ["value"],
"type": "object"
},
{
"anyOf": [
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"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.",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"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. Use the string values `true` or `false` for boolean properties.",
"type": "string"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"enum": ["exact", "gt", "lt"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
"enum": ["exact", "is_not"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"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", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"enum": ["is_date_exact", "is_date_before", "is_date_after"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"type": "string"
},
"value": {
"description": "Value must be a date in ISO 8601 format.",
"type": "string"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"type": "string"
}
},
"required": ["key", "operator"],
"type": "object"
}
]
},
{
"properties": {
"key": {
"description": "A HogQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
"type": "string"
},
"type": {
"const": "hogql",
"default": "hogql",
"description": "Filter by a HogQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
"type": "string"
}
},
"required": ["key"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The feature flag key.",
"type": "string"
},
"operator": {
"const": "flag_evaluates_to",
"default": "flag_evaluates_to",
"type": "string"
},
"type": {
"const": "flag",
"default": "flag",
"description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
"type": "string"
},
"value": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
],
"description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
}
},
"required": ["key", "value"],
"type": "object"
}
]
},
{
"properties": {
"event_filters": {
"description": "Extra property filters the matching events must satisfy. Deliberately excludes nested behavioral/cohort filters and groups",
"items": {
"anyOf": [
{
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
"operator": {
"default": "exact",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"starts_with",
"not_starts_with",
"ends_with",
"not_ends_with",
"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",
"is_cleaned_path_exact",
"is_cleaned_path_not_exact",
"flag_evaluates_to",
"semver_eq",
"semver_neq",
"semver_gt",
"semver_gte",
"semver_lt",
"semver_lte",
"semver_tilde",
"semver_caret",
"semver_wildcard",
"icontains_multi",
"not_icontains_multi"
],
"type": "string"
},
"type": {
"const": "event",
"default": "event",
"description": "Event properties",
"type": "string"
},
"value": {
"anyOf": [
{
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
{
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
}
},
"required": ["key"],
"type": "object"
},
{
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
"operator": {
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"starts_with",
"not_starts_with",
"ends_with",
"not_ends_with",
"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",
"is_cleaned_path_exact",
"is_cleaned_path_not_exact",
"flag_evaluates_to",
"semver_eq",
"semver_neq",
"semver_gt",
"semver_gte",
"semver_lt",
"semver_lte",
"semver_tilde",
"semver_caret",
"semver_wildcard",
"icontains_multi",
"not_icontains_multi"
],
"type": "string"
},
"type": {
"const": "person",
"default": "person",
"description": "Person properties",
"type": "string"
},
"value": {
"anyOf": [
{
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
{
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
}
},
"required": ["key", "operator"],
"type": "object"
},
{
"properties": {
"key": {
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"label": {
"type": "string"
},
"operator": {
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"starts_with",
"not_starts_with",
"ends_with",
"not_ends_with",
"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",
"is_cleaned_path_exact",
"is_cleaned_path_not_exact",
"flag_evaluates_to",
"semver_eq",
"semver_neq",
"semver_gt",
"semver_gte",
"semver_lt",
"semver_lte",
"semver_tilde",
"semver_caret",
"semver_wildcard",
"icontains_multi",
"not_icontains_multi"
],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"type": "string"
},
"value": {
"anyOf": [
{
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
{
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
}
},
"required": ["key", "operator"],
"type": "object"
},
{
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
"operator": {
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"starts_with",
"not_starts_with",
"ends_with",
"not_ends_with",
"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",
"is_cleaned_path_exact",
"is_cleaned_path_not_exact",
"flag_evaluates_to",
"semver_eq",
"semver_neq",
"semver_gt",
"semver_gte",
"semver_lt",
"semver_lte",
"semver_tilde",
"semver_caret",
"semver_wildcard",
"icontains_multi",
"not_icontains_multi"
],
"type": "string"
},
"type": {
"const": "feature",
"default": "feature",
"description": "Event property with \"$feature/\" prepended",
"type": "string"
},
"value": {
"anyOf": [
{
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
{
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
}
},
"required": ["key", "operator"],
"type": "object"
},
{
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
"type": {
"const": "hogql",
"default": "hogql",
"type": "string"
},
"value": {
"anyOf": [
{
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
{
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
}
},
"required": ["key"],
"type": "object"
}
]
},
"type": "array"
},
"event_type": {
"enum": ["events", "actions"],
"type": "string"
},
"explicit_datetime": {
"description": "Absolute or relative (e.g. -30d) lower date bound — alternative to time_value/time_interval",
"type": "string"
},
"explicit_datetime_to": {
"type": "string"
},
"key": {
"description": "Event name, or action id when event_type is 'actions'",
"type": "string"
},
"label": {
"type": "string"
},
"negation": {
"description": "Match persons who did NOT satisfy the criterion. Not the same as a low count — zero-occurrence persons never match count operators",
"type": "boolean"
},
"operator": {
"enum": ["exact", "gt", "gte", "lt", "lte"],
"type": "string"
},
"operator_value": {
"description": "Count threshold for performed_event_multiple",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"time_interval": {
"enum": ["day", "week", "month", "year"],
"type": "string"
},
"time_value": {
"description": "Relative time window size, paired with time_interval",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"type": {
"const": "behavioral",
"default": "behavioral",
"description": "Person performed (or didn't perform) an event in a time window. ClickHouse-only — not evaluable by flags or CDP",
"type": "string"
},
"value": {
"enum": ["performed_event", "performed_event_multiple"],
"type": "string"
}
},
"required": ["event_type", "key", "value"],
"type": "object"
}
]
},
"type": "array"
},
"series": {
"description": "Events or actions to include. Each series measures how many intervals (e.g. days) within the date range a user performed the event. Prioritize the more popular and fresh events and actions. When the `math` field is omitted on a series, it defaults to counting unique persons.",
"items": {
"anyOf": [
{
"properties": {
"custom_name": {
"type": "string"
},
"event": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The event or `null` for all events."
},
"kind": {
"const": "EventsNode",
"default": "EventsNode",
"type": "string"
},
"math": {
"anyOf": [
{
"enum": [
"total",
"dau",
"weekly_active",
"monthly_active",
"unique_session",
"first_time_for_user",
"first_matching_event_for_user"
],
"type": "string"
},
{
"enum": ["total", "first_time_for_user", "first_time_for_user_with_filters"],
"type": "string"
},
{
"enum": ["avg", "sum", "min", "max", "median", "p75", "p90", "p95", "p99"],
"type": "string"
},
{
"enum": [
"avg_count_per_actor",
"min_count_per_actor",
"max_count_per_actor",
"median_count_per_actor",
"p75_count_per_actor",
"p90_count_per_actor",
"p95_count_per_actor",
"p99_count_per_actor"
],
"type": "string"
},
{
"enum": [
"unique_group",
"first_time_for_group",
"first_matching_event_for_group"
],
"type": "string"
},
{
"const": "hogql",
"type": "string"
},
{
"enum": [
"total",
"sum",
"unique_session",
"min",
"max",
"avg",
"dau",
"unique_group",
"hogql"
],
"type": "string"
},
{
"enum": ["total", "dau"],
"type": "string"
}
]
},
"math_group_type_index": {
"anyOf": [
{
"const": 0,
"type": "number"
},
{
"const": 1,
"type": "number"
},
{
"const": 2,
"type": "number"
},
{
"const": 3,
"type": "number"
},
{
"const": 4,
"type": "number"
}
]
},
"math_hogql": {
"description": "Custom HogQL expression for aggregation. Use when the predefined `math` types are not sufficient. When set, `math` must be set to `hogql`.\n\nExamples:\n- Sum a numeric property: `sum(toFloat(properties.$revenue))`\n- Average of a property: `avg(toFloat(properties.load_time))`\n- Count distinct values: `count(distinct properties.$session_id)`\n- Conditional count: `countIf(toFloat(properties.duration) > 30)`\n- Percentile: `quantile(0.95)(toFloat(properties.response_time))`",
"type": "string"
},
"math_multiplier": {
"type": "number"
},
"math_property": {
"type": "string"
},
"math_property_type": {
"type": "string"
},
"name": {
"type": "string"
},
"properties": {
"items": {
"anyOf": [
{
"anyOf": [
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"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.",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"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. Use the string values `true` or `false` for boolean properties.",
"type": "string"
}
},
"required": ["key", "operator", "type", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": ["exact", "gt", "lt"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["key", "operator", "type", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
"enum": ["exact", "is_not"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"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"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": [
"is_date_exact",
"is_date_before",
"is_date_after"
],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"type": "string"
},
"value": {
"description": "Value must be a date in ISO 8601 format.",
"type": "string"
}
},
"required": ["key", "operator", "type", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"type": "string"
}
},
"required": ["key", "operator", "type"],
"type": "object"
}
]
},
{
"anyOf": [
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"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.",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"type": {
"const": "group",
"default": "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. Use the string values `true` or `false` for boolean properties.",
"type": "string"
}
},
"required": ["group_type_index", "key", "operator", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": ["exact", "gt", "lt"],
"type": "string"
},
"type": {
"const": "group",
"default": "group",
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["group_type_index", "key", "operator", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
"enum": ["exact", "is_not"],
"type": "string"
},
"type": {
"const": "group",
"default": "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", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": [
"is_date_exact",
"is_date_before",
"is_date_after"
],
"type": "string"
},
"type": {
"const": "group",
"default": "group",
"type": "string"
},
"value": {
"description": "Value must be a date in ISO 8601 format.",
"type": "string"
}
},
"required": ["group_type_index", "key", "operator", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"const": "group",
"default": "group",
"type": "string"
}
},
"required": ["group_type_index", "key", "operator"],
"type": "object"
}
]
},
{
"properties": {
"key": {
"const": "id",
"default": "id",
"type": "string"
},
"operator": {
"default": "in",
"enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
"description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
"description": "The cohort ID to filter by.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
}
},
"required": ["value"],
"type": "object"
},
{
"anyOf": [
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"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.",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"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. Use the string values `true` or `false` for boolean properties.",
"type": "string"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"enum": ["exact", "gt", "lt"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
"enum": ["exact", "is_not"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"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", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"enum": [
"is_date_exact",
"is_date_before",
"is_date_after"
],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"type": "string"
},
"value": {
"description": "Value must be a date in ISO 8601 format.",
"type": "string"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"type": "string"
}
},
"required": ["key", "operator"],
"type": "object"
}
]
},
{
"properties": {
"key": {
"description": "A HogQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
"type": "string"
},
"type": {
"const": "hogql",
"default": "hogql",
"description": "Filter by a HogQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
"type": "string"
}
},
"required": ["key"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The feature flag key.",
"type": "string"
},
"operator": {
"const": "flag_evaluates_to",
"default": "flag_evaluates_to",
"type": "string"
},
"type": {
"const": "flag",
"default": "flag",
"description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
"type": "string"
},
"value": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
],
"description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
}
},
"required": ["key", "value"],
"type": "object"
}
]
},
"type": "array"
}
},
"type": "object"
},
{
"properties": {
"custom_name": {
"type": "string"
},
"id": {
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"kind": {
"const": "ActionsNode",
"default": "ActionsNode",
"type": "string"
},
"math": {
"anyOf": [
{
"enum": [
"total",
"dau",
"weekly_active",
"monthly_active",
"unique_session",
"first_time_for_user",
"first_matching_event_for_user"
],
"type": "string"
},
{
"enum": ["total", "first_time_for_user", "first_time_for_user_with_filters"],
"type": "string"
},
{
"enum": ["avg", "sum", "min", "max", "median", "p75", "p90", "p95", "p99"],
"type": "string"
},
{
"enum": [
"avg_count_per_actor",
"min_count_per_actor",
"max_count_per_actor",
"median_count_per_actor",
"p75_count_per_actor",
"p90_count_per_actor",
"p95_count_per_actor",
"p99_count_per_actor"
],
"type": "string"
},
{
"enum": [
"unique_group",
"first_time_for_group",
"first_matching_event_for_group"
],
"type": "string"
},
{
"const": "hogql",
"type": "string"
},
{
"enum": [
"total",
"sum",
"unique_session",
"min",
"max",
"avg",
"dau",
"unique_group",
"hogql"
],
"type": "string"
},
{
"enum": ["total", "dau"],
"type": "string"
}
]
},
"math_group_type_index": {
"anyOf": [
{
"const": 0,
"type": "number"
},
{
"const": 1,
"type": "number"
},
{
"const": 2,
"type": "number"
},
{
"const": 3,
"type": "number"
},
{
"const": 4,
"type": "number"
}
]
},
"math_hogql": {
"description": "Custom HogQL expression for aggregation. Use when the predefined `math` types are not sufficient. When set, `math` must be set to `hogql`.\n\nExamples:\n- Sum a numeric property: `sum(toFloat(properties.$revenue))`\n- Average of a property: `avg(toFloat(properties.load_time))`\n- Count distinct values: `count(distinct properties.$session_id)`\n- Conditional count: `countIf(toFloat(properties.duration) > 30)`\n- Percentile: `quantile(0.95)(toFloat(properties.response_time))`",
"type": "string"
},
"math_multiplier": {
"type": "number"
},
"math_property": {
"type": "string"
},
"math_property_type": {
"type": "string"
},
"name": {
"description": "Action name from the plan.",
"type": "string"
},
"properties": {
"items": {
"anyOf": [
{
"anyOf": [
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"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.",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"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. Use the string values `true` or `false` for boolean properties.",
"type": "string"
}
},
"required": ["key", "operator", "type", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": ["exact", "gt", "lt"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["key", "operator", "type", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
"enum": ["exact", "is_not"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"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"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": [
"is_date_exact",
"is_date_before",
"is_date_after"
],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"type": "string"
},
"value": {
"description": "Value must be a date in ISO 8601 format.",
"type": "string"
}
},
"required": ["key", "operator", "type", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"enum": ["event", "person", "session", "feature"],
"type": "string"
}
},
"required": ["key", "operator", "type"],
"type": "object"
}
]
},
{
"anyOf": [
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"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.",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"type": {
"const": "group",
"default": "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. Use the string values `true` or `false` for boolean properties.",
"type": "string"
}
},
"required": ["group_type_index", "key", "operator", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": ["exact", "gt", "lt"],
"type": "string"
},
"type": {
"const": "group",
"default": "group",
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["group_type_index", "key", "operator", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
"enum": ["exact", "is_not"],
"type": "string"
},
"type": {
"const": "group",
"default": "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", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"enum": [
"is_date_exact",
"is_date_before",
"is_date_after"
],
"type": "string"
},
"type": {
"const": "group",
"default": "group",
"type": "string"
},
"value": {
"description": "Value must be a date in ISO 8601 format.",
"type": "string"
}
},
"required": ["group_type_index", "key", "operator", "value"],
"type": "object"
},
{
"properties": {
"group_type_index": {
"description": "Index of the group type from the group mapping.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"key": {
"description": "Use one of the properties the user has provided in the plan.",
"type": "string"
},
"operator": {
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"const": "group",
"default": "group",
"type": "string"
}
},
"required": ["group_type_index", "key", "operator"],
"type": "object"
}
]
},
{
"properties": {
"key": {
"const": "id",
"default": "id",
"type": "string"
},
"operator": {
"default": "in",
"enum": ["in", "not_in"],
"type": "string"
},
"type": {
"const": "cohort",
"default": "cohort",
"description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
"type": "string"
},
"value": {
"description": "The cohort ID to filter by.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
}
},
"required": ["value"],
"type": "object"
},
{
"anyOf": [
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"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.",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"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. Use the string values `true` or `false` for boolean properties.",
"type": "string"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"enum": ["exact", "gt", "lt"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
"enum": ["exact", "is_not"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"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", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"enum": [
"is_date_exact",
"is_date_before",
"is_date_after"
],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"type": "string"
},
"value": {
"description": "Value must be a date in ISO 8601 format.",
"type": "string"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
"enum": ["tag_name", "text", "href", "selector"],
"type": "string"
},
"operator": {
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"const": "element",
"default": "element",
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
"type": "string"
}
},
"required": ["key", "operator"],
"type": "object"
}
]
},
{
"properties": {
"key": {
"description": "A HogQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
"type": "string"
},
"type": {
"const": "hogql",
"default": "hogql",
"description": "Filter by a HogQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
"type": "string"
}
},
"required": ["key"],
"type": "object"
},
{
"properties": {
"key": {
"description": "The feature flag key.",
"type": "string"
},
"operator": {
"const": "flag_evaluates_to",
"default": "flag_evaluates_to",
"type": "string"
},
"type": {
"const": "flag",
"default": "flag",
"description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
"type": "string"
},
"value": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
],
"description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
}
},
"required": ["key", "value"],
"type": "object"
}
]
},
"type": "array"
}
},
"required": ["id", "name"],
"type": "object"
}
]
},
"type": "array"
},
"stickinessFilter": {
"description": "Properties specific to the stickiness insight",
"properties": {
"computedAs": {
"default": "non_cumulative",
"description": "Computation mode. `non_cumulative` (default) shows users active on exactly N intervals. `cumulative` shows users active on N or more intervals.",
"enum": ["non_cumulative", "cumulative"],
"type": "string"
},
"display": {
"default": "ActionsLineGraph",
"description": "Visualization type for the stickiness chart. `ActionsLineGraph` - line chart (default). `ActionsBar` - bar chart. `ActionsAreaGraph` - area chart.",
"enum": ["ActionsLineGraph", "ActionsBar", "ActionsAreaGraph"],
"type": "string"
},
"showLegend": {
"default": false,
"description": "Whether to show the legend describing series.",
"type": "boolean"
},
"showValuesOnSeries": {
"default": false,
"description": "Whether to show a value on each data point.",
"type": "boolean"
},
"stickinessCriteria": {
"description": "Filter which intervals count based on event frequency within each interval. For example, only count intervals where the user performed the event >= 3 times.",
"properties": {
"operator": {
"enum": ["gte", "lte", "exact"],
"type": "string"
},
"value": {
"maximum": 9007199254740991,
"minimum": 1,
"type": "integer"
}
},
"required": ["operator", "value"],
"type": "object"
}
},
"type": "object"
}
},
"required": ["series"],
"type": "object"
}