: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": {
"active": {
"description": "Whether the feature flag is active.",
"type": "boolean"
},
"archived": {
"description": "Whether the flag is archived. Archived flags are hidden from the flag list by default and must be disabled (`active: false`).",
"type": "boolean"
},
"bucketing_identifier": {
"anyOf": [
{
"description": "* `distinct_id` - User ID (default)\n* `device_id` - Device ID",
"enum": ["distinct_id", "device_id"],
"type": "string"
},
{
"type": "null"
}
],
"description": "Identifier used to bucket users into rollout percentages and variants — `distinct_id` (user ID, the default) or `device_id`. Using `device_id` is incompatible with `ensure_experience_continuity=true`."
},
"ensure_experience_continuity": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Whether to persist the flag's value for a user across the anonymous-to-identified transition (the \"persist across authentication steps\" option in the UI). Keeps a user's evaluated value stable once they log in. Incompatible with `device_id` bucketing."
},
"evaluation_contexts": {
"description": "Evaluation contexts that control where this flag evaluates at runtime.",
"items": {
"type": "string"
},
"type": "array"
},
"evaluation_runtime": {
"anyOf": [
{
"description": "* `server` - Server\n* `client` - Client\n* `all` - All",
"enum": ["server", "client", "all"],
"type": "string"
},
{
"type": "null"
}
],
"description": "Where this flag is allowed to evaluate — `server` (server-side SDKs only), `client` (client-side SDKs only), or `all` (both). Defaults to `all`."
},
"filters": {
"description": "Full release-condition object. It replaces the stored filters, so read the flag first and send every condition you want to keep. The tool description covers condition_id and group targeting.",
"properties": {
"aggregation_group_type_index": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Group type index for group-based feature flags."
},
"early_exit": {
"default": false,
"description": "When true, condition evaluation stops at the first matching condition set rather than continuing to evaluate subsequent groups.",
"type": "boolean"
},
"feature_enrollment": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Whether this flag has early access feature enrollment enabled. When true, the flag is evaluated against the person property $feature_enrollment/{flag_key}."
},
"groups": {
"description": "Release condition groups for the feature flag.",
"items": {
"properties": {
"aggregation_group_type_index": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Group type index for this condition set. None means person-level aggregation."
},
"condition_id": {
"description": "The condition_id this condition had when you read the flag. Send it unchanged when you keep, edit, or move the condition. Leave it off a new condition or one copied from a different flag. The update is refused when no condition on the flag has this ID.",
"type": "string"
},
"properties": {
"description": "Property conditions for this release condition group.",
"items": {
"anyOf": [
{
"properties": {
"cohort_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Resolved cohort name for cohort-type filters."
},
"group_type_index": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Group type index a `group` filter reads properties from. Defaults to the condition set's `aggregation_group_type_index`."
},
"key": {
"description": "Property key used in this feature flag condition.",
"type": "string"
},
"operator": {
"description": "Operator used to compare the property value.\n\n* `exact` - exact\n* `is_not` - is_not\n* `icontains` - icontains\n* `not_icontains` - not_icontains\n* `starts_with` - starts_with\n* `not_starts_with` - not_starts_with\n* `ends_with` - ends_with\n* `not_ends_with` - not_ends_with\n* `regex` - regex\n* `not_regex` - not_regex\n* `gt` - gt\n* `gte` - gte\n* `lt` - lt\n* `lte` - lte",
"enum": [
"exact",
"is_not",
"icontains",
"not_icontains",
"starts_with",
"not_starts_with",
"ends_with",
"not_ends_with",
"regex",
"not_regex",
"gt",
"gte",
"lt",
"lte"
],
"type": "string"
},
"type": {
"description": "Property filter type. Set it on every property. Use `group` with `group_type_index` to filter on a group's properties.\n\n* `cohort` - cohort\n* `person` - person\n* `group` - group",
"enum": ["cohort", "person", "group"],
"type": "string"
},
"value": {
"description": "Comparison value for the property filter. Supports strings, numbers, booleans, and arrays."
}
},
"required": ["key", "value", "operator"],
"type": "object"
},
{
"properties": {
"cohort_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Resolved cohort name for cohort-type filters."
},
"group_type_index": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Group type index a `group` filter reads properties from. Defaults to the condition set's `aggregation_group_type_index`."
},
"key": {
"description": "Property key used in this feature flag condition.",
"type": "string"
},
"operator": {
"description": "Existence operator.\n\n* `is_set` - is_set\n* `is_not_set` - is_not_set",
"enum": ["is_set", "is_not_set"],
"type": "string"
},
"type": {
"description": "Property filter type. Set it on every property. Use `group` with `group_type_index` to filter on a group's properties.\n\n* `cohort` - cohort\n* `person` - person\n* `group` - group",
"enum": ["cohort", "person", "group"],
"type": "string"
},
"value": {
"description": "Optional value. Runtime behavior determines whether this is ignored."
}
},
"required": ["key", "operator"],
"type": "object"
},
{
"properties": {
"cohort_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Resolved cohort name for cohort-type filters."
},
"group_type_index": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Group type index a `group` filter reads properties from. Defaults to the condition set's `aggregation_group_type_index`."
},
"key": {
"description": "Property key used in this feature flag condition.",
"type": "string"
},
"operator": {
"description": "Date comparison operator.\n\n* `is_date_exact` - is_date_exact\n* `is_date_after` - is_date_after\n* `is_date_before` - is_date_before",
"enum": ["is_date_exact", "is_date_before", "is_date_after"],
"type": "string"
},
"type": {
"description": "Property filter type. Set it on every property. Use `group` with `group_type_index` to filter on a group's properties.\n\n* `cohort` - cohort\n* `person` - person\n* `group` - group",
"enum": ["cohort", "person", "group"],
"type": "string"
},
"value": {
"description": "Date value in ISO format or relative date expression.",
"type": "string"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"cohort_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Resolved cohort name for cohort-type filters."
},
"group_type_index": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Group type index a `group` filter reads properties from. Defaults to the condition set's `aggregation_group_type_index`."
},
"key": {
"description": "Property key used in this feature flag condition.",
"type": "string"
},
"operator": {
"description": "Semantic version comparison operator.\n\n* `semver_eq` - semver_eq\n* `semver_neq` - semver_neq\n* `semver_gt` - semver_gt\n* `semver_gte` - semver_gte\n* `semver_lt` - semver_lt\n* `semver_lte` - semver_lte\n* `semver_tilde` - semver_tilde\n* `semver_caret` - semver_caret\n* `semver_wildcard` - semver_wildcard",
"enum": [
"semver_eq",
"semver_neq",
"semver_gt",
"semver_gte",
"semver_lt",
"semver_lte",
"semver_tilde",
"semver_caret",
"semver_wildcard"
],
"type": "string"
},
"type": {
"description": "Property filter type. Set it on every property. Use `group` with `group_type_index` to filter on a group's properties.\n\n* `cohort` - cohort\n* `person` - person\n* `group` - group",
"enum": ["cohort", "person", "group"],
"type": "string"
},
"value": {
"description": "Semantic version string.",
"type": "string"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"cohort_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Resolved cohort name for cohort-type filters."
},
"group_type_index": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Group type index a `group` filter reads properties from. Defaults to the condition set's `aggregation_group_type_index`."
},
"key": {
"description": "Property key used in this feature flag condition.",
"type": "string"
},
"operator": {
"description": "Multi-contains operator.\n\n* `icontains_multi` - icontains_multi\n* `not_icontains_multi` - not_icontains_multi",
"enum": ["icontains_multi", "not_icontains_multi"],
"type": "string"
},
"type": {
"description": "Property filter type. Set it on every property. Use `group` with `group_type_index` to filter on a group's properties.\n\n* `cohort` - cohort\n* `person` - person\n* `group` - group",
"enum": ["cohort", "person", "group"],
"type": "string"
},
"value": {
"description": "List of strings to evaluate against.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": ["key", "operator", "value"],
"type": "object"
},
{
"properties": {
"cohort_deleted": {
"description": "Set to true in responses when the cohort is deleted or does not exist. The flag cannot evaluate this condition. Ignored on write.",
"type": "boolean"
},
"cohort_missing": {
"description": "Set to true in responses when no cohort with this id exists in the project, so it cannot be restored. `cohort_deleted` is also true. Absent for a soft-deleted cohort. Ignored on write.",
"type": "boolean"
},
"cohort_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Resolved cohort name for cohort-type filters."
},
"group_type_index": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Group type index a `group` filter reads properties from. Defaults to the condition set's `aggregation_group_type_index`."
},
"key": {
"description": "Property key used in this feature flag condition.",
"type": "string"
},
"operator": {
"description": "Membership operator for cohort properties.\n\n* `in` - in\n* `not_in` - not_in",
"enum": ["in", "not_in"],
"type": "string"
},
"type": {
"description": "Cohort property type required for in/not_in operators.\n\n* `cohort` - cohort",
"enum": ["cohort"],
"type": "string"
},
"value": {
"description": "Cohort comparison value (single or list, depending on usage)."
}
},
"required": ["key", "type", "operator", "value"],
"type": "object"
},
{
"properties": {
"cohort_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Resolved cohort name for cohort-type filters."
},
"group_type_index": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Group type index a `group` filter reads properties from. Defaults to the condition set's `aggregation_group_type_index`."
},
"key": {
"description": "Property key used in this feature flag condition.",
"type": "string"
},
"operator": {
"description": "Operator for feature flag dependency evaluation.\n\n* `flag_evaluates_to` - flag_evaluates_to",
"enum": ["flag_evaluates_to"],
"type": "string"
},
"type": {
"description": "Flag property type required for flag dependency checks.\n\n* `flag` - flag",
"enum": ["flag"],
"type": "string"
},
"value": {
"description": "Value to compare flag evaluation against."
}
},
"required": ["key", "type", "operator", "value"],
"type": "object"
}
]
},
"type": "array"
},
"rollout_percentage": {
"description": "Rollout percentage for this release condition group.",
"type": "number"
},
"variant": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Variant key override for multivariate flags."
}
},
"type": "object"
},
"type": "array"
},
"multivariate": {
"anyOf": [
{
"properties": {
"variants": {
"description": "Variant definitions for multivariate feature flags.",
"items": {
"properties": {
"key": {
"description": "Unique key for this variant.",
"type": "string"
},
"name": {
"description": "Human-readable name for this variant.",
"type": "string"
},
"rollout_percentage": {
"description": "Variant rollout percentage.",
"type": "number"
}
},
"required": ["key", "rollout_percentage"],
"type": "object"
},
"type": "array"
}
},
"required": ["variants"],
"type": "object"
},
{
"type": "null"
}
],
"description": "Multivariate configuration for variant-based rollouts."
},
"payloads": {
"additionalProperties": {
"type": "string"
},
"description": "Optional payload values keyed by variant key.",
"propertyNames": {
"type": "string"
},
"type": "object"
}
},
"type": "object"
},
"id": {
"description": "A unique integer value identifying this feature flag.",
"type": "number"
},
"is_remote_configuration": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Whether this flag delivers a payload instead of gating a feature (Remote Config mode). When true, set the delivered payload through the `filters` param under `filters.payloads.true` as a JSON-encoded string. There is no dedicated payload parameter."
},
"key": {
"description": "Feature flag key.",
"type": "string"
},
"name": {
"description": "Feature flag description (stored in the `name` field for backwards compatibility).",
"type": "string"
},
"tags": {
"description": "Organizational tags for this feature flag.",
"items": {
"type": "string"
},
"type": "array"
},
"version": {
"description": "The `version` from your most recent read of this flag. Required when the flag's `filters.version` is 2: the update is then refused with 409 if anyone else changed the flag after that version. Other flags do not check it.",
"minimum": 0,
"type": "number"
}
},
"required": ["id"],
"type": "object"
}