Update an agent
const url = 'https://example.com/v1/agents/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","description":"example","tags":["example"],"metadata":{},"upstream_url":"https://example.com","credential_ref":"example","suspended":true,"invocation_rate_limit":1,"invocation_burst":1,"emit_receipts":true,"capture_body":true,"protocol":"http","mcp_transport":"streamable_http","mcp_protocol_version":"example","pricing":{"amount":"example","asset":"USDC","network":"base","pay_to":"example","tools":{"additionalProperty":"example"}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/v1/agents/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "description": "example", "tags": [ "example" ], "metadata": {}, "upstream_url": "https://example.com", "credential_ref": "example", "suspended": true, "invocation_rate_limit": 1, "invocation_burst": 1, "emit_receipts": true, "capture_body": true, "protocol": "http", "mcp_transport": "streamable_http", "mcp_protocol_version": "example", "pricing": { "amount": "example", "asset": "USDC", "network": "base", "pay_to": "example", "tools": { "additionalProperty": "example" } } }'Partial update. Only client-settable fields are accepted; id, status, created_by, and timestamps are immutable. Several fields are tri-state (absent key = leave unchanged, null = clear, a value = set) — see each field’s description.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The agt_<uuidv7> agent ID.
Request Bodyrequired
Section titled “Request Bodyrequired”Partial update (PATCH). Fields documented “tri-state” accept: an absent key (leave unchanged), an explicit null (clear the field), or a value (set it). Other fields are simple “absent leaves unchanged, a value sets it” toggles — they have no clear semantics.
object
Absent leaves unchanged. Must not be empty when present.
Absent leaves unchanged.
Absent leaves unchanged.
Absent leaves unchanged.
object
Tri-state. Same SSRF hygiene as create. Setting/clearing this also re-derives status.
Tri-state.
Absent leaves unchanged.
Tri-state. Must be greater than zero when set to a value.
Tri-state. Must be at least 1 when set to a value.
Absent leaves unchanged.
Absent leaves unchanged.
Absent leaves unchanged. Validated against the resulting mcp_transport/pricing combination.
Tri-state.
Tri-state.
Tri-state — null unprices the agent.
object
Flat per-call price, smallest-unit decimal string.
V1 accepts only “USDC”.
V1 accepts only “base”.
Operator payout address (the gateway holds no key).
Optional per-MCP-tool price overrides, keyed by tool name. Requires the agent’s protocol to be mcp.
object
Responses
Section titled “Responses”The updated agent.
object
The agt_<uuidv7> resource ID.
object
Derived from upstream_url — pending when absent, active once set; inactive after a delete.
A suspended agent stays in the catalog but rejects invocations.
The subject claim of the user who created the agent.
The credential ID injected into upstream calls.
Per-agent requests/second override (spec 0002).
Token-bucket burst depth; defaults to 20 when only the rate is set.
Whether a Treeship trust receipt is emitted after each completed invocation.
Whether request/response bodies are captured on invocations (spec 0003).
Required and validated only when protocol=mcp (spec 0004).
object
Flat per-call price, smallest-unit decimal string.
V1 accepts only “USDC”.
V1 accepts only “base”.
Operator payout address (the gateway holds no key).
Optional per-MCP-tool price overrides, keyed by tool name. Requires the agent’s protocol to be mcp.
object
Example
{ "status": "pending", "protocol": "http", "mcp_transport": "streamable_http", "pricing": { "asset": "USDC", "network": "base" }}Invalid body or an invalid resulting protocol/mcp/pricing combination.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}Missing or invalid bearer token, or the token’s tenant/user claims are absent. No body.
No resource with this ID exists in the caller’s tenant.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}The new name conflicts with another active or pending agent in the tenant.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}An unexpected server-side error. No body (internal detail is never returned to callers, invariant