VocalDocscontracts 1.65.0

Promote a candidate of an experiment

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

PropertyValue
Operationpromote_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.promote (mutation)
Released in1.55.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Activates the candidate of a running or stopped experiment, as a publish with activate would, ends the experiment promoted and emits experiment.stopped (1.55.0). A Member decides: Vocal never declares a winner. With two candidates the body names the arm (experiment_arm_required). A draft is 409 experiment_conflict with the reason not_started, a promoted experiment with promoted; a candidate retired since is 409 agent_version_unavailable. From 1.63.0 an Agent whose owner turned the publish gate on promotes only a candidate whose latest run of the gating suite passed it, at the suite's current revision, and refuses otherwise with 422 evaluation_gate_failed, one detail per EvaluationGateReason.

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_.../promote" \
  -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.
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.

Request body

Content type application/json, required: ExperimentPromoteRequest.

FieldTypeRequiredDescription
armExperimentCandidateArmKeynoThe candidate to activate; required with two candidates (experiment_arm_required).

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, agent_version_unavailable
422application/jsonErrorEnvelopevalidation_failed, evaluation_gate_failed
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