Change an agent
const url = 'https://api.asklucy.eu/v1/agents/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","description":"example","instructions":"example","model":"example","tools":{"web_search":false,"sandbox":false,"memory":"off","connectors":["m365.mail"]},"limits":{"max_steps":30,"max_minutes":15},"enabled":true}'};
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://api.asklucy.eu/v1/agents/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "description": "example", "instructions": "example", "model": "example", "tools": { "web_search": false, "sandbox": false, "memory": "off", "connectors": [ "m365.mail" ] }, "limits": { "max_steps": 30, "max_minutes": 15 }, "enabled": true }'A change to its configuration (name, description, instructions,
model, tools, limits) saves a new version; runs keep the version
they started with. enabled alone doesn’t make a version. An agent
an admin disabled can’t be enabled here (409
…/errors/agent-disabled-by-admin).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”The identity can’t change.
object
What a run may use, besides the tools of the agent’s own connections
(listAgentConnectors, listAgentToolPermissions). Never available
to agents: tools on people’s computers (local).
object
Only while the organization lets the agent’s identity use web search (the owner’s can_web_search; for service agents, web_search not off).
Run code and write files in Lucy’s sandbox (when the contract includes it).
Lucy Memory, when it is on for the identity: the owner’s memory
(owner), or the agent’s own and the organization’s shared
memory (service). read recalls and searches; read_write
also lets the run remember new facts.
Ignored, and always empty in answers: an agent uses its own
connections (listAgentConnectors) with its own tool
permissions (listAgentToolPermissions), never its owner’s.
Accepted so older clients can still save an agent.
object
Tool calls per run. At the limit Lucy stops using tools and writes the answer with what she has.
Wall-clock time per run, queueing excluded. At the limit the run ends failed (error.code time_limit).
Responses
Section titled “Responses”OK
object
Whom the agent acts as.
owner: its creator, with exactly their access (their memory, their Microsoft 365, their quotas). Its runs are their conversations: they can read and continue them as themselves.service: itself (its ID is its principal). It reaches only what it was given: its knowledge files and the tools below, never anyone’s Microsoft 365. Only org_admins create and see service agents; their runs are read-only.
The person an owner agent acts as (its creator). Null for service agents.
object
Zitadel user ID.
service is a customer system’s Zitadel service user; agent is a service agent (its ID is the agt_ ID), the author of its runs’ messages.
The current version (listAgentVersions).
What the agent does, in its own words. Lucy follows them in every run, after the organization’s instructions.
A Model.id while the identity may choose models; null is Auto.
What a run may use, besides the tools of the agent’s own connections
(listAgentConnectors, listAgentToolPermissions). Never available
to agents: tools on people’s computers (local).
object
Only while the organization lets the agent’s identity use web search (the owner’s can_web_search; for service agents, web_search not off).
Run code and write files in Lucy’s sandbox (when the contract includes it).
Lucy Memory, when it is on for the identity: the owner’s memory
(owner), or the agent’s own and the organization’s shared
memory (service). read recalls and searches; read_write
also lets the run remember new facts.
Ignored, and always empty in answers: an agent uses its own
connections (listAgentConnectors) with its own tool
permissions (listAgentToolPermissions), never its owner’s.
Accepted so older clients can still save an agent.
object
Only on getAgentFile for ready files; valid a few minutes.
object
Tool calls per run. At the limit Lucy stops using tools and writes the answer with what she has.
Wall-clock time per run, queueing excluded. At the limit the run ends failed (error.code time_limit).
Whether it can run now (manual runs and its triggers). See disabled_reason.
Why it can’t run: its owner (or a service agent’s admins) turned
it off, an org_admin disabled it (updateOrgAgent), its owner
was removed from the organization, or it was deleted.
How many triggers it has.
Example
{ "id": "agt_3Hq9ZtWk2pLm7Rx0aBcD", "identity": "owner", "created_by": { "kind": "person" }, "tools": { "web_search": false, "sandbox": false, "memory": "off", "connectors": [ "m365.mail" ] }, "knowledge_files": [ { "id": "file_8bQ2nVx", "status": "pending", "created_by": { "kind": "person" } } ], "limits": { "max_steps": 30, "max_minutes": 15 }, "disabled_reason": "owner", "last_run": { "status": "queued" }}The request is invalid; errors lists what’s wrong.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
Missing, expired or invalid token.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
The token is valid but lacks the role this needs.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
No such object in your organization.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
The object isn’t in a state that allows this (e.g. Lucy is already answering).
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.