Restore an archived flag
const url = 'https://example.com/api/v1/projects/example/flags/example/restore';const options = {method: 'POST', 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 POST \ --url https://example.com/api/v1/projects/example/flags/example/restore \ --header 'Authorization: Bearer <token>'Brings an archived flag back to SDKs as it was archived. Restoring a flag that is not archived changes nothing.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The project’s key.
The flag’s key.
Header Parameters
Section titled “Header Parameters”The version of the entity this write is based on, as its ETag
answered it ("7", or 7), read as RFC 9110 reads If-Match: *
matches any current version, and a list ("6", "7") matches when it
holds the current one. A weak tag (W/"7") matches nothing, as the
comparison is strong. Required: without it the write is refused
428 precondition_required, and with no tag that is the current
version 412 version_mismatch, both judged after the request is
validated. A header that is neither * nor a list of entity tags is
refused 400 invalid_request.
Responses
Section titled “Responses”The flag as it is now.
A flag’s definition with its configuration in every environment, and when an SDK last evaluated it in each, both by the environments’ order.
object
Names the flag in code, such as checkout.newFlow; unique, case sensitively, in the project, and never changes.
The member accountable for the flag.
A temporary flag is meant to be removed by its expected removal date; a permanent one stays.
When a temporary flag is expected to be removed; null for a permanent one.
SDKs record an exposure after every evaluation whose result carries an experiment.
object
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).
When the flag was archived, hidden from SDKs; null while it is not.
The member who created the flag; null when a project token did.
Counts the entity’s accepted changes, from 1; send it back in If-Match to change the entity.
What the flag serves in one environment.
object
Names the entity in URLs, SDK calls and rules, and never changes.
The variation served while the flag is off, and when a prerequisite fails.
The variation served when the flag is on and no rule matches.
Flags that must serve the named variation for this flag to be evaluated; otherwise it serves its off variation.
object
The key of another flag of the project, not archived.
One of that flag’s variations.
A variation fixed for one unit. Its note and author stay on the server; SDKs receive neither.
object
Why the unit has a fixed variation; null for none.
The member who last wrote the override; null when a project token did.
Checked in order; the first whose conditions all hold serves.
object
Given by the server to a new rule and kept across writes.
Every one must hold for the rule to match.
One comparison inside a rule or a segment. An attribute condition
names an attribute or unit type, an operator (op) and a value
(none for exists, not_exists and is_empty); in_segment and
not_in_segment name a segment; prerequisite names a flag and
one of its variations. A segment holds attribute conditions only.
object
attribute, in_segment, not_in_segment or prerequisite.
A string, number, boolean or list, as the operator and the attribute’s type need; null is no value.
What a matching rule serves. variation serves variation;
rollout serves variation to percentage of the units of
unit_type, in basis points (0 to 10,000), the others continuing to
the next rule. A rollout’s salt is given by the server and changes
only through regenerating it, so a write omits it or sends it
unchanged. experiment serves the experiment experiment of the
flag, which assigns units to variations by its own weights; a rule
serves a draft or running experiment of its flag
(unknown_experiment, experiment_of_another_flag and
experiment_not_servable otherwise), and several rules may serve
the same one; a rule that served the experiment already keeps
serving it whatever its status, so stopping or archiving it never
blocks an edit of the other rules. While the experiment is a draft,
stopped or archived its rules are left out of the ruleset SDKs
receive; while it runs they carry its unit type, salts, traffic
allocation and weights.
object
variation, rollout or experiment.
The key of the experiment served, for kind experiment.
The member whose write made the configuration what it is; null when a project token did.
Counts the entity’s accepted changes, from 1; send it back in If-Match to change the entity.
The change requests waiting on the configuration, which any write to it supersedes. Answered by the configuration’s own operations; a flag’s detail and the audit log leave it out.
object
How many are open, awaiting a decision.
How many are approved, awaiting application.
The earliest time one of them is scheduled to be applied at; null when none is scheduled.
object
Names the entity in URLs, SDK calls and rules, and never changes.
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.
Example
{ "type": "boolean", "lifetime": "permanent"}Headers
Section titled “Headers”The entity’s version as a strong entity tag, such as "7", to send back in If-Match.
invalid_request: a parameter that is malformed or out of its range, such as a cursor this API did not return.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
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).
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.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
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
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.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
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).
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.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
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
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": {} } ]}Headers
Section titled “Headers”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.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
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).
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.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
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
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.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
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).
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.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
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
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": {} } ]}version_mismatch: the entity changed since the version If-Match names; current_version is the version it has now.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
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).
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.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
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
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": {} } ]}precondition_required: the write names no version in If-Match.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
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).
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.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
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
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": {} } ]}