Skip to main content
POST
Evaluate an item against a decision

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]+$
prefer
string

wait=<seconds> (RFC 7240) shortens the request's 10 s budget.

Maximum string length: 256

Body

application/json
decision_id
string
required
Pattern: ^[a-z][a-z0-9_.-]{0,127}$
subject
object[]
required
Required array length: 1 - 64 elements
item_id
string
required
Required string length: 1 - 256
spec
object
required
weights
default:default
Available options:
default
outcomes
object
context
object[]
Maximum array length: 64
metadata
object

Caller key-values, stored with the evaluation and never shown to the model. Keys starting mb. are reserved for Moonbounce provenance: mb.commit, mb.branch, mb.service and mb.release, which say where a call came from.

summary
string
Required string length: 1 - 140
dry_run
boolean

Spends engine calls and stores only usage, with no evaluation or feedback target. Refuses Idempotency-Key.

structure
string
Pattern: ^sha256:[0-9a-f]{64}$

Response

The evaluation

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; registered structures are shared.

Available options:
production,
test
id
string
required
Pattern: ^evl_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
decision_id
string
required
Pattern: ^[a-z][a-z0-9_.-]{0,127}$
version
object
required
status
enum<string>
required
Available options:
scored,
no_outcomes,
abstained
nodes
object
required

The value of each of the spec's named nodes, features and aggregators alike, keyed by node name. Every value carries its type; a node with an answer has value, one without has abstained or failed.

engines
object
required
usage
object
required
item_id
string
required
score
number
outcome
string
Pattern: ^[a-z][a-z0-9_]{0,63}$
outcomes
object
cost
object

Always present on fresh responses; absent only on an idempotent replay of a response stored before costs were reported.

summary
string
metadata
object

Caller key-values, stored with the evaluation and never shown to the model. Keys starting mb. are reserved for Moonbounce provenance: mb.commit, mb.branch, mb.service and mb.release, which say where a call came from.

warnings
object[]