Flags
Flag management endpoints for creating, reading, updating, and deleting feature flags within a project.
Auth: Admin key required for all flag management endpoints.
Flag object
json
{
"id": "flag_abc123",
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"description": "Enables the redesigned checkout experience",
"enabled": false,
"variants": [],
"rules": [],
"rolloutPercentage": null,
"createdAt": "2026-03-01T00:00:00.000Z",
"updatedAt": "2026-03-31T20:00:00.000Z"
}GET /v1/projects/:projectSlug/flags
List all flags in a project (for the current environment).
bash
curl https://api.flagbridge.io/v1/projects/my-app/flags \
-H "Authorization: Bearer fb_admin_YOUR_KEY"Query parameters
| Parameter | Type | Description |
|---|---|---|
environment | string | Filter by environment (default: key's environment) |
enabled | boolean | Filter by enabled state |
q | string | Search by key or name |
page | number | Page number (default: 1) |
perPage | number | Results per page (default: 20, max: 100) |
Response
json
{
"flags": [...],
"total": 42,
"page": 1,
"perPage": 20
}GET /v1/projects/:projectSlug/flags/:flagKey
Get a single flag by key.
bash
curl https://api.flagbridge.io/v1/projects/my-app/flags/new-checkout-flow \
-H "Authorization: Bearer fb_admin_YOUR_KEY"POST /v1/projects/:projectSlug/flags
Create a new flag.
bash
curl -X POST https://api.flagbridge.io/v1/projects/my-app/flags \
-H "Authorization: Bearer fb_admin_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"description": "Enables the redesigned checkout experience",
"enabled": false
}'Request body
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Unique flag key (kebab-case, immutable) |
name | string | Yes | Human-readable name |
description | string | No | Optional description |
enabled | boolean | No | Initial state (default: false) |
variants | array | No | Variant definitions for multi-variant flags |
PATCH /v1/projects/:projectSlug/flags/:flagKey
Update a flag's settings.
bash
curl -X PATCH https://api.flagbridge.io/v1/projects/my-app/flags/new-checkout-flow \
-H "Authorization: Bearer fb_admin_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"rolloutPercentage": 25
}'Updatable fields
| Field | Type | Description |
|---|---|---|
name | string | Display name |
description | string | Description |
enabled | boolean | Enable or disable globally |
rolloutPercentage | number | null | Percentage rollout (0–100) |
rules | array | Targeting rules (replaces existing rules) |
WARNING
Sending rules replaces all existing targeting rules. To append a single rule, first GET the current rules, add your new rule, then PATCH the full array.
DELETE /v1/projects/:projectSlug/flags/:flagKey
Delete a flag permanently.
bash
curl -X DELETE https://api.flagbridge.io/v1/projects/my-app/flags/new-checkout-flow \
-H "Authorization: Bearer fb_admin_YOUR_KEY"Returns 204 No Content. This action is irreversible.
Targeting rules schema
json
{
"rules": [
{
"id": "rule_abc123",
"name": "Beta users",
"conditions": [
{
"attribute": "plan",
"operator": "equals",
"value": "pro"
}
],
"enabled": true,
"variant": null
}
]
}Operators
| Operator | Type | Example |
|---|---|---|
equals | string, number, boolean | "plan" equals "pro" |
not_equals | string, number | "country" not_equals "US" |
in | array | "userId" in ["alice", "bob"] |
not_in | array | "plan" not_in ["free"] |
contains | string | "email" contains "@company.com" |
starts_with | string | "email" starts_with "admin" |
greater_than | number | "age" greater_than 18 |
less_than | number | "score" less_than 50 |
is_true | boolean | "beta" is_true |
is_false | boolean | "verified" is_false |
