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.

4.2 KB
Raw Blame
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "filters": {
            "description": "Filter criteria — same shape as the list endpoint's query params. Mutually exclusive with `ids`. Use this to bulk-delete by search/active/tags/etc. instead of supplying explicit IDs.",
            "properties": {
                "active": {
                    "description": "'true' and 'false' filter on serving state, the flag's `active` column. 'STALE' returns enabled flags only, so a disabled flag is never STALE. An enabled flag matches when its last recorded `$feature_flag_called` event is more than 30 days old. With no recorded event, it matches when it is at least 30 days old and either stores `filters` as `{}` or serves one result to everyone through a release condition at 100% with no property filters. A flag with no recorded event and an empty `groups` list does not match, even when its `status` reads STALE. The reverse also happens: a multivariate flag matches when a variant is at 100% under a release condition at 100% with no property filters, or when that condition names a variant. Its `status` can still read ACTIVE, because an earlier variant in the list or an earlier targeted condition can serve a different result. In a flag of either type that mixes person and group aggregation, the filter also counts a group-aggregated condition at 100% with no property filters, which `status` does not. An SDK that sends no `$feature_flag_called` event leaves no record, so a STALE flag can still be in use.\n\n* `true` - true\n* `false` - false\n* `STALE` - STALE",
                    "enum": ["true", "false", "STALE"],
                    "type": "string"
                },
                "archived": {
                    "description": "Filter by archived state. When omitted, archived flags are excluded.",
                    "type": "boolean"
                },
                "created_by_id": {
                    "description": "Filter to flags created by a specific user ID.",
                    "type": "number"
                },
                "evaluation_runtime": {
                    "description": "Filter by evaluation runtime.\n\n* `server` - Server\n* `client` - Client\n* `all` - All",
                    "enum": ["server", "client", "all"],
                    "type": "string"
                },
                "excluded_properties": {
                    "description": "JSON-encoded property filter to exclude. Same shape as the list endpoint.",
                    "type": "string"
                },
                "excluded_tags": {
                    "description": "Tag names to exclude. Flags carrying any of these tags are filtered out.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "has_evaluation_contexts": {
                    "description": "When true, only matches flags with at least one evaluation context.",
                    "type": "boolean"
                },
                "search": {
                    "description": "Search by feature flag key or name (case-insensitive). Spaces, underscores, and hyphens count as the same separator.",
                    "type": "string"
                },
                "tags": {
                    "description": "Tag names to filter by. Flags carrying at least one of these tags match.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "type": {
                    "description": "Filter by flag type.\n\n* `boolean` - boolean\n* `multivariant` - multivariant\n* `experiment` - experiment\n* `remote_config` - remote_config",
                    "enum": ["boolean", "multivariant", "experiment", "remote_config"],
                    "type": "string"
                }
            },
            "type": "object"
        },
        "ids": {
            "description": "Explicit feature flag IDs to soft-delete. Mutually exclusive with `filters`.",
            "items": {
                "minimum": 1,
                "type": "number"
            },
            "type": "array"
        }
    },
    "type": "object"
}