Feature

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

Endpoints

POST
GET
GET
GET
POST
GET
GET
GET
POST

Create feature flags has active dependents

Path parameters

  • id
    integer
  • project_id
    string

Request parameters

  • name
    string
  • key
    string
  • filters
    object
  • deleted
    boolean
  • active
    boolean
  • created_at
    string
  • version
    integer
    Default: 0
  • ensure_experience_continuity
    boolean
  • rollback_conditions
  • performed_rollback
    boolean
  • tags
    array
  • evaluation_tags
    array
  • analytics_dashboards
    array
  • has_enriched_analytics
    boolean
  • creation_context
  • is_remote_configuration
    boolean
  • has_encrypted_payloads
    boolean
  • evaluation_runtime
  • bucketing_identifier
  • last_called_at
    string
  • _create_in_folder
    string
  • _should_create_usage_dashboard
    boolean
    Default: true

Example request

POST /api/projects/:project_id/feature_flags/:id/has_active_dependents
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/:id/has_active_dependents/\
-d key="string"

Example response

Status 200 No response body

Create feature flags has active dependents

Path parameters

  • id
    integer
  • project_id
    string

Request parameters

  • name
    string
  • key
    string
  • filters
    object
  • deleted
    boolean
  • active
    boolean
  • created_at
    string
  • version
    integer
    Default: 0
  • ensure_experience_continuity
    boolean
  • rollback_conditions
  • performed_rollback
    boolean
  • tags
    array
  • evaluation_tags
    array
  • analytics_dashboards
    array
  • has_enriched_analytics
    boolean
  • creation_context
  • is_remote_configuration
    boolean
  • has_encrypted_payloads
    boolean
  • evaluation_runtime
  • bucketing_identifier
  • last_called_at
    string
  • _create_in_folder
    string
  • _should_create_usage_dashboard
    boolean
    Default: true

Example request

POST /api/projects/:project_id/feature_flags/:id/has_active_dependents
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/:id/has_active_dependents/\
-d key="string"

Example response

Status 200 No response body

Retrieve feature flags remote config

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:read

Path parameters

  • id
    integer
  • project_id
    string

Example request

GET /api/projects/:project_id/feature_flags/:id/remote_config
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/:id/remote_config/

Example response

Status 200 No response body

Retrieve feature flags remote config

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:read

Path parameters

  • id
    integer
  • project_id
    string

Example request

GET /api/projects/:project_id/feature_flags/:id/remote_config
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/:id/remote_config/

Example response

Status 200 No response body

Retrieve feature flags status

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:read

Path parameters

  • id
    integer
  • project_id
    string

Example request

GET /api/projects/:project_id/feature_flags/:id/status
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/:id/status/

Example response

Status 200 No response body

Retrieve feature flags status

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:read

Path parameters

  • id
    integer
  • project_id
    string

Example request

GET /api/projects/:project_id/feature_flags/:id/status
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/:id/status/

Example response

Status 200 No response body

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.

Required API key scopes

activity_log:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
    Default: 10
  • page
    integer
    Default: 1

Response


Example 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" \
<ph_app_host>/api/projects/:project_id/feature_flags/activity/

Example response

Status 200
RESPONSE
{
"results": [
{
"user": "string",
"activity": "string",
"scope": "string",
"item_id": "string",
"detail": {
"id": "string",
"changes": [
{
"type": "string",
"action": "string",
"field": "string",
"before": null,
"after": null
}
],
"merge": {
"type": "string",
"source": null,
"target": null
},
"trigger": {
"job_type": "string",
"job_id": "string",
"payload": null
},
"name": "string",
"short_id": "string",
"type": "string"
},
"created_at": "2019-08-24T14:15:22Z"
}
],
"next": "http://example.com",
"previous": "http://example.com",
"total_count": 0
}

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.

Required API key scopes

activity_log:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
    Default: 10
  • page
    integer
    Default: 1

Response


Example 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" \
<ph_app_host>/api/projects/:project_id/feature_flags/activity/

Example response

Status 200
RESPONSE
{
"results": [
{
"user": "string",
"activity": "string",
"scope": "string",
"item_id": "string",
"detail": {
"id": "string",
"changes": [
{
"type": "string",
"action": "string",
"field": "string",
"before": null,
"after": null
}
],
"merge": {
"type": "string",
"source": null,
"target": null
},
"trigger": {
"job_type": "string",
"job_id": "string",
"payload": null
},
"name": "string",
"short_id": "string",
"type": "string"
},
"created_at": "2019-08-24T14:15:22Z"
}
],
"next": "http://example.com",
"previous": "http://example.com",
"total_count": 0
}

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.

Path parameters

  • project_id
    string

Request parameters

  • name
    string
  • key
    string
  • filters
    object
  • deleted
    boolean
  • active
    boolean
  • created_at
    string
  • version
    integer
    Default: 0
  • ensure_experience_continuity
    boolean
  • rollback_conditions
  • performed_rollback
    boolean
  • tags
    array
  • evaluation_tags
    array
  • analytics_dashboards
    array
  • has_enriched_analytics
    boolean
  • creation_context
  • is_remote_configuration
    boolean
  • has_encrypted_payloads
    boolean
  • evaluation_runtime
  • bucketing_identifier
  • last_called_at
    string
  • _create_in_folder
    string
  • _should_create_usage_dashboard
    boolean
    Default: true

Example request

POST /api/projects/:project_id/feature_flags/bulk_keys
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/bulk_keys/\
-d key="string"

Example response

Status 200 No response body

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.

