Skip to content

The environment's whole ruleset, for a server key

GET
/ruleset
curl --request GET \
--url https://example.com/sdk/v1/ruleset \
--header 'Authorization: Bearer <token>'

The ruleset document of the key’s environment (scope server), private segments and overrides included, which a server SDK evaluates locally. Only a server key receives it: a client key is refused 403 key_kind_not_allowed and uses remote evaluation instead.

The ETag is the ruleset version, quoted ("1745040000000"). If-None-Match is compared weakly: a W/ tag, a list of tags and * are accepted, and a match is answered 304 with no body. A replica that cannot load the ruleset answers 503 ruleset_unavailable with Retry-After, never an empty ruleset, so an SDK keeps its last good one.

Flagnetic-Schema-Version
string

The highest document schema the SDK reads; absent is 1.

If-None-Match
string

The ETag of the ruleset the SDK holds.

The ruleset.

Media typeapplication/json

The complete evaluable configuration of one environment at one moment. An SDK ignores members it does not know, at any level. unit_types, attributes, segments and flags are ordered by key. Every other list keeps the order it has, which carries meaning: a flag’s prerequisites, overrides and rules, a rule’s conditions and an experiment’s weights are evaluated or laid out in that order, so an SDK never sorts them.

object
schema_version
required

The document schema, 1.

integer
version
required

The ruleset version, which only grows and is never given to two different rulesets of the environment. It is below 2^53.

integer format: int64
scope
required

The one scope of a ruleset; an SDK refuses a document of any other.

string
Allowed values: server
environment
object
key
required
string
protected
required

An SDK ignores local overrides in a protected environment.

boolean
unit_types
required
Array<string>
attributes
required
Array<object>
object
key
required
string
type
required

string, number, boolean, semver, date or list.

string
segments
required
Array<object>
object
key
required
string
private
required
boolean
conditions
required
Array<object>

attribute (attribute, op, value), in_segment or not_in_segment (segment), or prerequisite (flag, variation). An operator or kind an SDK does not know is an unsupported rule.

object
kind
required
string
attribute
string
op
string
value

The operand, of the attribute’s type.

segment
string
flag
string
variation
string
flags
required
Array<object>
object
key
required
string
type
required

boolean, string, number or json; an SDK drops a flag of a type it does not know.

string
automatic_exposure
required
boolean
variations
Array<object>
object
key
required
string
value
required

The variation’s JSON value.

on
required
boolean
off_variation
string
fallthrough
string
prerequisites
Array<object>
object
flag
required
string
variation
required
string
overrides
Array<object>
object
unit_type
required
string
unit_id
required
string
variation
required
string
rules
Array<object>
object
id
required
string
conditions
required
Array<object>

attribute (attribute, op, value), in_segment or not_in_segment (segment), or prerequisite (flag, variation). An operator or kind an SDK does not know is an unsupported rule.

object
kind
required
string
attribute
string
op
string
value

The operand, of the attribute’s type.

segment
string
flag
string
variation
string
serve
required

variation (variation); rollout (unit_type, variation, percentage in basis points, salt); or experiment (experiment, unit_type, inclusion_salt, variation_salt, traffic_allocation within 0 to 10,000, and at least two weights, none negative, naming distinct variations of the flag and summing to 10,000; an evaluator answers a serve breaking these inconsistent_ruleset). A kind an SDK does not know is an unsupported rule.

object
kind
required
string
variation
string
unit_type
string
percentage
integer
salt
string
experiment
string
inclusion_salt
string
variation_salt
string
traffic_allocation
integer
weights
Array<object>
object
variation
required
string
weight
required

The variation’s share of the allocated traffic, in basis points.

integer

Example

{
"scope": "server"
}
ETag
string

The ruleset version, quoted, as a strong tag.

Cache-Control
string

private, no-cache: no shared cache holds a ruleset, and an SDK revalidates it.

Vary
string

Authorization, Accept-Encoding: the answer depends on the key.

RateLimit-Limit
integer

The requests the window allows.

RateLimit-Remaining
integer

The requests left in the window.

The ruleset named in If-None-Match is still the current one.

ETag
string

The ruleset version, quoted, as a strong tag.

Cache-Control
string

private, no-cache: no shared cache holds a ruleset, and an SDK revalidates it.

Vary
string

Authorization, Accept-Encoding: the answer depends on the key.

RateLimit-Limit
integer

The requests the window allows.

RateLimit-Remaining
integer

The requests left in the window.

sdk_key_missing without a key, with WWW-Authenticate: Bearer; sdk_key_invalid, sdk_key_revoked or sdk_key_expired, with WWW-Authenticate: Bearer error="invalid_token".

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 an SDK branches on.

string
detail

An English explanation for humans; never what an SDK branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.

integer
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required

The rule broken, such as too_long, too_many or duplicate.

string
detail
required
string
params

The values of the rule broken, such as max, 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,
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}
WWW-Authenticate
string

key_kind_not_allowed (a client key at the ruleset), server_key_in_query, server_key_from_browser or origin_not_allowed.

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 an SDK branches on.

string
detail

An English explanation for humans; never what an SDK branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.

integer
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required

The rule broken, such as too_long, too_many or duplicate.

string
detail
required
string
params

The values of the rule broken, such as max, 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,
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}

schema_version_unsupported: Flagnetic-Schema-Version below 1, not an integer, or sent more than once.

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 an SDK branches on.

string
detail

An English explanation for humans; never what an SDK branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.

integer
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required

The rule broken, such as too_long, too_many or duplicate.

string
detail
required
string
params

The values of the rule broken, such as max, 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,
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}

rate_limited: the window is spent.

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 an SDK branches on.

string
detail

An English explanation for humans; never what an SDK branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.

integer
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required

The rule broken, such as too_long, too_many or duplicate.

string
detail
required
string
params

The values of the rule broken, such as max, 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,
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}
Retry-After
integer

Seconds to wait before trying again, at least 1.

RateLimit-Limit
integer

The requests the window allows.

RateLimit-Remaining
integer

The requests left in the window.

RateLimit-Reset
integer

Seconds until the window ends, at least 1.

ruleset_unavailable (this replica cannot load the environment’s ruleset yet) or unavailable (the key could not be checked, or this replica is shutting down and takes no new stream), with Retry-After.

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 an SDK branches on.

string
detail

An English explanation for humans; never what an SDK branches on.

string
request_id
required
string
retry_after

Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.

integer
errors
Array<object>
object
pointer
required

JSON Pointer into the request body.

string
code
required

The rule broken, such as too_long, too_many or duplicate.

string
detail
required
string
params

The values of the rule broken, such as max, 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,
"errors": [
{
"pointer": "example",
"code": "example",
"detail": "example",
"params": {}
}
]
}
Retry-After
integer

Seconds to wait before trying again, at least 1.