Feature

For instructions on how to authenticate to use this endpoint, see API overview.

Retrieves all feature flags for a given organization and key.

Endpoints

    GET/api/organizations/:parent_lookup_organization_id/feature_flags/:feature_flag_key/
    POST/api/organizations/:parent_lookup_organization_id/feature_flags/copy_flags/
    GET/api/projects/:project_id/feature_flags/
    POST/api/projects/:project_id/feature_flags/
    GET/api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/
    POST/api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/
    GET/api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/:id/
    DELETE/api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/:id/
    GET/api/projects/:project_id/feature_flags/:id/
    PATCH/api/projects/:project_id/feature_flags/:id/
    DELETE/api/projects/:project_id/feature_flags/:id/
    GET/api/projects/:project_id/feature_flags/:id/activity/
    POST/api/projects/:project_id/feature_flags/:id/create_static_cohort_for_flag/
    POST/api/projects/:project_id/feature_flags/:id/dashboard/
    POST/api/projects/:project_id/feature_flags/:id/enrich_usage_dashboard/
    GET/api/projects/:project_id/feature_flags/activity/
    GET/api/projects/:project_id/feature_flags/evaluation_reasons/
    GET/api/projects/:project_id/feature_flags/local_evaluation/
    GET/api/projects/:project_id/feature_flags/my_flags/
    POST/api/projects/:project_id/feature_flags/user_blast_radius/

    Retrieve feature flags

    Path Parameters

    • feature_flag_key
      string
    • parent_lookup_organization_id
      string

    Request

    GET /api/organizations/:parent_lookup_organization_id/feature_flags/:feature_flag_key
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:parent_lookup_organization_id/feature_flags/:feature_flag_key/

    Response

    Status 200 No response body

    Create feature flags copy flags

    Path Parameters

    • parent_lookup_organization_id
      string

    Request

    POST /api/organizations/:parent_lookup_organization_id/feature_flags/copy_flags
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:parent_lookup_organization_id/feature_flags/copy_flags/

    Response

    Status 200 No response body

    List all 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.

    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/.

    Query Parameters

    • limit
      integer

      Number of results to return per page.

    • offset
      integer

      The initial index from which to return the results.

    Response


    Request

    GET /api/projects/:project_id/feature_flags
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/

    Response

    Status 200
    RESPONSE
    {
    "count": 123,
    "next": "http://api.example.org/accounts/?offset=400&limit=100",
    "previous": "http://api.example.org/accounts/?offset=200&limit=100",
    "results": [
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }
    ]
    }

    Create 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.

    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
      object
    • performed_rollback
      boolean
    • tags
      array
    • analytics_dashboards
      array
    • has_enriched_analytics
      boolean

    Response


    Request

    POST /api/projects/:project_id/feature_flags
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/\
    -d key="string"

    Response

    Status 201
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    List all feature flags role access

    Path Parameters

    • parent_lookup_feature_flag_id
      string
    • 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/.

    Query Parameters

    • limit
      integer

      Number of results to return per page.

    • offset
      integer

      The initial index from which to return the results.

    Response


    Request

    GET /api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/

    Response

    Status 200
    RESPONSE
    {
    "count": 123,
    "next": "http://api.example.org/accounts/?offset=400&limit=100",
    "previous": "http://api.example.org/accounts/?offset=200&limit=100",
    "results": [
    {
    "id": 0,
    "feature_flag": {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    },
    "role": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "feature_flags_access_level": 21,
    "created_at": "2019-08-24T14:15:22Z",
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "members": "string",
    "associated_flags": "string"
    },
    "role_id": "ac4e70c8-d5be-48af-93eb-760f58fc91a9",
    "added_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
    }
    ]
    }

    Create feature flags role access

    Path Parameters

    • parent_lookup_feature_flag_id
      string
    • 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

    • role_id
      string

    Response


    Request

    POST /api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/\
    -d role_id="string"

    Response

    Status 201
    RESPONSE
    {
    "id": 0,
    "feature_flag": {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    },
    "role": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "feature_flags_access_level": 21,
    "created_at": "2019-08-24T14:15:22Z",
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "members": "string",
    "associated_flags": "string"
    },
    "role_id": "ac4e70c8-d5be-48af-93eb-760f58fc91a9",
    "added_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
    }

    Retrieve feature flags role access

    Path Parameters

    • id
      integer

      A unique integer value identifying this feature flag role access.

    • parent_lookup_feature_flag_id
      string
    • 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/.

    Response


    Request

    GET /api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/:id/

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "feature_flag": {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    },
    "role": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "feature_flags_access_level": 21,
    "created_at": "2019-08-24T14:15:22Z",
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "members": "string",
    "associated_flags": "string"
    },
    "role_id": "ac4e70c8-d5be-48af-93eb-760f58fc91a9",
    "added_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
    }

    Delete feature flags role access

    Path Parameters

    • id
      integer

      A unique integer value identifying this feature flag role access.

    • parent_lookup_feature_flag_id
      string
    • 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

    DELETE /api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X DELETE \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:parent_lookup_feature_flag_id/role_access/:id/

    Response

    Status 204 No response body

    Retrieve feature flags retrieve

    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.

    Path Parameters

    • id
      integer

      A unique integer value identifying this feature flag.

    • 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/.

    Response


    Request

    GET /api/projects/:project_id/feature_flags/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:id/

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Update 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.

    Path Parameters

    • id
      integer

      A unique integer value identifying this feature flag.

    • 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
      object
    • performed_rollback
      boolean
    • tags
      array
    • analytics_dashboards
      array
    • has_enriched_analytics
      boolean

    Response


    Request

    PATCH /api/projects/:project_id/feature_flags/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X PATCH \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:id/\
    -d name="string"

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Delete feature flags

    Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true

    Path Parameters

    • id
      integer

      A unique integer value identifying this feature flag.

    • 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

    DELETE /api/projects/:project_id/feature_flags/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X DELETE \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:id/

    Response

    Status 405 No response body

    Retrieve feature flags activity retrieve

    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.

    Path Parameters

    • id
      integer

      A unique integer value identifying this feature flag.

    • 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/.

    Response


    Request

    GET /api/projects/:project_id/feature_flags/:id/activity
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:id/activity/

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Create feature flags create static cohort for flag

    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.

    Path Parameters

    • id
      integer

      A unique integer value identifying this feature flag.

    • 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
      object
    • performed_rollback
      boolean
    • tags
      array
    • analytics_dashboards
      array
    • has_enriched_analytics
      boolean

    Response


    Request

    POST /api/projects/:project_id/feature_flags/:id/create_static_cohort_for_flag
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:id/create_static_cohort_for_flag/\
    -d key="string"

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Create feature flags dashboard

    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.

    Path Parameters

    • id
      integer

      A unique integer value identifying this feature flag.

    • 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
      object
    • performed_rollback
      boolean
    • tags
      array
    • analytics_dashboards
      array
    • has_enriched_analytics
      boolean

    Response


    Request

    POST /api/projects/:project_id/feature_flags/:id/dashboard
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:id/dashboard/\
    -d key="string"

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Create feature flags enrich usage dashboard

    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.

    Path Parameters

    • id
      integer

      A unique integer value identifying this feature flag.

    • 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
      object
    • performed_rollback
      boolean
    • tags
      array
    • analytics_dashboards
      array
    • has_enriched_analytics
      boolean

    Response


    Request

    POST /api/projects/:project_id/feature_flags/:id/enrich_usage_dashboard
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/:id/enrich_usage_dashboard/\
    -d key="string"

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Retrieve feature flags activity

    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.

    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/.

    Response


    Request

    GET /api/projects/:project_id/feature_flags/activity
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/activity/

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Retrieve feature flags 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.

    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/.

    Response


    Request

    GET /api/projects/:project_id/feature_flags/evaluation_reasons
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/evaluation_reasons/

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Retrieve feature flags local evaluation

    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.

    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/.

    Response


    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" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/local_evaluation/

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Retrieve feature flags my 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.

    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/.

    Response


    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" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/my_flags/

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Create feature flags 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.

    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
      object
    • performed_rollback
      boolean
    • tags
      array
    • analytics_dashboards
      array
    • has_enriched_analytics
      boolean

    Response


    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" \
    https://app.posthog.com/api/projects/:project_id/feature_flags/user_blast_radius/\
    -d key="string"

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "name": "string",
    "key": "string",
    "filters": {
    "property1": null,
    "property2": null
    },
    "deleted": true,
    "active": true,
    "created_by": {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "distinct_id": "string",
    "first_name": "string",
    "email": "user@example.com",
    "is_email_verified": true
    },
    "created_at": "2019-08-24T14:15:22Z",
    "is_simple_flag": true,
    "rollout_percentage": 0,
    "ensure_experience_continuity": true,
    "experiment_set": [
    0
    ],
    "surveys": {
    "property1": null,
    "property2": null
    },
    "features": {
    "property1": null,
    "property2": null
    },
    "rollback_conditions": {
    "property1": null,
    "property2": null
    },
    "performed_rollback": true,
    "can_edit": true,
    "tags": [
    null
    ],
    "usage_dashboard": 0,
    "analytics_dashboards": [
    0
    ],
    "has_enriched_analytics": true
    }

    Questions?

    Was this page useful?