VocalDocscontracts 1.65.0

Publish the Agent draft as a new version

POST /v1/agents/{agent_id}/versions

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

Publishes the draft that If-Match names as the next version and, with activate, makes it the active one. From 1.63.0 an Agent whose owner turned the publish gate on (evaluation_gate) refuses a publish with activate with 422 evaluation_gate_failed and the reason run_required, because a version is evaluated only once published: publish it without activate, run the gating suite on it, and activate it with activate_agent_version. A publish without activate is never gated.

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" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"' \
  -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.
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.
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: AgentVersionPublishRequest.

FieldTypeRequiredDescription
acknowledged_warningsarray of PromptLintCodenoThe prompt lint warnings the publisher acknowledges (1.55.0): an Agent that names a template must list each warning of the template or of its cross-checks against the Agent that needs an acknowledgement (prompt_warning_unacknowledged otherwise), such as enforcement_by_prompt; the version's prompt records the list.
activatebooleannoMake the new version the active one; false when omitted.
notesstringnoWhy this version exists.

Responses

StatusContent typeShapeError codes
201application/jsonAgentVersion
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused
412application/jsonErrorEnveloperevision_mismatch
422application/jsonErrorEnvelopevalidation_failed, capability_not_available, evaluation_gate_failed
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 201 answer

The shape is AgentVersion.

FieldTypeRequiredDescription
activebooleanyesTrue when new Calls run this version.
agent_idAgentIdyes
analyzer_versionsarray of PinnedAnalyzerBindingnoThe 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.
configAgentConfigyes
config_sha256stringyesThe SHA-256 of the canonical configuration, in lowercase hex.
engineEngineKindyes
knowledge_bindingsarray of PinnedKnowledgeBindingnoThe 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_versionsarray of PinnedPolicynoThe 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.
promptPinnedPromptnoThe 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_atTimestampyes
published_byActorRefyes
source_revisionintegeryesThe draft revision this version was published from.
squad_versionsarray of PinnedSquadMembernoThe 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.
statusAgentVersionStatusyes
tool_bindingsarray of FrozenToolBindingnoThe 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.
toolsarray of PinnedToolnoThe 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.
versionintegeryesThe snapshot number, from 1.
warningsarray of ErrorDetailnoThe 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_versionPinnedWorkflownoThe 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.