Agents
Delete an agent
Delete an agent from your catalog by name.
DELETE
/
api
/
v2
/
agents
/
{agent_name}
from hai_agents import Client
client = Client()
client.agents.delete_agent(agent_name="my-research-bot")
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
await client.agents.deleteAgent({ agentName: "my-research-bot" });
curl -X DELETE https://agp.eu.hcompany.ai/api/v2/agents/my-research-bot \
-H "Authorization: Bearer $HAI_API_KEY"
Behavior
Its revisions go too. Running sessions are unaffected; new ones cannot reference it.Headers
string
The
ETag of the revision you expect to delete, for example "3". If the agent has moved past it, the delete fails with 412. Omit it, or send *, to delete regardless.Path parameters
string
required
The agent’s
name, for example my-research-bot or myorg/web-helper.Response
204 No Content.
from hai_agents import Client
client = Client()
client.agents.delete_agent(agent_name="my-research-bot")
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
await client.agents.deleteAgent({ agentName: "my-research-bot" });
curl -X DELETE https://agp.eu.hcompany.ai/api/v2/agents/my-research-bot \
-H "Authorization: Bearer $HAI_API_KEY"
Errors
| Status | Cause |
|---|---|
400 | If-Match is not a single revision tag. |
403 | The agent is reserved (h/) and read-only. |
404 | Not found, or not in your organization. |
412 | If-Match names a revision that isn’t the current one. The ETag header has the current one. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
client.agents.delete_agent(agent_name="my-research-bot")
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
await client.agents.deleteAgent({ agentName: "my-research-bot" });
curl -X DELETE https://agp.eu.hcompany.ai/api/v2/agents/my-research-bot \
-H "Authorization: Bearer $HAI_API_KEY"