What is a flag?
A flag is a named boolean switch that lives within an environment. It has akey used to identify it at evaluation time, an enabled toggle that controls whether the flag is active, and a default_value that is returned when no targeting rule matches.
The key field
Thekey is a short, stable identifier you define when creating a flag — for example, new-dashboard or checkout-v2. You pass this value as flag_key in evaluation requests:
Enabled state
Theenabled field controls whether the flag participates in rule evaluation.
- When
enabledisfalse, the evaluation engine skips all rules and immediately returnsdefault_valuewith reason"disabled". - When
enabledistrue, rules are evaluated in priority order.
enabled a master switch — useful for disabling a flag entirely without deleting its rules.
Default value
Thedefault_value is returned in two situations:
- The flag is disabled (
enabled: false) — reason:"disabled" - The flag is enabled but no rule matches the evaluation context — reason:
"default"
default_value is a boolean and defaults to false when creating a new flag.
Salt
Thesalt field is an auto-generated string used as an input to the hashing function for percentage-based rules. It ensures that percentage rollouts for different flags produce independent, uncorrelated bucketing even when the same bucket_by field value (e.g., the same user_id) is used across flags.
You do not set the salt manually — it is generated by the API at flag creation time.
Evaluation order
WhenPOST /api/v1/evaluate is called, the engine follows this sequence:
- Disabled check — If
enabledisfalse, returndefault_valuewith reasondisabled. - Rule evaluation — Active rules are checked in ascending
priorityorder (lowest number first). The first matching rule determines the result with reasonrule_match. - Default fallback — If no rule matches, return
default_valuewith reasondefault.
Flag schema
| Field | Type | Description |
|---|---|---|
id | UUID | Unique flag identifier |
environment_id | UUID | The environment this flag belongs to |
key | string | Identifier used in evaluation requests |
name | string | Display name |
description | string | Optional description (nullable) |
enabled | boolean | Whether the flag participates in rule evaluation |
default_value | boolean | Value returned when no rule matches or flag is disabled |
salt | string | Auto-generated; used for deterministic percentage bucketing |
created_at | datetime | ISO 8601 creation timestamp |
updated_at | datetime | ISO 8601 last-updated timestamp |
Endpoints
| Method | Endpoint | Permission | Description |
|---|---|---|---|
GET | /api/v1/projects/{project_id}/flags | flags.read | List all flags in a project |
POST | /api/v1/projects/{project_id}/flags | flags.write | Create a new flag |
GET | /api/v1/projects/{project_id}/flags/{id} | flags.read | Get a flag and its rules |
PATCH | /api/v1/projects/{project_id}/flags/{id} | flags.write | Update flag name, description, enabled, or default_value |
DELETE | /api/v1/projects/{project_id}/flags/{id} | flags.delete | Delete a flag and its rules |
Required permissions
flags.read— Read flags and their rulesflags.write— Create and update flagsflags.delete— Delete flags (cascades to rules)