Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Evaluate a config flag

Evaluates config flags of an environment for one evaluation context: each flag's value, and why.

Evaluates config flags of an environment for one evaluation context: each flag's value, and why. Browsers and mobile apps call it with a publishable key holding config:evaluate, which reads values, never rules.

  • Path POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/config_flags:evaluate
  • Scope config:evaluate
  • Effect read — nothing is written.
  • Collection config_flags
  • Publishable key callable

#Request

FieldTypeWhat it is
parentstringThe environment whose flags are evaluated. Required.
contextEvaluationContextWho and what the evaluation is for.
config_flagsstring[]The ids of the flags to evaluate; empty evaluates every flag of the environment. An unknown id answers reason NOT_FOUND.

#EvaluationContext

FieldTypeWhat it is
user_idstringThe signed-in user; the default bucketing subject.
anonymous_idstringA stable id of a device or visitor; the bucketing subject when there is no user_id.
attributesstructAnything else rules compare, for example plan, country, app_version.

#Response

FieldTypeWhat it is
evaluationsConfigFlagEvaluation[]One per requested flag, or per flag of the environment, by id.

#ConfigFlagEvaluation

FieldTypeWhat it is
config_flagstringThe flag's id.
valuevalueThe value; null when the flag does not exist.
reasonEvaluationReasonWhy this value. One of targeting_match, split, default, disabled, not_found.
rule_indexint32The index in spec.rules of the rule that matched, for TARGETING_MATCH and SPLIT.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/config_flags:evaluate" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'