Create, read, update and delete feature flags. See docs for more information on feature flags.
If you're looking to use feature flags on your application, you can either use our JavaScript Library or our dedicated endpoint to check if feature flags are enabled for a given user.
Request
- Base URL: https://us.posthog.com
- URL: https://us.posthog.com/api/projects/{project_id}/feature_flags/
- Auth: HTTP bearer
Path parameters
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
'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.
Filter by archived state. When omitted, archived flags are excluded.
Filter by the user(s) who created the feature flag. Accepts a single user ID, or a JSON-encoded / comma-separated list of user IDs to match any of them.
When 'true', only return flags that can back an experiment: multivariate with 2-20 variants. Any other value is ignored.
Filter feature flags by their evaluation runtime.
JSON-encoded list of feature flag keys to exclude from the results.
JSON-encoded list of tag names to exclude. Flags carrying any of these tags are filtered out.
Filter feature flags by presence of evaluation contexts. 'true' returns only flags with at least one evaluation context, 'false' returns only flags without.
Filter by exact feature flag key match. Case insensitive.
Number of results to return per page.
The initial index from which to return the results.
Search by feature flag key or name. Case insensitive. Spaces, underscores, and hyphens count as the same separator.
JSON-encoded list of tag names to filter feature flags by.
Response
Example response
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100"
}Changes
No recorded changes to this operation across all 1 revision of this API.