The environment's whole ruleset, for a server key
const url = 'https://example.com/sdk/v1/ruleset';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”The highest document schema the SDK reads; absent is 1.
The ETag of the ruleset the SDK holds.
Responses
Section titled “Responses”The ruleset.
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
The document schema, 1.
The ruleset version, which only grows and is never given to two different rulesets of the environment. It is below 2^53.
The one scope of a ruleset; an SDK refuses a document of any other.
object
An SDK ignores local overrides in a protected environment.
object
string, number, boolean, semver, date or list.
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
The operand, of the attribute’s type.
object
boolean, string, number or json; an SDK drops a flag of a type it does not know.
object
The variation’s JSON value.
object
object
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
The operand, of the attribute’s type.
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
object
The variation’s share of the allocated traffic, in basis points.
Example
{ "scope": "server"}Headers
Section titled “Headers”The ruleset version, quoted, as a strong tag.
private, no-cache: no shared cache holds a ruleset, and an SDK revalidates it.
Authorization, Accept-Encoding: the answer depends on the key.
The requests the window allows.
The requests left in the window.
The ruleset named in If-None-Match is still the current one.
Headers
Section titled “Headers”The ruleset version, quoted, as a strong tag.
private, no-cache: no shared cache holds a ruleset, and an SDK revalidates it.
Authorization, Accept-Encoding: the answer depends on the key.
The requests the window allows.
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".
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which an SDK branches on.
An English explanation for humans; never what an SDK branches on.
Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.
object
JSON Pointer into the request body.
The rule broken, such as too_long, too_many or duplicate.
The values of the rule broken, such as max, for a client to explain the violation in its own language.
object
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": {} } ]}Headers
Section titled “Headers”key_kind_not_allowed (a client key at the ruleset),
server_key_in_query, server_key_from_browser or
origin_not_allowed.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which an SDK branches on.
An English explanation for humans; never what an SDK branches on.
Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.
object
JSON Pointer into the request body.
The rule broken, such as too_long, too_many or duplicate.
The values of the rule broken, such as max, for a client to explain the violation in its own language.
object
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.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which an SDK branches on.
An English explanation for humans; never what an SDK branches on.
Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.
object
JSON Pointer into the request body.
The rule broken, such as too_long, too_many or duplicate.
The values of the rule broken, such as max, for a client to explain the violation in its own language.
object
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.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which an SDK branches on.
An English explanation for humans; never what an SDK branches on.
Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.
object
JSON Pointer into the request body.
The rule broken, such as too_long, too_many or duplicate.
The values of the rule broken, such as max, for a client to explain the violation in its own language.
object
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": {} } ]}Headers
Section titled “Headers”Seconds to wait before trying again, at least 1.
The requests the window allows.
The requests left in the window.
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.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which an SDK branches on.
An English explanation for humans; never what an SDK branches on.
Seconds to wait before retrying, for rate_limited, ruleset_unavailable and unavailable.
object
JSON Pointer into the request body.
The rule broken, such as too_long, too_many or duplicate.
The values of the rule broken, such as max, for a client to explain the violation in its own language.
object
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": {} } ]}Headers
Section titled “Headers”Seconds to wait before trying again, at least 1.