Feature flags
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
POST | |
POST | |
GET | |
GET | |
GET | |
POST |
Create feature flags bulk delete
Bulk delete feature flags by filter criteria or explicit IDs.
Accepts either:
- {"filters": {...}} - Same filter params as list endpoint (search, active, type, etc.)
- {"ids": [...]} - Explicit list of flag IDs (no limit)
Returns same format as bulk_delete for UI compatibility.
Uses bulk operations for efficiency: database updates are batched and cache invalidation happens once at the end rather than per-flag.
Required API key scopes
feature_flag:writeRequest parameters
- filters
- idsarray
Response
Example request
POST /api /projects /:project_id /feature_flags /bulk_deleteExample response
Status 200
Status 400 Invalid input — e.g., both filters and ids supplied, neither supplied, or unknown filter keys.
Create feature flags bulk keys
Get feature flag keys by IDs. Accepts a list of feature flag IDs and returns a mapping of ID to key.
Required API key scopes
feature_flag:readRequest parameters
- idsarray
Response
Example request
POST /api /projects /:project_id /feature_flags /bulk_keysExample response
Status 200
Status 400 Invalid flag IDs provided.
Create feature flags bulk update tags
Bulk update tags on multiple objects.
PAT access: this action has no required_scopes= on the decorator —
inheriting viewsets must add "bulk_update_tags" to their
scope_object_write_actions list to accept personal API keys.
Without that opt-in, APIScopePermission rejects PAT requests with
"This action does not support personal API key access". Done per-viewset
so granting <scope>:write for one resource doesn't leak access to
sibling resources that share this mixin.
Accepts:
- {"ids": [...], "action": "add"|"remove"|"set", "tags": ["tag1", "tag2"]}
Actions:
- "add": Add tags to existing tags on each object
- "remove": Remove specific tags from each object
- "set": Replace all tags on each object with the provided list
Required API key scopes
feature_flag:writeRequest parameters
- idsarray
- action
- tagsarray
Response
Example request
POST /api /projects /:project_id /feature_flags /bulk_update_tagsExample response
Status 200
Retrieve feature flags evaluation reasons
Also available via the PostHog MCP server:
feature-flags-evaluation-reasons-retrieve— Get feature flag evaluation reasons
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.
Required API key scopes
feature_flag:readQuery parameters
- distinct_idstring
- flag_keysarray
- groupsstringDefault:
{}
Example request
GET /api /projects /:project_id /feature_flags /evaluation_reasonsExample response
Status 200 No response body
Status 502 Flag evaluation service error
Status 503 Flag evaluation service temporarily unavailable
Retrieve feature flags matching ids
Get IDs of all feature flags matching the current filters. Uses the same filtering logic as the list endpoint. Returns only IDs that the user has permission to edit.
Required API key scopes
feature_flag:readExample request
GET /api /projects /:project_id /feature_flags /matching_idsExample response
Status 200 No response body
Retrieve feature flags my flags
Also available via the PostHog MCP server:
feature-flags-my-flags-retrieve— Get my evaluated feature flags
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.
Required API key scopes
feature_flag:readQuery parameters
- flag_keysarray
- groupsstringDefault:
{}
Example request
GET /api /projects /:project_id /feature_flags /my_flagsExample response
Status 200
Create feature flags user blast radius
Also available via the PostHog MCP server:
feature-flags-user-blast-radius-create— Get user blast radius
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.
Required API key scopes
feature_flag:readRequest parameters
- conditionobject
- group_type_indexintegernull
Response
Example request
POST /api /projects /:project_id /feature_flags /user_blast_radius