Skip to content

The project's flags

GET
/projects/{project}/flags
curl --request GET \
--url 'https://example.com/api/v1/projects/example/flags?type=boolean&archived=false&state=on&sort=key&limit=50' \
--header 'Authorization: Bearer <token>'

The project’s flags, each with its flag state in every environment, in the order sort names. Every filter given applies. Page with cursor set to the next_cursor of the previous page, under the same sort; a cursor of another sort, state without environment, or differs_between naming other than two different environments is invalid_request, and an environment the project does not have is not_found.

project
required
string

The project’s key.

q
string

Text the flag’s key or name contains, ignoring case; %, _ and \ stand for themselves.

type
string
Allowed values: boolean string number json
tag
string

A tag the flag carries, matched exactly.

owner
string format: uuid

The member owning the flag.

archived
boolean

Lists the archived flags instead of the others.

environment

Names the entity in URLs, SDK calls and rules, and never changes.

string
/^[a-z][a-z0-9_-]{0,63}$/

The environment state is judged in; alone, it filters nothing.

state
string
Allowed values: on off rules rollout experiment

Lists the flags whose configuration in environment is on, is off, has rules, has a rule serving a rollout, or has a rule serving an experiment; rules count whether the flag is on or off.

differs_between
Array<string>
>= 2 items <= 2 items

Two environment keys, comma separated: lists the flags whose configurations differ between them in what their rulesets carry (on or off, the off and fallthrough variations, prerequisites, overrides by unit type, ID and variation, and rules with their identifiers, conditions and serves, salts included, in order), never in rule descriptions, override notes or authors, or versions.

sort
string
default: key
Allowed values: key name updated

key and name in byte order (capitals before lower case), updated by the last change to the flag’s definition, the most recent first; ties by key.

cursor
string

The next_cursor of the previous page.

limit
integer
default: 50 >= 1 <= 200

How many entries a page holds at most.

One page of flags.

Media typeapplication/json
object
items
required
Array

A flag’s definition with its flag state in every environment, by the environments’ order.

object
id
required
string format: uuid
key
required

Names the flag in code, such as checkout.newFlow; unique, case sensitively, in the project, and never changes.

string
/^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$/
type
required
string
Allowed values: boolean string number json
name
required
string
>= 1 characters <= 200 characters
description
required
string
<= 2000 characters
owner
required

The member accountable for the flag.

string format: uuid
tags
required
Array<string>
lifetime
required

A temporary flag is meant to be removed by its expected removal date; a permanent one stays.

string
Allowed values: permanent temporary
expected_removal_at
required

When a temporary flag is expected to be removed; null for a permanent one.

string format: date-time
nullable
automatic_exposure
required

SDKs record an exposure after every evaluation whose result carries an experiment.

boolean
variations
required
Array<object>
object
key
required
string
/^[a-zA-Z0-9_.-]{1,64}$/
value
required

A JSON value of the flag’s type, never null, of at most 64 KiB once compact (too_long), nesting arrays and objects at most 32 deep (too_deep).

name
required
string
description
required
string
archived_at
required

When the flag was archived, hidden from SDKs; null while it is not.

string format: date-time
nullable
created_by
required

The member who created the flag; null when a project token did.

string format: uuid
nullable
created_at
required
string format: date-time
updated_at
required
string format: date-time
version
required

Counts the entity’s accepted changes, from 1; send it back in If-Match to change the entity.

integer format: int64
>= 1
states
required
Array<object>

What a flag’s configuration in one environment serves at a glance.

object
environment
required

Names the entity in URLs, SDK calls and rules, and never changes.

string
/^[a-z][a-z0-9_-]{0,63}$/
last_evaluated_at
required

When an SDK last evaluated the flag in the environment, by the end of the interval its evaluation summary covers or the time of an exposure it recorded, never later than the server received them; null when none ever did. Remote evaluations the server answered never move it.

string format: date-time
nullable
on
required
boolean
has_rules
required

The configuration has at least one rule, whether the flag is on or off.

boolean
has_rollout
required

A rule of the configuration serves a rollout.

boolean
has_experiment
required

A rule of the configuration serves an experiment.

boolean
next_cursor
required

Pass as cursor for the next page; null on the last.

string
nullable

Example

{
"items": [
{
"type": "boolean",
"lifetime": "permanent"
}
]
}

invalid_request: a parameter that is malformed or out of its range, such as a cursor this API did not return.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}

No credential, or one that is not accepted: unauthenticated without a credential (a session cookie the server did not issue counts as none); invalid_token, token_revoked or token_expired for an API token, with a WWW-Authenticate header naming the code; session_expired for a session that has ended, whose cookie is cleared; invalid_credentials for a sign-in.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}
WWW-Authenticate
string

The caller may not perform the operation: forbidden (with the missing permission), session_required, insufficient_scope, cross_origin for a request signed in by the session cookie, a read included, that the browser says comes from another origin, or, for a write, change_request_required when it would change what a protected environment’s SDKs receive; detail names those environments.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}

not_found: no such project, or nothing under that identifier in it. An unknown project is answered before any permission is judged.

Media typeapplication/problem+json

A problem document (RFC 9457). Code-specific values are further members.

object
type
required
string
title
required
string
status
required
integer
code
required

Stable snake_case name of the problem, which clients branch on.

string
detail

An English explanation for humans; never what a client branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for a rate limit.

integer
permission

The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.

string
current_version

The version the entity has now, for version_mismatch.

integer format: int64
references

What still names what the write would remove or hide, for in_use.

Array<object>
object
kind
required

What names it, such as flag, segment or experiment.

string
key
required
string
environment
required

The key of the environment it is named in; null when it is named in every environment.

string
nullable
provider

The slug of the auth provider to sign in through instead, for sso_required.

string
used_by

What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).

Array<string>
failure

Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.

string
failure_status

The HTTP status the target answered, for sink_not_ready, when it answered.

integer
failure_code

The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.

string
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required
string
detail
required
string
params

The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.

object
key
additional properties
any

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"detail": "example",
"request_id": "example",
"retry_after": 1,
"permission": "example",
"current_version": 1,
"references": [
{
"kind": "example",
"key": "example",
"environment": "example"
}
],
"provider": "example",
"used_by": [
"example"
],
"failure": "example",
"failure_status": 1,
"failure_code": "example",
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}