Path parameters

  • project_id
    string

Request parameters

  • name
    string
  • key
    string
  • filters
    object
  • deleted
    boolean
  • active
    boolean
  • created_at
    string
  • version
    integer
    Default: 0
  • ensure_experience_continuity
    boolean
  • rollback_conditions
  • performed_rollback
    boolean
  • tags
    array
  • evaluation_tags
    array
  • analytics_dashboards
    array
  • has_enriched_analytics
    boolean
  • creation_context
  • is_remote_configuration
    boolean
  • has_encrypted_payloads
    boolean
  • evaluation_runtime
  • bucketing_identifier
  • last_called_at
    string
  • _create_in_folder
    string
  • _should_create_usage_dashboard
    boolean
    Default: true

Example request

POST /api/projects/:project_id/feature_flags/bulk_keys
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/bulk_keys/\
-d key="string"

Example response

Status 200 No response body

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

Query parameters

  • distinct_id
    string
  • groups
    string
    Default: {}

Example 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" \
<ph_app_host>/api/projects/:project_id/feature_flags/evaluation_reasons/

Example response

Status 200 No response body

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

Query parameters

  • distinct_id
    string
  • groups
    string
    Default: {}

Example 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" \
<ph_app_host>/api/projects/:project_id/feature_flags/evaluation_reasons/

Example response

Status 200 No response body

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.

Required API key scopes

feature_flag:read

Path parameters

  • project_id
    string

Query parameters

  • send_cohorts
    boolean
    Default: false

Response


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

Example response

Status 200
RESPONSE
{
"flags": [
{
"id": 0,
"team_id": 0,
"name": "string",
"key": "string",
"filters": {
"property1": null,
"property2": null
},
"deleted": true,
"active": true,
"ensure_experience_continuity": true,
"has_encrypted_payloads": true,
"version": -2147483648,
"evaluation_runtime": "server",
"bucketing_identifier": "distinct_id",
"evaluation_tags": [
"string"
]
}
],
"group_type_mapping": {
"property1": "string",
"property2": "string"
},
"cohorts": {
"property1": null,
"property2": null
}
}
Status 402
Status 500

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.

Required API key scopes

feature_flag:read

Path parameters

  • project_id
    string

Query parameters

  • send_cohorts
    boolean
    Default: false

Response


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

Example response

Status 200
RESPONSE
{
"flags": [
{
"id": 0,
"team_id": 0,
"name": "string",
"key": "string",
"filters": {
"property1": null,
"property2": null
},
"deleted": true,
"active": true,
"ensure_experience_continuity": true,
"has_encrypted_payloads": true,
"version": -2147483648,
"evaluation_runtime": "server",
"bucketing_identifier": "distinct_id",
"evaluation_tags": [
"string"
]
}
],
"group_type_mapping": {
"property1": "string",
"property2": "string"
},
"cohorts": {
"property1": null,
"property2": null
}
}
Status 402
Status 500

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

Query parameters

  • groups
    string
    Default: {}

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

Example response

Status 200
RESPONSE
{
"feature_flag": {
"id": 0,
"team_id": 0,
"name": "string",
"key": "string",
"filters": {
"property1": null,
"property2": null
},
"deleted": true,
"active": true,
"ensure_experience_continuity": true,
"has_encrypted_payloads": true,
"version": -2147483648,
"evaluation_runtime": "server",
"bucketing_identifier": "distinct_id",
"evaluation_tags": [
"string"
]
},
"value": null
}

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

Query parameters

  • groups
    string
    Default: {}

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

Example response

Status 200
RESPONSE
{
"feature_flag": {
"id": 0,
"team_id": 0,
"name": "string",
"key": "string",
"filters": {
"property1": null,
"property2": null
},
"deleted": true,
"active": true,
"ensure_experience_continuity": true,
"has_encrypted_payloads": true,
"version": -2147483648,
"evaluation_runtime": "server",
"bucketing_identifier": "distinct_id",
"evaluation_tags": [
"string"
]
},
"value": null
}

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

Request parameters

  • name
    string
  • key
    string
  • filters
    object
  • deleted
    boolean
  • active
    boolean
  • created_at
    string
  • version
    integer
    Default: 0
  • ensure_experience_continuity
    boolean
  • rollback_conditions
  • performed_rollback
    boolean
  • tags
    array
  • evaluation_tags
    array
  • analytics_dashboards
    array
  • has_enriched_analytics
    boolean
  • creation_context
  • is_remote_configuration
    boolean
  • has_encrypted_payloads
    boolean
  • evaluation_runtime
  • bucketing_identifier
  • last_called_at
    string
  • _create_in_folder
    string
  • _should_create_usage_dashboard
    boolean
    Default: true

Example 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"

Example response

Status 200 No response body

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

Request parameters

  • name
    string
  • key
    string
  • filters
    object
  • deleted
    boolean
  • active
    boolean
  • created_at
    string
  • version
    integer
    Default: 0
  • ensure_experience_continuity
    boolean
  • rollback_conditions
  • performed_rollback
    boolean
  • tags
    array
  • evaluation_tags
    array
  • analytics_dashboards
    array
  • has_enriched_analytics
    boolean
  • creation_context
  • is_remote_configuration
    boolean
  • has_encrypted_payloads
    boolean
  • evaluation_runtime
  • bucketing_identifier
  • last_called_at
    string
  • _create_in_folder
    string
  • _should_create_usage_dashboard
    boolean
    Default: true

Example 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"

Example response

Status 200 No response body

Community questions

Questions about this page? or post a community question.