Hanzo AI
OpenapiAgent

Update agent

Changes an agent in place. Every field is optional; a field the request omits keeps its stored value.

PATCH /v1/agent/{ref}

Addresshttps://api.hanzo.ai/v1/agent/{ref}
MethodPATCH
Operationpatch_agent_by_ref
AuthAuthorization: Bearer $HANZO_API_KEY

Changes an agent in place. Every field is optional; a field the request omits keeps its stored value. The resulting mode+schedule are re-validated together, so a partial update can never leave a long-running agent without the cron the scheduler needs to fire it, and a transition INTO long-running counts against the per-org cap on scheduled agents.

Request

15 fields, body application/json (required).

FieldInTypeRequiredDescription
refpathstringyesRef is the agent to update — its public id or org-unique name, from the path.
avatarbodystringAvatar and Emoji re-draw the agent. Sending either replaces the pair, so setting an image clears a glyph and "" for both goes back to the initial — there is no…
cap_micro_usdbodyinteger (int64)The budget, any part of it.
computeRefbodystringComputeRef re-binds (or, with "", unbinds) the visor machine.
descriptionbodystringDescription replaces the line other agents read in the tool catalogue.
emojibodystringEmoji re-draws the agent as a glyph. Sending either of the pair replaces BOTH, so setting a glyph clears an image and "" for both goes back to the initial —…
executionModebodystringExecutionMode switches between one-shot and long-running.
instructionsbodystringInstructions replaces the system prompt whole, up to 32 KiB.
max_task_micro_usdbodyinteger (int64)MaxTaskMicroUSD is the ceiling for a single run, in micro-USD.
modelbodystringModel re-points the agent at another model, checked against the gateway's served catalogue exactly as create checks it.
periodbodystringPeriod is the window the cap resets on: day, week or month.
refbodystringRef is the agent to update — its public id or org-unique name, from the path.
schedulebodystringSchedule replaces the cron.
serviceAccountIdbodystringServiceAccountID re-points (or, with "", clears) the IAM service account a scheduled run is billed as.
toolsbodystring[]Tools replaces the whole allow-list, it does not add to it.

Response

StatusBodyMeaning
200agent.agentViewok
defaultproblem-detailsrefused

200 body — 19 fields.

FieldInTypeAlwaysDescription
avatarbodystringAvatar is an image the agent is drawn as — a link to one, or the bytes inline as a data URL, up to 96 KiB.
cap_micro_usdbodyinteger (int64)CapMicroUSD is the total this agent may spend within one Period, as an integer number of micro-USD (1,000,000 = $1).
computeRefbodystringComputeRef is the visor machine this bot is bound to, opaque here: this package stores and echoes it, and the binding's lifecycle belongs elsewhere.
consumed_micro_usdbodyinteger (int64)ConsumedMicroUSD is what has been spent in the current period, in micro-USD.
createdAtbodystringCreatedAt is when the agent was defined, RFC 3339 in UTC to the second.
descriptionbodystringDescription is the one line another agent reads when deciding whether to call this one: the tool catalogue publishes it as the description of agent_<name>,…
emojibodystringEmoji is the single glyph a caller picked when they had no image.
executionModebodystringExecutionMode is one-shot or long-running, and it decides who may start this agent.
idbodystringID is the agent's stable handle, minted here as "agent_" + 32 hex characters of crypto/rand.
max_task_micro_usdbodyinteger (int64)MaxTaskMicroUSD is the ceiling for a single run, in micro-USD.
modelbodystringModel is the Zen model this agent runs on, and it is always OUR name for it: writes normalize through cloud.ZenModel and the read normalizes again, so an…
namebodystringName is the agent's org-unique handle, matching ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$.
periodbodystringPeriod is the window the cap resets on: day, week or month.
runsbodyinteger (int64)Runs is how many executions the org has recorded against this agent, counted at read time.
schedulebodystringSchedule is the 5-field cron the scheduler fires a long-running agent on, evaluated once a minute.
serviceAccountIdbodystringServiceAccountID is the IAM agent service account (<org>-<agent>) a scheduled run is billed AS.
statusbodystringStatus is the agent's readiness, and today it is "ready" on every row: an agent is a definition rather than a provisioned thing, so nothing transitions it.
toolsbodystring[]Tools are the tool names this agent may call, and the list IS the authority: an agent that declares none gets none.
updatedAtbodystringUpdatedAt is the last time any field above was written, same format.

Failure carries the platform error shape — see Errors.

Examples

hanzo agent update <ref>

Agent API · All Hanzo APIs · Interactive reference

How is this guide?

On this page