Skip to main content
POST

Authorizations

Authorization
string
header
required

An API key, sent as Authorization: Bearer <key>. Each operation lists the scope its key needs: decisions:evaluate (evaluate and read evaluations), decisions:feedback (your app's feedback) or decisions:develop (everything else, including owner feedback and the review queue). An operation listing no scope takes any scoped key. A key with no scope, or without the operation's, gets 403 INSUFFICIENT_SCOPE.

Headers

idempotency-key
string

Makes a retry safe. For 24 hours, the same key with the same request returns the first stored result (with Idempotent-Replayed: true); the same key with a different request is a 422 IDEMPOTENCY_KEY_REUSED. Keys are scoped to the organization and environment across every operation, so use a fresh key per request. A request that failed before its result was stored runs again when retried with its key.

Required string length: 1 - 255
Pattern: ^[\x20-\x7e]+$

Path Parameters

decision_id
string
required

A name you choose for this decision, such as refund-exception: a lowercase letter, then up to 127 of a-z 0-9 _ . -. Unique in your organization and shared by its test and production keys. The first registration or evaluation under a new one creates the decision.

Pattern: ^[a-z][a-z0-9_.-]{0,127}$

Body

application/json
questions
object
required

System One questions, keyed by name.

result
string
required

The final feature's path, such as aggregations.band.

Required string length: 1 - 80
Examples:

"questions.asks_for_refund"

"aggregations.band"

attributes
object

Values your app supplies with each call in attribute_values. The model never sees them.

aggregations
object
items
object[]

The items to evaluate under the same version, each exactly as one evaluate would. Send items or cases.

Required array length: 1 - 200 elements
cases
object

The decision's labeled cases to evaluate, in place of items: by evaluation_ids, or by the filters list_cases takes (the same cases, newest label first, limit per run; pass cases.next_cursor back for the next page). Always dry runs. Each case is replayed: a question unchanged since the case ran reuses the answer it stored (the same model), the rest are asked. Its label, label source and answer corrections go with the run for loss_report.

refresh
string[]

With cases: questions that get fresh answers instead of the ones the cases stored (as a preview refreshes the base questions a candidate changed or dropped).

Minimum array length: 1
Pattern: ^[a-z][a-z0-9_]{0,63}$
include
enum<string>[]

Add to each result its answers, its attributes (as resolved, defaults applied), or its evaluation: everything evaluate returns for that item on its own. Default: none.

Available options:
answers,
attributes,
evaluation
dry_run
boolean

true: every item is a dry run, storing no evaluation (only usage, and the run's results for a day). Absent or false: each item is stored as an evaluation, real traffic. A run of cases is always a dry run.

structure_hash
any

Must be absent: send the structure inline or by its hash, not both.

Response

The run

run_id
string
required

Pass it to loss_report; kept until expires_at. A stored run's evaluations stay after it expires.

Pattern: ^evr_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
expires_at
string<date-time>
required
dry_run
boolean
required

Whether the items were dry runs (nothing stored) or stored as evaluations.

environment
enum<string>
required

The environment of the key that made the call: production or test. Evaluations, feedback, reviews and suggestions are separate per environment; decisions and their versions belong to the whole organization.

Available options:
production,
test
decision_id
string
required

A name you choose for this decision, such as refund-exception: a lowercase letter, then up to 127 of a-z 0-9 _ . -. Unique in your organization and shared by its test and production keys. The first registration or evaluation under a new one creates the decision.

Pattern: ^[a-z][a-z0-9_.-]{0,127}$
version
object
required

The version that ran.

model
object
required

The model that answered.

counts
object
required
cost
object
required
results
object[]
required

One per item, in item order (cases: newest label first).

cases
object

With cases: which cases the run took.