Update the Agent draft
PATCH /v1/agents/{agent_id}
| Property | Value |
|---|---|
| Operation | update_agent |
| Group | Agents |
| Scope | agents:write |
| Route class | control |
| Idempotency | No Idempotency-Key |
| Audit | Audited agent.update (mutation) |
| Released in | 1.6.0 |
| Phase 0 host | Served (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 '{}'const response = await fetch(`${process.env.VOCAL_API}/v1/agents/agt_...`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'If-Match': '"1"',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
console.log(response.status, await response.text());import os
import requests
response = requests.patch(
f"{os.environ['VOCAL_API']}/v1/agents/agt_...",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"If-Match": '"1"',
},
json={},
)
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. |
if-match | header | string | yes | The revision the change was made against, quoted as the ETag returns it, or * to overwrite. |
Request body
Content type application/json, required: AgentUpdateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
config | AgentConfigInput | no | Replaces the whole draft configuration; validated like a create. |
description | string or null | no | A free-text description. |
evaluation_gate | AgentEvaluationGateInput or AgentEvaluationGateNone | no | Names 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. |
name | string | no | A display name. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | Agent | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
412 | application/json | ErrorEnvelope | revision_mismatch |
422 | application/json | ErrorEnvelope | validation_failed, capability_not_available |
428 | application/json | ErrorEnvelope | precondition_required |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is Agent.
| Field | Type | Required | Description |
|---|---|---|---|
active_version | integer or null | yes | The version new Calls run, or null when none is active. |
config | AgentConfig | yes | |
created_at | Timestamp | yes | |
description | string or null | yes | A free-text description. |
evaluation_gate | AgentEvaluationGate or null | no | The 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. |
id | AgentId | yes | |
latest_version | integer or null | yes | The highest published version, or null before the first publish. |
name | string | yes | A display name. |
object | "agent" | yes | |
revision | integer | yes | Counts writes to the draft; returned as the ETag and required in If-Match. |
updated_at | Timestamp | yes |