Skip to main content

POST /v1/env/evaluate

Evaluate a single named variable and return its plaintext value. For ab_roll variables, the response includes which bucket was selected.

Request

Request body fields:

Response

For ab_roll variables:
Response fields:

Deterministic A/B evaluation

Pass seed and key to get a stable bucket assignment for a given user or context. Barekey computes:
The hash is interpreted as a float between 0 and 1 and compared against the variable’s chance value. The same seed + key always returns the same bucket for the same variable.

Error codes


POST /v1/env/evaluate-batch

Evaluate multiple variables in a single request. More efficient than calling /v1/env/evaluate in a loop — one round trip, one billing event.

Request

Request body fields: Each entry in entries:

Response

Results are returned in the same order as the input entries array. If one variable is not found, the entire request returns VARIABLE_NOT_FOUND — there is no partial success.

POST /v1/env/pull

Fetch all variables for a stage and return them as a flat { [name]: value } map. Equivalent to barekey env pull in the CLI. This endpoint is designed for local development tooling and scripts that need all variables at once. For production application use, prefer /v1/env/evaluate or /v1/env/evaluate-batch which scope requests to specific variables.

Request

Request body fields:

Response

All values are plaintext strings, including boolean, int64, and json declared types — the pull endpoint does not coerce types. The CLI and SDK handle coercion on top of this response. ab_roll variables are evaluated using seed/key if provided, or randomly if not. There is no decision field in pull responses.

Error codes

The same codes as /v1/env/evaluate apply, plus: