Delete an agent
You can use this API to delete an agent based on the agent_id.
Path and HTTP methods
DELETE /_plugins/_agent/agents/<agent_id>
note
Agent, tool, and MCP APIs now use the preferred _plugins/_agent namespace. The legacy _plugins/_ml/... route still works for backward compatibility but is deprecated and will be removed in a future release.
Example request
DELETE /_plugins/_agent/agents/MzcIJX8BA7mbufL6DOwl
Example response
{
"_index" : ".plugins-ml-agent",
"_id" : "MzcIJX8BA7mbufL6DOwl",
"_version" : 2,
"result" : "deleted",
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"_seq_no" : 27,
"_primary_term" : 18
}