Feature Flags API
All endpoints require Authorization: Bearer <token>.
Base path: /api/projects/{project_id}/environments/{env_id}/flags
Create a flag
POST /api/projects/{project_id}/environments/{env_id}/flags
Request
{
"name": "Dark Mode",
"key": "dark_mode",
"description": "Optional description",
"enabled": true,
"rollout_percentage": 0
}
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Human-readable label |
key | string | Yes | Lowercase identifier. a-z, 0-9, _, -. Must start with a letter. Unique per environment. |
description | string | No | Optional description |
enabled | bool | No | Defaults to false |
rollout_percentage | int | No | 0–100. Defaults to 0. |
When rollout_percentage is 0 and enabled is true, the rollout logic is skipped entirely and the flag evaluates to true for all users. To disable a flag for everyone, set enabled to false.
Response 201 Created
{
"id": "flag_uuid",
"project_id": "proj_uuid",
"environment_id": "env_uuid",
"name": "Dark Mode",
"key": "dark_mode",
"description": null,
"enabled": true,
"rollout_percentage": 0,
"created_at": "2026-05-22T10:00:00Z",
"updated_at": "2026-05-22T10:00:00Z"
}
List flags
GET /api/projects/{project_id}/environments/{env_id}/flags
Response 200 OK — array of flag objects.
Get a flag
GET /api/projects/{project_id}/environments/{env_id}/flags/{flag_id}
Response 200 OK — single flag object.
Update a flag
PUT /api/projects/{project_id}/environments/{env_id}/flags/{flag_id}
All fields optional. Only provided fields are updated.
Request
{
"rollout_percentage": 25
}
Response 200 OK — updated flag object.
Toggle a flag
POST /api/projects/{project_id}/environments/{env_id}/flags/{flag_id}/toggle
Flips enabled between true and false.
Response 200 OK — updated flag object.
Delete a flag
DELETE /api/projects/{project_id}/environments/{env_id}/flags/{flag_id}
Response 204 No Content
Deletes the flag and all its targeting rules. Evaluation history is retained.