Feature
For instructions on how to authenticate to use this endpoint, see API overview.
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.
Endpoints
Retrieve feature flags evaluation reasons
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request
GET /api /projects /:project_id /feature_flags /evaluation_reasonsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/feature_flags/evaluation_reasons/
Response
Status 200 No response body
Retrieve feature flags local evaluation
Required API key scopes
feature_flag:readPath parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request
GET /api /projects /:project_id /feature_flags /local_evaluationexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/feature_flags/local_evaluation/
Response
Status 200 No response body
Retrieve feature flags my flags
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request
GET /api /projects /:project_id /feature_flags /my_flagsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/feature_flags/my_flags/
Response
Status 200 No response body
Create feature flags user blast radius
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request parameters
- namestring
contains the description for the flag (field name
nameis kept for backwards-compatibility) - keystring
- filtersobject
- deletedboolean
- activeboolean
- created_atstring
- ensure_experience_continuityboolean
- rollback_conditions
- performed_rollbackboolean
- tagsarray
- analytics_dashboardsarray
- has_enriched_analyticsboolean
- creation_context
Indicates the origin product of the feature flag. Choices: 'feature_flags', 'experiments', 'surveys', 'early_access_features', 'web_experiments'.
feature_flags- feature_flagsexperiments- experimentssurveys- surveysearly_access_features- early_access_featuresweb_experiments- web_experiments
Request
POST /api /projects /:project_id /feature_flags /user_blast_radiusexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl-H 'Content-Type: application/json'\-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/feature_flags/user_blast_radius/\-d key="string"