: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": {
"experiment": {
"anyOf": [
{
"properties": {
"experiment_id": {
"description": "The experiment an experiment scanner watches.",
"minimum": 1,
"type": "number"
},
"variants": {
"anyOf": [
{
"items": {
"maxLength": 400,
"type": "string"
},
"minItems": 1,
"type": "array"
},
{
"type": "null"
}
],
"description": "The variant keys it watches. Null or omitted means every variant."
}
},
"required": ["experiment_id"],
"type": "object"
},
{
"type": "null"
}
],
"description": "For an experiment scanner: the `experiment_id` and `variants` it will keep in its config, merged into the query as its exposure filter so the estimate counts only exposed sessions. Not combined with `experiment_targeting`."
},
"experiment_targeting": {
"anyOf": [
{
"description": "The experiment a scanner watches. Scans derive their person-scoped exposure filter from\nthis blob at query time, so it is the only place an experiment can enter a scanner's\ntargeting — which is what lets the write-side access check and read-side redaction cover it.",
"properties": {
"experiment_id": {
"description": "The experiment the scanner watches.",
"minimum": 1,
"type": "number"
},
"variant": {
"anyOf": [
{
"maxLength": 400,
"type": "string"
},
{
"type": "null"
}
],
"description": "Narrow to sessions of people exposed to this variant. Null means every variant."
}
},
"required": ["experiment_id"],
"type": "object"
},
{
"type": "null"
},
{
"type": "null"
}
],
"description": "Proposed experiment targeting, merged into the query as its exposure filter the same way a saved scanner derives it. The estimate then runs as the requesting user."
},
"model": {
"default": "gemini-3-flash-preview",
"description": "Proposed model; determines `credits_per_observation` in the response.\n\n* `gemini-3.5-flash-lite` - Gemini 3.5 Flash Lite\n* `gemini-3-flash-preview` - Gemini 3 Flash\n* `gemini-3.8-flash` - Gemini 3.8 Flash",
"enum": ["gemini-3.5-flash-lite", "gemini-3-flash-preview", "gemini-3.8-flash"],
"type": "string"
},
"query": {
"additionalProperties": {},
"description": "Which recordings to count, as a `RecordingsQuery`. Omit every filter to count every recording. The date range is ignored, because the estimate counts a recent window (`window_days` in the response) and scales it to 30 days.",
"properties": {
"actions": {
"anyOf": [
{
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Saved actions a recording must contain, such as `{\"id\": 12, \"type\": \"actions\", \"order\": 0}`."
},
"console_log_filters": {
"anyOf": [
{
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Console log filters, such as `{\"type\": \"log_entry\", \"key\": \"level\", \"value\": [\"error\"], \"operator\": \"exact\"}`."
},
"events": {
"anyOf": [
{
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Events a recording must contain, such as `{\"id\": \"$pageview\", \"type\": \"events\", \"order\": 0}`. Each can carry `properties` that filter that event."
},
"filter_test_accounts": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Leave out recordings from internal and test accounts."
},
"having_predicates": {
"anyOf": [
{
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Duration filters, such as `{\"type\": \"recording\", \"key\": \"active_seconds\", \"value\": 60, \"operator\": \"gt\"}`. These always apply with AND, whatever `operand` says."
},
"kind": {
"const": "RecordingsQuery",
"default": "RecordingsQuery",
"type": "string"
},
"operand": {
"anyOf": [
{
"enum": ["AND", "OR"],
"type": "string"
},
{
"type": "null"
}
],
"description": "How `events`, `actions`, `properties` and `console_log_filters` combine. `AND`, the default when omitted, keeps recordings that match every condition. `OR` keeps recordings that match any one. An explicit `null` is read as `OR`. `having_predicates` and `filter_test_accounts` always apply with AND."
},
"properties": {
"anyOf": [
{
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Recording, session, person and cohort filters, such as `{\"type\": \"recording\", \"key\": \"visited_page\", \"value\": \"/checkout\", \"operator\": \"icontains\"}` or `{\"type\": \"cohort\", \"key\": \"id\", \"value\": 7, \"operator\": \"in\"}`."
}
},
"type": "object"
},
"sampling_mode": {
"default": "comprehensive",
"description": "Quality pre-filter applied to the matched-session count, mirroring the sweep's candidate query. Defaults to comprehensive (no filter).\n\n* `focused` - Focused\n* `balanced` - Balanced\n* `comprehensive` - Comprehensive",
"enum": ["focused", "balanced", "comprehensive"],
"type": "string"
},
"sampling_rate": {
"default": 1,
"description": "0..1 downsample applied to matched sessions. Defaults to 1.0 (no downsampling).",
"maximum": 1,
"minimum": 0,
"type": "number"
},
"scanner_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The scanner being edited, excluded from `other_enabled_scanners_monthly_credits` so its stored estimate isn't double-counted in the forecast. Omit (or null) when estimating a brand-new scanner."
}
},
"type": "object"
}