/api/v1/org/flags and /api/v1/org/flag-environments are the management surface behind the dashboard and the grantiva CLI. The SDK-facing GET /api/v1/flags only reads resolved values; everything here writes configuration.
Authentication
Send an API key as
Authorization: Bearer gpat_…/aat_…, or use a dashboard session. Wire format is snake_case.
:flagRef accepts either the flag’s UUID or its flag_key.
The flag object
List flags
flag_key.
Create a flag
The flag row, its per-environment values, and this payload commit together — a rejected request leaves nothing behind.
Response — the created flag object.
Get a flag
Update a flag
flag_key and value_type are immutable.
is_active is applied first and propagates to every environment; the environment_values you name are then applied on top, so a per-environment is_active wins for exactly those environments.
Response — the updated flag object.
Toggle a flag
400 rather than being treated as a flip.
Delete a flag
Change history
change_type is the audit action — flag.created, flag.updated, flag.toggled, flag.deleted, flag.rule_created, flag.rule_updated, flag.rule_deleted, flag.override_created, or flag.override_deleted — and summary is its human-readable form.
Recent evaluations
device_key_id is null when the device sent no X-Device-ID.
Overrides
204 No Content.
Environments
{ "name": "QA", "slug": "qa", "color": "#22c55e" }. slug defaults to a slugified name; color defaults to #6b7280.
Update is partial and accepts name, color, sort_order, and reorder ("up" or "down" to move the environment in the list).
Delete returns { "deleted": true, "id": "…" } and refuses (403) on the default environment.
Errors
See also
- Get Flags — the SDK read path
- Flag Targeting Rules
- Test an Evaluation