Skip to content

: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.

30.1 KB
Raw Blame
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "cohort_type": {
            "anyOf": [
                {
                    "description": "* `static` - static\n* `person_property` - person_property\n* `behavioral` - behavioral\n* `realtime` - realtime\n* `analytical` - analytical",
                    "enum": ["static", "person_property", "behavioral", "realtime", "analytical"],
                    "type": "string"
                },
                {
                    "enum": [""],
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "description": "Type of cohort based on filter complexity\n\n* `static` - static\n* `person_property` - person_property\n* `behavioral` - behavioral\n* `realtime` - realtime\n* `analytical` - analytical"
        },
        "description": {
            "maxLength": 1000,
            "type": "string"
        },
        "filters": {
            "anyOf": [
                {
                    "properties": {
                        "filterTestAccounts": {
                            "anyOf": [
                                {
                                    "type": "boolean"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "properties": {
                            "description": "AND/OR group containing cohort filters. Named to avoid collision with analytics Group model.",
                            "properties": {
                                "type": {
                                    "enum": ["AND", "OR"],
                                    "type": "string"
                                },
                                "values": {
                                    "items": {
                                        "anyOf": [
                                            {
                                                "properties": {
                                                    "bytecode": {
                                                        "anyOf": [
                                                            {
                                                                "items": {},
                                                                "type": "array"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "bytecode_error": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "conditionHash": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "event_filters": {
                                                        "anyOf": [
                                                            {
                                                                "items": {
                                                                    "anyOf": [
                                                                        {
                                                                            "properties": {
                                                                                "key": {
                                                                                    "type": "string"
                                                                                },
                                                                                "operator": {
                                                                                    "anyOf": [
                                                                                        {
                                                                                            "type": "string"
                                                                                        },
                                                                                        {
                                                                                            "type": "null"
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                "type": {
                                                                                    "enum": ["event", "element"],
                                                                                    "type": "string"
                                                                                },
                                                                                "value": {}
                                                                            },
                                                                            "required": ["type", "key", "value"],
                                                                            "type": "object"
                                                                        },
                                                                        {
                                                                            "properties": {
                                                                                "key": {
                                                                                    "type": "string"
                                                                                },
                                                                                "type": {
                                                                                    "const": "hogql",
                                                                                    "type": "string"
                                                                                },
                                                                                "value": {}
                                                                            },
                                                                            "required": ["type", "key"],
                                                                            "type": "object"
                                                                        }
                                                                    ]
                                                                },
                                                                "type": "array"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "event_type": {
                                                        "type": "string"
                                                    },
                                                    "explicit_datetime": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "explicit_datetime_to": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "key": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "number"
                                                            }
                                                        ]
                                                    },
                                                    "min_periods": {
                                                        "anyOf": [
                                                            {
                                                                "type": "number"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "negation": {
                                                        "default": false,
                                                        "type": "boolean"
                                                    },
                                                    "operator": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "operator_value": {
                                                        "anyOf": [
                                                            {
                                                                "type": "number"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "seq_event": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "number"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "seq_event_type": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "seq_time_interval": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "seq_time_value": {
                                                        "anyOf": [
                                                            {
                                                                "type": "number"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "time_interval": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "time_value": {
                                                        "anyOf": [
                                                            {
                                                                "type": "number"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "total_periods": {
                                                        "anyOf": [
                                                            {
                                                                "type": "number"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "type": {
                                                        "const": "behavioral",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["type", "key", "value", "event_type"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "bytecode": {
                                                        "anyOf": [
                                                            {
                                                                "items": {},
                                                                "type": "array"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "bytecode_error": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "conditionHash": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "key": {
                                                        "const": "id",
                                                        "type": "string"
                                                    },
                                                    "negation": {
                                                        "default": false,
                                                        "type": "boolean"
                                                    },
                                                    "type": {
                                                        "const": "cohort",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "type": "number"
                                                    }
                                                },
                                                "required": ["type", "key", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "bytecode": {
                                                        "anyOf": [
                                                            {
                                                                "items": {},
                                                                "type": "array"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "bytecode_error": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "conditionHash": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "negation": {
                                                        "default": false,
                                                        "type": "boolean"
                                                    },
                                                    "operator": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "type": {
                                                        "const": "person",
                                                        "type": "string"
                                                    },
                                                    "value": {}
                                                },
                                                "required": ["type", "key"],
                                                "type": "object"
                                            },
                                            {
                                                "description": "Filter on a top-level persons-table column (e.g. created_at) rather than the\nproperties JSON. The matching key must be one of PERSON_METADATA_FIELDS.",
                                                "properties": {
                                                    "bytecode": {
                                                        "anyOf": [
                                                            {
                                                                "items": {},
                                                                "type": "array"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "bytecode_error": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "conditionHash": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "negation": {
                                                        "default": false,
                                                        "type": "boolean"
                                                    },
                                                    "operator": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "type": {
                                                        "const": "person_metadata",
                                                        "type": "string"
                                                    },
                                                    "value": {}
                                                },
                                                "required": ["type", "key"],
                                                "type": "object"
                                            },
                                            {}
                                        ]
                                    },
                                    "type": "array"
                                }
                            },
                            "required": ["type", "values"],
                            "type": "object"
                        }
                    },
                    "required": ["properties"],
                    "type": "object"
                },
                {
                    "type": "null"
                }
            ]
        },
        "is_static": {
            "type": "boolean"
        },
        "name": {
            "anyOf": [
                {
                    "maxLength": 400,
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ]
        },
        "query": {}
    },
    "type": "object"
}