Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Snapshot a config flag

The environment's flags and segments in one read, for SDKs that evaluate locally.

The environment's flags and segments in one read, for SDKs that evaluate locally. Poll it with if_none_match set to the last etag: an unchanged ruleset answers not_modified and nothing else.

  • Path GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/config_flags:snapshot
  • Scope config:read
  • Effect read — nothing is written.
  • Collection config_flags
  • Query if_none_match

#Request

FieldTypeWhat it is
parentstringThe environment. Required.
if_none_matchstringThe etag of the snapshot the caller holds; unchanged answers not_modified.

#Response

FieldTypeWhat it is
etagstringThe version of this ruleset; changes with any flag or segment.
not_modifiedboolTrue when if_none_match is this ruleset's etag; nothing else is set then.
config_flagsConfigFlag[]Every flag of the environment.
config_segmentsConfigSegment[]Every segment of the environment.
poll_intervaldurationHow long the caller waits before polling again.

#ConfigFlag

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/config_flags/{config_flag}; the id is the key evaluators ask for.
uidstringcfg_<cell><ulid>. Output only.
metaResourceMetaResource metadata.
specConfigFlagSpecDesired state. Required.
statusConfigFlagStatusObserved state. Output only.

#ConfigSegment

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/config_segments/{config_segment}; the id is what IN_SEGMENT names.
uidstringseg_<cell><ulid>. Output only.
metaResourceMetaResource metadata.
specConfigSegmentSpecDesired state. Required.
statusConfigSegmentStatusObserved state. Output only.

#ResourceMeta

FieldTypeWhat it is
generationint64Increases by one on every change to spec. Output only.
etagstringStrong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as If-Match or etag to make Update and Delete conditional; a mismatch fails with ABORTED / 409 ETAG_MISMATCH. Output only.
create_timetimestampWhen the Resource was created. Output only.
update_timetimestampWhen the Resource last changed. Output only.
delete_timetimestampSet while the Resource is being deleted. Output only.
labelsmap<string, string>Caller-writable, indexed labels (AIP-122 label rules).
annotationsmap<string, string>Caller-writable, unindexed annotations.
display_namestringCaller-writable human-readable name.
creatorstringThe principal that created the Resource. Output only.

#ConfigFlagSpec

FieldTypeWhat it is
value_typeConfigValueTypeThe type every value of the flag has. Required. One of bool, string, int64, double, json.
default_valuevalueThe value when no rule matches, or when the flag is disabled. Required.
enabledboolWhen false, every evaluation returns default_value and the rules are skipped: a kill switch. Default true.
rulesTargetingRule[]Targeting rules, first match wins.
descriptionstringWhat the flag is for.
client_visibleboolPublishable keys (browsers, mobile apps) may evaluate it with config_flags:evaluate; default false, so a server-only flag's value never reaches a device. Secret keys evaluate every flag.

#ConfigFlagStatus

FieldTypeWhat it is
observed_generationint64The generation this status was computed from. Output only.
conditionsCondition[]Ready, Reconciling, Stalled. Reconciling while a change rolls out in waves; Stalled when a wave's health gate fails and the change halts. Output only.
waveint32The wave the current change has reached, from 1. Output only.
wave_countint32How many waves the change takes. Output only.
updated_cell_countint32How many cells serve the current generation. Output only.
cell_countint32How many cells the environment spans. Output only.

#ConfigSegmentSpec

FieldTypeWhat it is
includedstring[]Subjects always in the segment, by user_id or anonymous_id.
excludedstring[]Subjects never in the segment, whatever else holds.
conditionsTargetingCondition[]Conditions over the evaluation context; all must hold.
descriptionstringWho the segment is.

#ConfigSegmentStatus

FieldTypeWhat it is
observed_generationint64The generation this status was computed from. Output only.
conditionsCondition[]Ready. Output only.

#TargetingRule

FieldTypeWhat it is
valuevalueThe value served when the rule matches; of the flag's type. Required.
percentageint32Serve value to evaluations whose bucket is below this, from 0 to 100; default 100. The rest fall through to the next rule.
bucket_attributestringThe context attribute hashed for the bucket: user_id, anonymous_id, or an attribute path; default user_id, else anonymous_id. An evaluation without it never matches a rule below 100 percent.
descriptionstringWhat the rule is for.
conditionsTargetingCondition[]Conditions over the evaluation context; all must hold. None matches every evaluation.

#Condition

FieldTypeWhat it is
typestringThe condition type, for example Ready.
statusConditionStatusWhether the condition holds. One of true, false, unknown.
observed_generationint64The generation this observation was made against.
reasonstringA machine-readable UpperCamelCase reason.
messagestringA customer-safe human-readable message.
severitySeverityHow severe a FALSE condition is. One of info, warning, error.
transition_timetimestampWhen status last changed.

#TargetingCondition

FieldTypeWhat it is
attributestringuser_id, anonymous_id, or a path into the context's attributes, dot-separated (plan, device.os). Required, except with IN_SEGMENT and NOT_IN_SEGMENT.
operatorConditionOperatorThe comparison. Required. One of equals, not_equals, greater_than, greater_or_equal, less_than, less_or_equal, contains, not_contains, starts_with, ends_with, in, not_in, matches, semver_greater_than, semver_greater_or_equal, semver_less_than, semver_less_or_equal, in_segment, not_in_segment.
valuevalueThe value compared with; a list for IN and NOT_IN, a string for the string, regular expression and semantic version operators. Required.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/config_flags:snapshot" \
  -H "Authorization: Bearer $SYLPHX_API_KEY"