Activate a published Agent version
POST /v1/agents/{agent_id}/versions/{version}/activate
| Property | Value |
|---|---|
| Operation | activate_agent_version |
| Group | Agent versions |
| Scope | agents:write |
| Route class | control |
| Idempotency | Idempotency-Key accepted: a retry with the same key replays the first answer |
| Audit | Audited agent.version.activate (mutation) |
| Released in | 1.63.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Makes a published version the one new Calls run and answers it (1.63.0; api.md section 4): a rollback is the activation of an older version. A running experiment stops with the reason active_version_changed, as a publish that activates stops it. A retired version is 409 agent_version_unavailable; activating the active version answers it unchanged. An Agent whose owner turned the publish gate on activates only a version whose latest completed run of the gating suite, a suite run or a conversation test run at the suite's current revision, passed the gate, and refuses otherwise with 422 evaluation_gate_failed, one detail per EvaluationGateReason with the agent_version and, for a failed check, the run_id; a rollback is gated too, and in an incident the owner turns the gate off first.
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_.../versions/1/activate" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"const response = await fetch(`${process.env.VOCAL_API}/v1/agents/agt_.../versions/1/activate`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
},
});
console.log(response.status, await response.text());import os
import uuid
import requests
response = requests.post(
f"{os.environ['VOCAL_API']}/v1/agents/agt_.../versions/1/activate",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | AgentId | yes | The id of an Agent: agt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
version | path | integer | yes | A version number, from 1. |
idempotency-key | header | string | no | A client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | AgentVersion | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
409 | application/json | ErrorEnvelope | agent_version_unavailable, idempotency_in_progress, idempotency_key_reused |
422 | application/json | ErrorEnvelope | evaluation_gate_failed |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is AgentVersion.
| Field | Type | Required | Description |
|---|---|---|---|
active | boolean | yes | True when new Calls run this version. |
agent_id | AgentId | yes | |
analyzer_versions | array of PinnedAnalyzerBinding | no | The analyzer bindings the version froze at publish (1.56.0, FR-calls-19), in the draft's order, each with the analyzer version pinned and every field explicit; finalize schedules the version's analyses from them. Absent from an api older than 1.56.0, and absent or empty for a version that binds none; a reader treats its absence as none. |
config | AgentConfig | yes | |
config_sha256 | string | yes | The SHA-256 of the canonical configuration, in lowercase hex. |
engine | EngineKind | yes | |
knowledge_bindings | array of PinnedKnowledgeBinding | no | The Knowledge bindings the version froze at publish (1.53.0, FR-knowledge-2), in the draft's order, each with every field explicit and, for a pinned binding, the version active at publish. Absent from an api older than 1.53.0, and absent or empty for a version with no binding; a reader treats its absence as none. |
object | "agent_version" | yes | |
policy_versions | array of PinnedPolicy | no | The Policy versions the version pins (1.47.0, FR-agents-7): the active version of each Policy the draft's policy_ids attached, at publish, so that a later Policy change reaches Calls only through a new Agent version. Organization-scoped Policies are not pinned here: dispatch resolves them for each Call. Absent from an api older than 1.47.0; a reader treats its absence as none. |
prompt | PinnedPrompt | no | The prompt the version froze at publish (1.55.0, FR-prompts-1): the template version it pins, the platform base it tracks or pinned, the Organization layer it names and the acknowledged warnings. Absent for a version whose Agent layer is its inline instructions, which tracks the current base and receives the default Organization layer, and from an api older than 1.55.0. |
published_at | Timestamp | yes | |
published_by | ActorRef | yes | |
source_revision | integer | yes | The draft revision this version was published from. |
squad_versions | array of PinnedSquadMember | no | The squad Agent versions the version pinned at publish (1.58.0, FR-agents-14), in the draft's order: each squad Agent's active version then, so that a later publish of a squad Agent reaches Calls only through a new root version. Absent from an api older than 1.58.0, and absent or empty for a version without a Squad; a reader treats its absence as none. |
status | AgentVersionStatus | yes | |
tool_bindings | array of FrozenToolBinding | no | The Tool bindings the version froze at publish (1.60.0): every binding of the Agent then, in creation order. Absent from an api older than 1.60.0, and absent or empty for a version with none; a reader treats its absence as none. |
tools | array of PinnedTool | no | The Tools the version froze at publish (1.49.0, FR-agents-7): a copy of the definition of each Tool the draft's tool_ids attached, at its revision then, without any secret, in the draft's order, so that a later edit of a Tool reaches Calls only through a new Agent version. Absent from an api older than 1.49.0, and absent or empty for a version with no Tools; a reader treats its absence as none. |
version | integer | yes | The snapshot number, from 1. |
warnings | array of ErrorDetail | no | The warnings the publish found and did not refuse (1.59.0): the statechart warnings of StatechartWarningCode (slot_trust_warning, squad_setting_ignored, proposal_reaches_transfer), each with its pointer, computed over the Tools of the root Agent and of each squad Agent. Empty when none; absent from an api before 1.59.0, which a reader treats as none. |
workflow_version | PinnedWorkflow | no | The Workflow version the Agent version pinned at publish (1.59.0): the active version of the Workflow its draft names then. Absent for a version that names none and from an api older than 1.59.0; a reader treats its absence as none. |