Skip to main content
/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

Returns an array of flag objects sorted by 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

Returns the flag with its rules and overrides inlined:
Rules are sorted by priority; overrides newest first.

Update a flag

Partial update — only the fields you send change. 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

A body that is present but doesn’t decode returns 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

Newest first. device_key_id is null when the device sent no X-Device-ID.

Overrides

Same rules as the dashboard surface — see Flag Overrides for semantics and validation. Delete returns 204 No Content.

Environments

Create takes { "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