Delete a saved agent.

DELETE/o/{org}/agents/{agent}
View .md

The agent starts no new session and is no longer listed or readable. Sessions already started from it run to the end. Only the creator can delete, or an org admin once the creator has left the org (with If-Match optional, even for an agent the admin cannot see). If-Match is optional for an API key, as on an edit. Deleting an agent made from a template disconnects every account connected to it. A Google account and an MCP server with a revoke endpoint are revoked at the vendor first, unless another of your live agents or your own account holds the same Google account. A connection whose revoke did not go through stays stored, still answered 200, until a later DELETE of the agent by its id (a name reaches only a live agent) or Rush's operator sweep revokes it; no run of the agent can use it meanwhile. A template that agents are still made from is 409 TEMPLATE_IN_USE, with their count in agents, and an agent that automations run on is 409 AGENT_IN_USE, with their count in automations.

Authenticate with a signed-in session token (an API key cannot call this route).

Path parameters

orgstringrequired

The org's slug or id. A caller with no role in the org gets 404.

agentstringrequired

The saved agent's id, or its exact name (a plain agent or one made from a template). Two agents of that name are 422 INVALID_BODY; send the id. available and community are paths beside this one, so no agent may be named either. An archived agent, and an orphaned agent an org admin cannot see, are reached by id only.

Headers

if-matchstringoptional

The ETag of the revision you read; another revision is 412 STALE_ETAG.

Responses

200The agent is deleted.
idstringrequired
Format uuid
deletedbooleanrequired
One oftrue
401No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
403A visible agent belongs to another creator (FORBIDDEN).
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
404No such agent visible to you, or one already deleted (NOT_FOUND).
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
409Agents are still made from this template (TEMPLATE_IN_USE), or automations run on this agent (AGENT_IN_USE); move or delete them first.
agentsintegeroptional

How many agents are made from the template.

automationsintegeroptional

How many automations run on the agent.

errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
412A concurrent edit won (STALE_ETAG); read the agent and delete it again.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
428A signed-in caller sent no If-Match (IF_MATCH_REQUIRED).
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
429The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED).

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED). The error names the limit. Wait Retry-After seconds.

errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional