Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
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
| Field | Type | What it is |
|---|---|---|
parent | string | The environment whose flags are evaluated. Required. |
context | EvaluationContext | Who and what the evaluation is for. |
config_flags | string[] | The ids of the flags to evaluate; empty evaluates every flag of the environment. An unknown id answers reason NOT_FOUND. |
#EvaluationContext
| Field | Type | What it is |
|---|---|---|
user_id | string | The signed-in user; the default bucketing subject. |
anonymous_id | string | A stable id of a device or visitor; the bucketing subject when there is no user_id. |
attributes | struct | Anything else rules compare, for example plan, country, app_version. |
#Response
| Field | Type | What it is |
|---|---|---|
evaluations | ConfigFlagEvaluation[] | One per requested flag, or per flag of the environment, by id. |
#ConfigFlagEvaluation
| Field | Type | What it is |
|---|---|---|
config_flag | string | The flag's id. |
value | value | The value; null when the flag does not exist. |
reason | EvaluationReason | Why this value. One of targeting_match, split, default, disabled, not_found. |
rule_index | int32 | The index in spec.rules of the rule that matched, for TARGETING_MATCH and SPLIT. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.INVALID_FIELD— A field failed validation.
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 '{}'