VocalDocscontracts 1.65.0

Run conversation tests against an Agent version

POST /v1/agents/{agent_id}/versions/{version}/tests

PropertyValue
Operationrun_agent_version_tests
GroupAgent versions
Scopeprompts:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited agent.version.test (mutation)
Released in1.55.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Runs the scripted scenarios of a suite of the Agent, or inline tests, against the Agent version as test Calls with purpose: "evaluation" on the headless Engine, each repeated as asked, as an agent.conversation_test job, and answers 202 with the run queued, its job_id and its Location (1.55.0). Nothing is judged by a model: an expectation is met or not by the recorded facts. A retired version is 409 agent_version_unavailable. Until a dedicated evaluation quota exists the Calls count against the daily allowance of test Calls (429 test_daily_cap_reached); from 1.63.0 they count against both, the evaluation quota refusing with 429 evaluation_quota_reached. Until the headless Engine runs evaluation Calls the request is refused with 422 capability_not_available and the detail evaluation_engine_not_available. The report is never a publish gate in 1.55.0; from 1.63.0 a run of a suite that defines a gate carries its outcome (gate), which an activation of the version reads once the owner of the Agent names the suite.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the prompts: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_.../versions/1/tests" \
  -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.
versionpathintegeryesA version number, from 1.
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: ConversationTestRunRequest.

FieldTypeRequiredDescription
repetitionsintegernoThe suite's repetitions, or 5 for inline tests, when omitted.
suite_idPromptEvalSuiteIdnoRuns the scripted scenarios of this suite of the Agent.
testsarray of ConversationTestInputno

Responses

StatusContent typeShapeError codes
202application/jsonConversationTestRun
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeprompt_eval_suite_archived, agent_version_unavailable, idempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed, capability_not_available
429application/jsonErrorEnvelopetest_daily_cap_reached, evaluation_quota_reached, rate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 202 answer

The shape is ConversationTestRun.

FieldTypeRequiredDescription
agent_idAgentIdyes
agent_versionintegeryes
cost_linesarray of PromptEvalCostLineyes
created_atTimestampyes
created_byActorRefyes
error_codestring or nullyes
finished_atTimestamp or nullyes
gatePromptEvalGateOutcome or nullnoHow the run fares against its suite's publish gate (1.63.0), once completed; null for inline tests, for a suite with no gate and before completion. Absent from an api before 1.63.0.
idPromptEvalRunIdyes
job_idJobIdyesThe agent.conversation_test job that runs it.
object"conversation_test_run"yes
repetitionsintegeryes
started_atTimestamp or nullyes
statusPromptEvalRunStatusyes
suite_idPromptEvalSuiteId or nullyesNull for inline tests.
summaryConversationTestSummary or nullyesNull until completed.
testsarray of ConversationTestReportyesOne report per test, in the order of the suite or the request; empty until run.