---
# @generated by sylphx-gen 0.1.0 from contracts@e145cc7cf1bc9605f2b27439e5e17ed76a1a2fd7e7021906a013f7565e4a0cd5. Do not edit.
title: "Evaluate a config flag"
description: "`config.config_flags.evaluate` (POST /v1/{parent}/config_flags:evaluate): Evaluates config flags of an environment for one evaluation context: each flag's value, and why."
type: reference
product: flags
summary: "Evaluates config flags of an environment for one evaluation context: each flag's value, and why."
updated: 2026-09-28
nav: false
---

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](/docs/api/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`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
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 '{}'
```

**TypeScript**

```ts
const response = await sylphx.config.configFlags.evaluate({ parent: 'orgs/acme/projects/shop/envs/production' })
```

**Rust**

```rust
let mut req = sylphx::config::EvaluateConfigFlagsRequest::default();
req.parent = "orgs/acme/projects/shop/envs/production".to_string();
let response = sx.config().config_flags().evaluate(req).await?;
```

**CLI**

```bash
sylphx config config-flags evaluate orgs/acme/projects/shop/envs/production
```

**MCP**

```json
{ "method_id": "config.config_flags.evaluate", "args": {"parent":"orgs/acme/projects/shop/envs/production"} }
```
