Reject an open change request
const url = 'https://example.com/api/v1/projects/example/change-requests/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/reject';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"comment":"example"}'};
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/change-requests/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/reject \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "comment": "example" }'A member holding change_request.approve rejects an open change
request (invalid_state) with a comment telling its author why,
required and at most 2,000 characters, unless they are its author or
created the project token that is (author_cannot_approve); a
project token never decides one
(token_cannot_approve). A rejected change request is final;
copying it resumes its work.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The project’s key.
The change request’s identifier.
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.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Why the change request is rejected, at most 2,000 characters.
Example generated
{ "comment": "example"}Responses
Section titled “Responses”The change request as it is now.
object
What a change request proposes: flag_configuration, a flag’s
configuration in one environment; definition, a flag’s variations
and automatic exposure, or a segment’s conditions and private
switch, in every environment; experiment, an experiment’s start,
stop with a decision or traffic allocation growth, in every
environment holding its rule. A client reads proposed by the kind
and the entity named.
The key of the flag proposed for; for an experiment change request, the experiment’s flag.
The key of the environment of a flag_configuration change request.
The key of the segment of a segment’s definition.
The key of the experiment of an experiment change request.
draft (its author prepares it), open (offered for review),
approved, rejected, applied, cancelled, superseded (what
it was based on moved). The last four are final.
The version of the configuration, the flag, the segment or the experiment the change request is based on.
For a revert, the version of the configuration it returns to, from which the server fills proposed; null for any other change request.
What the change request proposes, by its kind and the entity it
names: a ProposedConfiguration for flag_configuration, a
ProposedFlagDefinition for a flag’s definition, a
ProposedSegmentDefinition for a segment’s, a
ProposedExperimentTransition for experiment.
A flag configuration as a change request proposes it: what it serves and the notes and descriptions that stay on the server, without who wrote it or when.
object
object
The key of another flag of the project, not archived.
One of that flag’s variations.
object
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.
A flag’s definition as a change request proposes it.
object
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).
A segment’s definition as a change request proposes it.
object
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.
The transition of an experiment a change request proposes.
object
A stop’s decision; absent for any other transition.
object
winner serves the winning variation where the experiment was
served; removed deletes the experiment’s rules.
The variation that won; null for a removal.
Why, as the members who decided wrote it; empty for none.
The traffic allocation a growth grows to; absent for any other transition.
The RFC 6902 patch from the entity as the change request is
based on it to proposed. For an experiment change request,
from the experiment (status, traffic_allocation,
decision) and the rules serving it in each environment holding
one (rules, by environment key) to what the transition leaves
of them, so a stop shows each rule it rewrites or removes.
One operation of an RFC 6902 JSON Patch; value is absent from a remove.
object
A JSON Pointer into proposed.
The value added or replaced, of any JSON type, null included.
The member or the project token that proposed the change request.
object
The member’s display name or the token’s name, as it is now.
Who approved the change request, when and why; null unless it was approved.
object
object
The member’s display name, as it is now.
What the member said, empty when an approval said nothing.
Who rejected the change request, when and why; null unless it was rejected.
object
object
The member’s display name, as it is now.
What the member said, empty when an approval said nothing.
When the change request was applied; null until it is.
Who applied the change request; null until it is applied.
object
The member’s or the token’s identifier; null for the system.
The member’s display name or the token’s name, as it is now; empty for the system.
The audit entry of the write that superseded the change request by changing what it was based on: a direct write, an override, the kill switch, a copy, a revert, another change request’s application, archiving or deleting its flag, deleting its environment, a write to a segment a rule of proposed names; for a definition, any write to its flag or segment, and a write to the configuration of its flag or of a flag naming its segment, in any environment; for an experiment, any write to the experiment, its deletion included, and a write to its flag’s configuration in an environment that held its rule when the change request was based on it. Null unless a write superseded it; a change request found superseded only when it was opened, approved or applied names none, as when another environment has started holding the experiment’s rule since.
When the system applies the change request once approved, in UTC; null when it is applied by hand.
Why the last scheduled application failed; null when none did.
object
When the last attempt failed.
The code of the refusal, as a manual application would answer it, or internal.
The attempts that failed in a row.
Whether the system stopped trying, after
FLAGNETIC_SCHEDULE_MAX_FAILURES attempts (5 by default). Cancel
the change request and copy it to propose it again.
Counts the entity’s accepted changes, from 1; send it back in If-Match to change the entity.
Example
{ "kind": "flag_configuration", "state": "draft", "proposed": { "action": "start", "decision": { "outcome": "winner" } }, "diff": [ { "op": "add" } ], "author": { "kind": "member" }, "applied_by": { "kind": "member" }}Headers
Section titled “Headers”The entity’s version as a strong entity tag, such as "7", to send back in If-Match.
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": {} } ]}The change conflicts with what exists, such as already_exists for a key already in use.
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": {} } ]}The request is well formed but breaks a rule; errors names each field to fix.
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": {} } ]}