Skip to content
Covo Developers

Reference

Delete an agent

Deletes an agent for good: its page, conversations, people, knowledge, links and short links, and frees its username.

RESTPOST /api/v1/agents/{agent_id}/delete
MCP tooldelete_agent
ClassificationSensitive write
Scopeagents:destroy
Minimum role on the agentowner
ConfirmationRequired: confirm: true, after the person agrees
Retry safetySafe to retry with the same input
Success status200

What it does

Deletes an agent for good: its page, conversations, people, knowledge, links and short links, and frees its username. This cannot be undone, and a workspace always keeps at least one agent. To take it off the web for a while instead, use unpublish_agent. Needs agents:destroy, a token for all agents, ownership of the workspace, and confirm: true after the person you work for agrees.

Side effects

Deletes the agent and everything it holds (page, conversations, people, knowledge, links, short links, Places and custom domains) for good, and frees its username. Cannot be undone.

Inputs

NameTypeRequiredInDescription
agent_idstringyespathThe agent id (agt_...), from list_agents.
confirmtruenobodySet to true after reviewing the effect with the person you work for. Required for destructive operations.

Example

REST
curl -X POST "https://covo.lanaai.io/api/v1/agents/agt_564e5e6bece6/delete" \
  -H "Authorization: Bearer $COVO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm":true}'
MCP (POST /mcp)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "delete_agent",
    "arguments": {
      "agent_id": "agt_564e5e6bece6",
      "confirm": true
    }
  }
}

Response

Returns an object with agent_id, username and deleted. This is a real response, shortened to two items per list.

200 response
{
  "agent_id": "agt_564e5e6bece6",
  "username": "avery-studio",
  "deleted": true
}

Over MCP the same object comes back as the tool result, in structuredContent and as JSON text.

Errors

StatusCodeMeaning
401unauthorizedNo token, or it is unknown, revoked or expired. OAuth apps refresh or reconnect.
403account_suspendedThe account that owns the token is paused.
403insufficient_scopeThe token lacks agents:destroy.
404agent_not_foundUnknown agent, or not reachable with this token.
400bad_requestAn input is invalid; field names it.
409confirmation_requiredReview the effect with the person you work for, then send confirm: true.
429rate_limitedWait Retry-After seconds.