: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",
"anyOf": [
{
"description": "Typed configuration for the events model.",
"properties": {
"data_interval_end": {
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
"data_interval_start": {
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
"exclude": {
"items": {
"type": "string"
},
"type": "array"
},
"file": {
"description": "Typed configuration for a FileDownload batch-export destination.",
"properties": {
"compression": {
"anyOf": [
{
"description": "* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd",
"enum": ["brotli", "gzip", "lz4", "snappy", "zstd"],
"type": "string"
},
{
"type": "null"
}
],
"description": "Compress the file with a supported compression format\n\n* `zstd` - zstd\n* `gzip` - gzip\n* `brotli` - brotli\n* `lz4` - lz4\n* `snappy` - snappy"
},
"format": {
"default": "Parquet",
"description": "File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",
"enum": ["Parquet", "JSONLines"],
"type": "string"
},
"max_size_mb": {
"anyOf": [
{
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
],
"default": 1024,
"description": "Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size."
}
},
"type": "object"
},
"include": {
"items": {
"type": "string"
},
"type": "array"
},
"model": {
"enum": ["events"],
"type": "string"
}
},
"required": ["file", "model", "data_interval_start", "data_interval_end"],
"type": "object"
},
{
"description": "Typed configuration for the persons model.",
"properties": {
"data_interval_end": {
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
"data_interval_start": {
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
"file": {
"description": "Typed configuration for a FileDownload batch-export destination.",
"properties": {
"compression": {
"anyOf": [
{
"description": "* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd",
"enum": ["brotli", "gzip", "lz4", "snappy", "zstd"],
"type": "string"
},
{
"type": "null"
}
],
"description": "Compress the file with a supported compression format\n\n* `zstd` - zstd\n* `gzip` - gzip\n* `brotli` - brotli\n* `lz4` - lz4\n* `snappy` - snappy"
},
"format": {
"default": "Parquet",
"description": "File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",
"enum": ["Parquet", "JSONLines"],
"type": "string"
},
"max_size_mb": {
"anyOf": [
{
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
],
"default": 1024,
"description": "Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size."
}
},
"type": "object"
},
"model": {
"enum": ["persons"],
"type": "string"
}
},
"required": ["file", "model", "data_interval_start", "data_interval_end"],
"type": "object"
},
{
"description": "Typed configuration for the sessions model.",
"properties": {
"data_interval_end": {
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
"data_interval_start": {
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
"file": {
"description": "Typed configuration for a FileDownload batch-export destination.",
"properties": {
"compression": {
"anyOf": [
{
"description": "* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd",
"enum": ["brotli", "gzip", "lz4", "snappy", "zstd"],
"type": "string"
},
{
"type": "null"
}
],
"description": "Compress the file with a supported compression format\n\n* `zstd` - zstd\n* `gzip` - gzip\n* `brotli` - brotli\n* `lz4` - lz4\n* `snappy` - snappy"
},
"format": {
"default": "Parquet",
"description": "File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",
"enum": ["Parquet", "JSONLines"],
"type": "string"
},
"max_size_mb": {
"anyOf": [
{
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
],
"default": 1024,
"description": "Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size."
}
},
"type": "object"
},
"model": {
"enum": ["sessions"],
"type": "string"
}
},
"required": ["file", "model", "data_interval_start", "data_interval_end"],
"type": "object"
},
{
"description": "Typed configuration for the hogql model.",
"properties": {
"data_interval_end": {
"description": "End of the export interval. Required for the events, persons, and sessions models. For HogQL, required only when the query references {data_interval_end}. A supplied end must not be in the future or precede a supplied start. Bounds replace HogQL placeholders; they do not add filters to the query.",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
"data_interval_start": {
"description": "Start of the export interval. Required for the events, persons, and sessions models. For HogQL, required only when the query references {data_interval_start}. A supplied start must not be in the future. When both bounds are supplied, the interval must span at most seven days.",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
"file": {
"description": "Typed configuration for a FileDownload batch-export destination.",
"properties": {
"compression": {
"anyOf": [
{
"description": "* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd",
"enum": ["brotli", "gzip", "lz4", "snappy", "zstd"],
"type": "string"
},
{
"type": "null"
}
],
"description": "Compress the file with a supported compression format\n\n* `zstd` - zstd\n* `gzip` - gzip\n* `brotli` - brotli\n* `lz4` - lz4\n* `snappy` - snappy"
},
"format": {
"default": "Parquet",
"description": "File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",
"enum": ["Parquet", "JSONLines"],
"type": "string"
},
"max_size_mb": {
"anyOf": [
{
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
],
"default": 1024,
"description": "Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size."
}
},
"type": "object"
},
"hogql_modifiers": {
"description": "HogQL modifiers to use when the query runs, as an object keyed by modifier name, for example {\"convertToProjectTimezone\": true}. Only supported when 'model' is 'hogql'. Each modifier set here overrides the project modifier with the same name, and the project modifiers apply to all others. If neither sets convertToProjectTimezone, it defaults to false, so timestamps are exported in UTC. Set it to true to export timestamps in the project timezone instead. Unknown modifier names are rejected. On update, the object replaces the modifiers stored on the export, so include every modifier to keep, or send null to remove them all.",
"properties": {
"bounceRateDurationSeconds": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"bounceRatePageViewMode": {
"anyOf": [
{
"enum": ["count_pageviews", "uniq_urls", "uniq_page_screen_autocaptures"],
"type": "string"
},
{
"type": "null"
}
]
},
"convertToProjectTimezone": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"cookielessTrafficIsRegular": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Do not treat a missing user agent as automation on cookieless events. Positive bot signals and custom project rules still apply. Resolved server-side; not intended to be set by clients."
},
"customBotDefinitions": {
"anyOf": [
{
"items": {
"properties": {
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Reported by `$virt_traffic_category`. Defaults to `custom`."
},
"combiner": {
"description": "Whether every condition must match (AND) or any one of them (OR).",
"enum": ["AND", "OR"],
"type": "string"
},
"id": {
"type": "string"
},
"items": {
"items": {
"properties": {
"id": {
"type": "string"
},
"key": {
"description": "The event property this condition reads.",
"enum": [
"$raw_user_agent",
"$ip",
"$lib",
"$host",
"$pathname",
"$current_url",
"$browser",
"$os",
"$browser_language",
"$screen_width",
"$screen_height",
"$geoip_country_code",
"$referrer",
"$referring_domain"
],
"type": "string"
},
"matcher": {
"enum": ["contains", "regex", "exact", "cidr"],
"type": "string"
},
"pattern": {
"description": "Matched against the property named by `key`.",
"type": "string"
}
},
"required": ["id", "key", "matcher", "pattern"],
"type": "object"
},
"type": "array"
},
"name": {
"description": "Reported by `$virt_bot_name` and `$virt_bot_operator` when the rule matches.",
"type": "string"
}
},
"required": ["combiner", "id", "items", "name"],
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
]
},
"customChannelTypeRules": {
"anyOf": [
{
"items": {
"properties": {
"channel_type": {
"type": "string"
},
"combiner": {
"enum": ["AND", "OR"],
"type": "string"
},
"id": {
"type": "string"
},
"items": {
"items": {
"properties": {
"id": {
"type": "string"
},
"key": {
"enum": [
"utm_source",
"utm_medium",
"utm_campaign",
"referring_domain",
"url",
"pathname",
"hostname"
],
"type": "string"
},
"op": {
"enum": [
"exact",
"is_not",
"is_set",
"is_not_set",
"icontains",
"not_icontains",
"regex",
"not_regex"
],
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
]
}
},
"required": ["id", "key", "op"],
"type": "object"
},
"type": "array"
}
},
"required": ["channel_type", "combiner", "id", "items"],
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
]
},
"dataWarehouseEventsModifiers": {
"anyOf": [
{
"items": {
"properties": {
"distinct_id_field": {
"type": "string"
},
"id_field": {
"type": "string"
},
"table_name": {
"type": "string"
},
"timestamp_field": {
"type": "string"
}
},
"required": ["distinct_id_field", "id_field", "table_name", "timestamp_field"],
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
]
},
"debug": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"forceClickhouseDataSkippingIndexes": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "If these are provided, the query will fail if these skip indexes are not used"
},
"formatCsvAllowDoubleQuotes": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"inCohortVia": {
"anyOf": [
{
"enum": ["auto", "leftjoin", "subquery", "leftjoin_conjoined"],
"type": "string"
},
{
"type": "null"
}
]
},
"inlineCohortCalculation": {
"anyOf": [
{
"enum": ["off", "auto", "always"],
"type": "string"
},
{
"type": "null"
}
]
},
"materializationMode": {
"anyOf": [
{
"enum": ["auto", "legacy_null_as_string", "legacy_null_as_null", "disabled"],
"type": "string"
},
{
"type": "null"
}
]
},
"materializedColumnsOptimizationMode": {
"anyOf": [
{
"enum": ["disabled", "optimized"],
"type": "string"
},
{
"type": "null"
}
]
},
"materializeRepeatedCTEs": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Reuse eligible bounded event aggregates within one query execution. When unset, the server may enable it via the cloud feature flag."
},
"mergeFederatedAggregateJoins": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Merge sibling aggregating LEFT JOINs over federated Postgres tables into one UNION ALL join, so their scans overlap"
},
"negatedPersonFiltersNotIn": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Replace negated person-property filters in the WHERE of an `events` query (such as `email not_icontains`) with `person_id NOT IN (SELECT id FROM persons WHERE <the filters fail>)`, so the query no longer joins every person. Applies only when every filtered person property has a materialized column, nothing else in the query reads that persons join, and the join would be a LEFT JOIN."
},
"optimizeJoinedFilters": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"optimizeProjections": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"parserMode": {
"anyOf": [
{
"enum": [
"cpp_only",
"cpp_with_rust_shadow",
"cpp_with_rust_py_shadow",
"rust_with_cpp_shadow",
"rust_only",
"rust_py_only",
"rust_py_with_cpp_shadow"
],
"type": "string"
},
{
"type": "null"
}
],
"description": "HogQL parser backend; absent → `rust_py_with_cpp_shadow` (rust-py is primary, cpp runs as a sampled shadow). `*_shadow` modes return the primary result and sample-compare against the other parser, reporting divergences without failing the request. The `rust_py_*` modes drive the same hand-rolled Rust parser as `rust_*` but build `posthog.hogql.ast` dataclass instances directly via PyO3, skipping the JSON round-trip."
},
"personIdPushdown": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Push an `id IN (SELECT person_id FROM <left table> WHERE …)` predicate into the joined persons subquery, so the latest-version lookup only reads persons that the outer query's left-table filters can reach. Applies only to a persons join from the query's own FROM table."
},
"personsArgMaxVersion": {
"anyOf": [
{
"enum": ["auto", "v1", "v2"],
"type": "string"
},
{
"type": "null"
}
]
},
"personsJoinMode": {
"anyOf": [
{
"enum": ["inner", "left"],
"type": "string"
},
{
"type": "null"
}
]
},
"personsOnEventsMode": {
"anyOf": [
{
"enum": [
"disabled",
"person_id_no_override_properties_on_events",
"person_id_override_properties_on_events",
"person_id_override_properties_joined"
],
"type": "string"
},
{
"type": "null"
}
]
},
"propertyGroupsMode": {
"anyOf": [
{
"enum": ["enabled", "disabled", "optimized"],
"type": "string"
},
{
"type": "null"
}
]
},
"pushDownPredicates": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"s3TableUseInvalidColumns": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"sessionIdPushdown": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Push a `session_id_v7 IN (SELECT … FROM events WHERE …)` predicate into the raw_sessions subquery to limit aggregation to sessions that participate in the outer events filter."
},
"sessionPropertyPreAggregation": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Pre-filter raw_sessions aggregation by `session_id_v7 IN (cheap pre-aggregation that only materializes the columns referenced by the outer-WHERE session predicate)`. Useful when the breakdown/SELECT pulls in many session columns (e.g. `$channel_type`) but the filter only references one (e.g. `$entry_current_url`)."
},
"sessionsV2JoinMode": {
"anyOf": [
{
"enum": ["string", "uuid"],
"type": "string"
},
{
"type": "null"
}
]
},
"sessionTableVersion": {
"anyOf": [
{
"enum": ["auto", "v1", "v2", "v3"],
"type": "string"
},
{
"type": "null"
}
]
},
"sessionTimestampBufferMinutes": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Padding, in minutes, on each side of the event time range when it filters the sessions table by session start. Defaults to 3 days. It can only narrow the range: values above the default are ignored. Lower it only for a query that keeps just the sessions that start inside its own time range."
},
"timings": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"typeAwareCastSimplification": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Remove provably redundant casts and nullability wrappers (e.g. `toString(String)`, `assumeNotNull(non_nullable)`, dead `ifNull` fallbacks) using inferred expression types"
},
"useMaterializedViews": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"useNewEventsSchema": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Read events from the native JSON events table (`true`) or the legacy events table (`false`). When unset, a staff person's `ph_new_events_schema` cookie applies, then the project's listing in the `CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA_TEAMS` instance setting, then the `CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA` instance setting. This is an internal rollout switch, and the project settings API ignores it."
},
"usePreaggregatedIntermediateResults": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"usePreaggregatedTableTransforms": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Try to automatically convert HogQL queries to use preaggregated tables at the AST level *"
},
"useWebAnalyticsPreAggregatedTables": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"webAnalyticsFirstPageviewFilters": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Serve filters on the stored session-entry attribution properties (`$channel_type`, `$entry_utm_*`, `$entry_referring_domain`) by recomputing the value from the session's first pageview. Resolved server-side; not intended to be set by clients."
}
},
"type": "object"
},
"hogql_query": {
"description": "HogQL SELECT query whose results are exported. This model is in closed beta and is enabled per team; when it is not enabled, the request fails with a permission error that names HogQL batch exports. Contact PostHog support to request access. The query may reference the {data_interval_start} and {data_interval_end} placeholders. Provide a value for each placeholder the query references; missing referenced bounds are rejected, not inferred. When both bounds are supplied, they must span at most seven days. Neither supplied bound may be in the future. Without placeholders, the query runs unchanged, even if bounds are supplied. Every column in the SELECT clause must be a field or have an alias. It is recommended to limit the query with a WHERE clause, for example bounding timestamp on the events table, both to avoid exporting more rows than expected and because user queries run under stricter resource limits than the other models.",
"type": "string"
},
"model": {
"enum": ["hogql"],
"type": "string"
}
},
"required": ["file", "model", "hogql_query"],
"type": "object"
}
]
}