Feature

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

Endpoints

POST
GET
GET
POST
GET
GET
POST
POST
POST
GET

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

Request parameters

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

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

Example response

Status 200 No response body

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

Request parameters

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

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

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

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

Response


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
RESPONSE
{
"status": "string",
"reason": "string"
}

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

Response


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
RESPONSE
{
"status": "string",
"reason": "string"
}

Create feature flags test evaluation

Test feature flag evaluation against a specific user at an optional point in time.

This endpoint allows testing how a feature flag would evaluate for a specific user, optionally at a historical timestamp. When a timestamp is provided, both the flag conditions and person properties are evaluated as they existed at that time.

Required API key scopes

feature_flag:read

Path parameters

  • id
    integer

Request parameters

  • distinct_id
    string
  • person_id
    string
  • timestamp
    stringnull
  • groups

Response


Example request

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

Example response

Status 200
RESPONSE
{
"flag_key": "string",
"result": null,
"reason": "string",
"condition_index": 0,
"payload": null,
"person_properties": {},
"evaluation_distinct_id": "string",
"conditions": [
{
"index": 0,
"matched": true,
"properties_matched": true,
"explanation": "string",
"rollout_percentage": 0.1,
"rollout_excluded": true,
"variant": "string",
"properties": [
{
"key": "string",
"operator": "string",
"value": null,
"type": "string",
"actual_value": null,
"matched": true,
"explanation": "string"
}
]
}
]
}
Status 400 Invalid parameters
RESPONSE
{
"error": "string"
}
Status 404 Person not found
RESPONSE
{
"error": "string"
}
Status 500 Server error
RESPONSE
{
"error": "string"
}
Status 502 Flag evaluation service error
RESPONSE
{
"error": "string"
}

Create feature flags test evaluation

Test feature flag evaluation against a specific user at an optional point in time.

This endpoint allows testing how a feature flag would evaluate for a specific user, optionally at a historical timestamp. When a timestamp is provided, both the flag conditions and person properties are evaluated as they existed at that time.

Required API key scopes

feature_flag:read

Path parameters

  • id
    integer

Request parameters

  • distinct_id
    string
  • person_id
    string
  • timestamp
    stringnull
  • groups

Response


Example request

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

Example response

Status 200
RESPONSE
{
"flag_key": "string",
"result": null,
"reason": "string",
"condition_index": 0,
"payload": null,
"person_properties": {},
"evaluation_distinct_id": "string",
"conditions": [
{
"index": 0,
"matched": true,
"properties_matched": true,
"explanation": "string",
"rollout_percentage": 0.1,
"rollout_excluded": true,
"variant": "string",
"properties": [
{
"key": "string",
"operator": "string",
"value": null,
"type": "string",
"actual_value": null,
"matched": true,
"explanation": "string"
}
]
}
]
}
Status 400 Invalid parameters
RESPONSE
{
"error": "string"
}
Status 404 Person not found
RESPONSE
{
"error": "string"
}
Status 500 Server error
RESPONSE
{
"error": "string"
}
Status 502 Flag evaluation service error
RESPONSE
{
"error": "string"
}

Retrieve feature flags versions

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
  • version_number
    integer

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"key": "string",
"name": "string",
"filters": {},
"active": true,
"deleted": true,
"version": -2147483648,
"rollback_conditions": null,
"performed_rollback": true,
"ensure_experience_continuity": true,
"has_enriched_analytics": true,
"is_remote_configuration": true,
"has_encrypted_payloads": true,
"evaluation_runtime": "server",
"bucketing_identifier": "distinct_id",
"last_called_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"is_historical": true,
"version_timestamp": "2019-08-24T14:15:22Z",
"modified_by": 0
}
Status 400 Version history is not available for remote configuration flags.
Status 404 Version not found.
Status 422 Activity log incomplete; cannot reconstruct this version.

Retrieve feature flags versions

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
  • version_number
    integer

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"key": "string",
"name": "string",
"filters": {},
"active": true,
"deleted": true,
"version": -2147483648,
"rollback_conditions": null,
"performed_rollback": true,
"ensure_experience_continuity": true,
"has_enriched_analytics": true,
"is_remote_configuration": true,
"has_encrypted_payloads": true,
"evaluation_runtime": "server",
"bucketing_identifier": "distinct_id",
"last_called_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"is_historical": true,
"version_timestamp": "2019-08-24T14:15:22Z",
"modified_by": 0
}
Status 400 Version history is not available for remote configuration flags.
Status 404 Version not found.
Status 422 Activity log incomplete; cannot reconstruct this version.

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

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": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"user": {},
"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 all 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

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": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"user": {},
"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 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:write

Request parameters

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

Example request

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

Example response

Status 200 No response body

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

Request parameters

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

Example request

POST /api/projects/:project_id/feature_flags/bulk_delete
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_delete/\
-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.

Request parameters

  • name
    string
  • key
    string
  • filters
    object
  • deleted
    boolean
  • active
    boolean
  • created_at
    string
  • version
    integer
    Default: 0
  • ensure_experience_continuity
    booleannull
  • rollback_conditions
  • performed_rollback
    booleannull
  • tags
    array
  • evaluation_contexts
    array
  • analytics_dashboards
    array
  • has_enriched_analytics
    booleannull
  • creation_context
  • is_remote_configuration
    booleannull
  • has_encrypted_payloads
    booleannull
  • evaluation_runtime
  • bucketing_identifier
  • last_called_at
    stringnull
  • _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.

Request parameters

  • name
    string
  • key
    string
  • filters
    object
  • deleted
    boolean
  • active
    boolean
  • created_at
    string
  • version
    integer
    Default: 0
  • ensure_experience_continuity
    booleannull
  • rollback_conditions
  • performed_rollback
    booleannull
  • tags
    array
  • evaluation_contexts
    array
  • analytics_dashboards
    array
  • has_enriched_analytics
    booleannull
  • creation_context
  • is_remote_configuration
    booleannull
  • has_encrypted_payloads
    booleannull
  • evaluation_runtime
  • bucketing_identifier
  • last_called_at
    stringnull
  • _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 update tags

Bulk update tags on multiple objects.

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

Request parameters

  • ids
    array
  • action
  • tags
    array

Response


Example request

POST /api/projects/:project_id/feature_flags/bulk_update_tags
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_update_tags/\
-d ids="array",\
-d action=undefined,\
-d tags="array"

Example response

Status 200
RESPONSE
{
"updated": [
{
"id": 0,
"tags": [
"string"
]
}
],
"skipped": [
{
"id": 0,
"reason": "string"
}
]
}

Create feature flags bulk update tags

Bulk update tags on multiple objects.

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

Request parameters

  • ids
    array
  • action
  • tags
    array

Response


Example request

POST /api/projects/:project_id/feature_flags/bulk_update_tags
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_update_tags/\
-d ids="array",\
-d action=undefined,\
-d tags="array"

Example response

Status 200
RESPONSE
{
"updated": [
{
"id": 0,
"tags": [
"string"
]
}
],
"skipped": [
{
"id": 0,
"reason": "string"
}
]
}

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.

Required API key scopes

feature_flag:read

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.

Required API key scopes

feature_flag:read

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

Community questions

Questions about this page? or post a community question.