VocalDocscontracts 1.65.0

Run a decision corpus against the pinned Provider

POST /v1/agents/{agent_id}/decision-corpora/{corpus_id}/runs

PropertyValue
Operationcreate_decision_run
GroupDecision corpora
Scopeagents:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited decision_run.create (mutation)
Released in1.58.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Sends the corpus to the Provider and model version the Agent's active version pins for the corpus's question set, as a decision.run job, and answers 202 with the run queued, its job_id and its Location (1.58.0). A run while another is queued or running answers 409 decision_run_in_progress; an Agent whose active version has no lane or not this set is decision_run_no_lane; an empty corpus is decision_corpus_empty. Metered as decision_request like any decision request, on the run (usage, 1.59.0) since a run has no Call and writes no Usage event; the job emits job.succeeded or job.failed, and the run, completed or failed, decision_run.completed (1.59.0 states the failed one).

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the agents:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/agents/agt_.../decision-corpora/dcp_.../runs" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
agent_idpathAgentIdyesThe id of an Agent: agt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
corpus_idpathDecisionCorpusIdyesThe id of a decision corpus: dcp_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: DecisionRunRequest.

FieldTypeRequiredDescription
precision_targetnumbernoThe precision a proposed threshold must meet, 0.9 when omitted (a target).

Responses

StatusContent typeShapeError codes
202application/jsonDecisionRun
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopedecision_corpus_archived, decision_run_in_progress, idempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 202 answer

The shape is DecisionRun.

FieldTypeRequiredDescription
agent_idAgentIdyes
agent_versionintegeryesThe active version whose chain ran.
casesintegeryesThe cases sent.
completed_atTimestamp or nullyes
corpus_idDecisionCorpusIdyes
corpus_versionintegeryes
created_atTimestampyes
created_byActorRefyes
error_codestring or nullyesWhy a failed run failed, such as provider_unavailable; null otherwise.
idDecisionRunIdyes
job_idJobIdyes
model_versionstringyes
object"decision_run"yes
precision_targetnumberyesThe precision a proposed threshold must meet, 0.9 when omitted (a target).
providerProviderIdyes
question_setQuestionSetKeyyes
resultsarray of DecisionQuestionResultyesPer question, once completed; empty before.
statusDecisionRunStatusyes
usageDecisionRunUsage or nullnoWhat the run used (1.59.0), once its result landed, completed or failed; null while it is queued or running. Absent from an api before 1.59.0, which a reader treats as null.