VocalDocscontracts 1.65.0

Stop an experiment

POST /v1/agents/{agent_id}/experiments/{experiment_id}/stop

PropertyValue
Operationstop_experiment
GroupPrompt evaluations and experiments
Scopeagents:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited agent.experiment.stop (mutation)
Released in1.55.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Stops a running experiment, or discards a draft, with the reason requested and emits experiment.stopped for a running one (1.55.0); new Calls run the active version again. A stopped experiment answers as it stands; a promoted one is 409 experiment_conflict with the reason promoted.

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_.../experiments/exp_.../stop" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Parameters

NameInTypeRequiredDescription
agent_idpathAgentIdyesThe id of an Agent: agt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
experiment_idpathExperimentIdyesThe id of a traffic-split experiment: exp_ 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.

Responses

StatusContent typeShapeError codes
200application/jsonExperiment
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused, experiment_conflict
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is Experiment.

FieldTypeRequiredDescription
agent_idAgentIdyes
armsarray of ExperimentArmyesThe control first, then the candidates in the order they were named.
created_atTimestampyes
created_byActorRefyes
descriptionstring or nullyesFor reviewers.
goalExperimentGoal or nullnoThe goal the results report per arm (1.63.0): a slot value at Call end or an Outcome field value. Fixed at create. Null for none; absent from an api before 1.63.0, which a reader treats as null.
idExperimentIdyes
namestringyesA display name.
object"experiment"yes
promoted_armExperimentCandidateArmKey or nullyes
started_atTimestamp or nullyes
started_byActorRef or nullyes
statusExperimentStatusyes
stop_reasonExperimentStopReason or nullyes
stop_ruleExperimentStopRule or nullyesSet with stop_rule only.
stop_rulesExperimentStopRulesyes
stopped_atTimestamp or nullyes
stopped_byActorRef or nullyesWho stopped or promoted it; null when a stop rule or a version change did.
suite_idPromptEvalSuiteId or nullyesA suite whose rubric judges a sample of live Calls, only with live_call_judging; refused with capability_not_available and live_call_judging_not_available until the Compliance profile carries it, and from 1.63.0 while the profile has it off.
unitExperimentUnityes
updated_atTimestampyes