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.

Retrieve feature flags local evaluation

Required API key scopes

feature_flag:read

Path parameters

  • project_id
    string

    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_evaluation
export 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_id
    string

    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_flags
export 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_id
    string

    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

  • name
    string

    contains the description for the flag (field name name is kept for backwards-compatibility)

  • key
    string
  • filters
    object
  • deleted
    boolean
  • active
    boolean
  • created_at
    string
  • ensure_experience_continuity
    boolean
  • rollback_conditions
  • performed_rollback
    boolean
  • tags
    array
  • analytics_dashboards
    array
  • has_enriched_analytics
    boolean
  • creation_context

    Indicates the origin product of the feature flag. Choices: 'feature_flags', 'experiments', 'surveys', 'early_access_features', 'web_experiments'.

    • feature_flags - feature_flags
    • experiments - experiments
    • surveys - surveys
    • early_access_features - early_access_features
    • web_experiments - web_experiments

Request

POST /api/projects/:project_id/feature_flags/user_blast_radius
export 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"

Response

Status 200 No response body

Questions?

Was this page useful?