VocalDocscontracts 1.65.0

Update the Agent draft

PATCH /v1/agents/{agent_id}

PropertyValue
Operationupdate_agent
GroupAgents
Scopeagents:write
Route classcontrol
IdempotencyNo Idempotency-Key
AuditAudited agent.update (mutation)
Released in1.6.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Replaces the named fields of the draft at the revision If-Match names. From 1.63.0 evaluation_gate names the suite whose publish gate every activation of the Agent's versions must pass, or none; it is accepted from an owner in a Member session alone, and refused to every other Member and every API key with 403 forbidden and the detail owner_required; a suite that is not this Agent's, is archived or defines no gate is 422 validation_failed (AgentEvaluationGateIssueCode).

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 PATCH "$VOCAL_API/v1/agents/agt_..." \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"' \
  -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.

Request body

Content type application/json, required: AgentUpdateRequest.

FieldTypeRequiredDescription
configAgentConfigInputnoReplaces the whole draft configuration; validated like a create.
descriptionstring or nullnoA free-text description.
evaluation_gateAgentEvaluationGateInput or AgentEvaluationGateNonenoNames the gating suite, or none to turn the gate off (1.63.0). Accepted from an owner in a Member session alone (403 forbidden, the detail owner_required); a choice rather than null, so a client that dumps unset fields as null cannot turn the gate off by accident.
namestringnoA display name.

Responses

StatusContent typeShapeError codes
200application/jsonAgent
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
412application/jsonErrorEnveloperevision_mismatch
422application/jsonErrorEnvelopevalidation_failed, capability_not_available
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is Agent.

FieldTypeRequiredDescription
active_versioninteger or nullyesThe version new Calls run, or null when none is active.
configAgentConfigyes
created_atTimestampyes
descriptionstring or nullyesA free-text description.
evaluation_gateAgentEvaluationGate or nullnoThe publish gate the Agent's owner turned on (1.63.0); null when none. Absent from an api before 1.63.0, which a reader treats as null.
idAgentIdyes
latest_versioninteger or nullyesThe highest published version, or null before the first publish.
namestringyesA display name.
object"agent"yes
revisionintegeryesCounts writes to the draft; returned as the ETag and required in If-Match.
updated_atTimestampyes