Skip to main content

GET /api/projects/:id/feature_flags

Returns a paginated list of all feature flags in a project. Supports filtering by various criteria including active status, creation, tags, and evaluation runtime.

Path Parameters

id
integer
required
Project ID

Query Parameters

active
string
Filter by active status: true, false, or STALE
created_by_id
string
Filter by user ID who created the flag
Search by feature flag key or name (case insensitive)
type
string
Filter by flag type: boolean, multivariant, or experiment
evaluation_runtime
string
Filter by evaluation runtime: server, client, or both
tags
string
JSON-encoded array of tag names to filter by
has_evaluation_tags
string
Filter by presence of evaluation context tags: true or false
excluded_properties
string
JSON-encoded array of flag keys to exclude from results
order
string
Field to order by (prefix with - for descending). Default: -created_at
limit
integer
default:"100"
Number of results per page
offset
integer
default:"0"
Pagination offset

Response

count
integer
Total number of feature flags matching the filters
next
string | null
URL for the next page of results
previous
string | null
URL for the previous page of results
results
array
Array of feature flag objects
id
integer
Feature flag ID
key
string
Unique flag identifier
name
string
Flag description
filters
object
Release conditions and configuration
active
boolean
Whether the flag is currently active
deleted
boolean
Whether the flag is soft-deleted
created_at
string
ISO 8601 timestamp
created_by
object
User who created the flag
tags
array
Associated tag names
evaluation_tags
array
Evaluation context tag names
version
integer
Version number for optimistic locking
can_edit
boolean
Whether the current user can edit this flag
experiment_set
array
Associated experiments
surveys
array
Associated surveys
features
array
Associated early access features

Examples

List All Flags

curl -X GET "https://app.posthog.com/api/projects/:project_id/feature_flags" \
  -H "Authorization: Bearer <ph_project_api_key>"

Filter Active Flags

curl -X GET "https://app.posthog.com/api/projects/:project_id/feature_flags?active=true" \
  -H "Authorization: Bearer <ph_project_api_key>"

Search by Key or Name

curl -X GET "https://app.posthog.com/api/projects/:project_id/feature_flags?search=dashboard" \
  -H "Authorization: Bearer <ph_project_api_key>"

Filter by Type and Tags

curl -X GET "https://app.posthog.com/api/projects/:project_id/feature_flags?type=multivariant&tags=%5B%22frontend%22%2C%22experiment%22%5D" \
  -H "Authorization: Bearer <ph_project_api_key>"

Filter by Evaluation Runtime

curl -X GET "https://app.posthog.com/api/projects/:project_id/feature_flags?evaluation_runtime=server" \
  -H "Authorization: Bearer <ph_project_api_key>"

Pagination

curl -X GET "https://app.posthog.com/api/projects/:project_id/feature_flags?limit=50&offset=100" \
  -H "Authorization: Bearer <ph_project_api_key>"

Response Example

{
  "count": 42,
  "next": "https://app.posthog.com/api/projects/123/feature_flags?limit=10&offset=10",
  "previous": null,
  "results": [
    {
      "id": 12345,
      "key": "new-dashboard",
      "name": "New Dashboard Design",
      "filters": {
        "groups": [
          {
            "rollout_percentage": 20,
            "properties": []
          }
        ]
      },
      "deleted": false,
      "active": true,
      "created_by": {
        "id": 1,
        "uuid": "01234567-89ab-cdef-0123-456789abcdef",
        "distinct_id": "[email protected]",
        "first_name": "Jane",
        "email": "[email protected]"
      },
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-20T14:22:00Z",
      "last_modified_by": {
        "id": 1,
        "uuid": "01234567-89ab-cdef-0123-456789abcdef",
        "distinct_id": "[email protected]",
        "first_name": "Jane",
        "email": "[email protected]"
      },
      "ensure_experience_continuity": false,
      "rollback_conditions": null,
      "performed_rollback": false,
      "tags": ["frontend", "dashboard"],
      "evaluation_tags": [],
      "version": 3,
      "can_edit": true,
      "usage_dashboard": 456,
      "analytics_dashboards": [789],
      "has_enriched_analytics": false,
      "experiment_set": [],
      "surveys": [],
      "features": [],
      "is_used_in_replay_settings": false
    },
    {
      "id": 12346,
      "key": "checkout-variant",
      "name": "Checkout Flow Experiment",
      "filters": {
        "groups": [
          {
            "rollout_percentage": 100,
            "properties": []
          }
        ],
        "multivariate": {
          "variants": [
            {
              "key": "control",
              "name": "Control",
              "rollout_percentage": 50
            },
            {
              "key": "test",
              "name": "Test",
              "rollout_percentage": 50
            }
          ]
        }
      },
      "active": true,
      "deleted": false,
      "created_at": "2024-01-10T09:00:00Z",
      "tags": ["experiment", "checkout"],
      "version": 1,
      "can_edit": true
    }
  ]
}
Notes:
  • Internal flags created by surveys and product tours are automatically excluded from results
  • Flags are ordered by creation date (newest first) by default
  • Use the order parameter to sort by other fields (e.g., order=key or order=-updated_at)
  • The STALE status filter returns flags that haven’t been evaluated recently
  • When filtering by tags, flags must have ALL specified tags (AND logic)
  • The has_evaluation_tags filter helps identify flags with runtime context requirements

Filter Combinations

You can combine multiple filters:
curl -X GET "https://app.posthog.com/api/projects/:project_id/feature_flags?active=true&type=multivariant&evaluation_runtime=server&search=checkout" \
  -H "Authorization: Bearer <ph_project_api_key>"

Build docs developers (and LLMs) love