Skip to main content
Version: 2.0

Delete Agent API Definition

The Delete Agent API enables you to permanently remove an AI agent and its configuration from the Vectara platform, supporting agent lifecycle management and resource cleanup in enterprise environments. This API enforces safety constraints by preventing deletion of agents with active sessions, ensuring that ongoing conversations are not disrupted by administrative actions.

Organizations use this API for decommissioning outdated agents, cleaning up development and testing environments, removing agents that are no longer needed, and maintaining organized agent inventories as their AI deployments evolve. The permanent nature of deletion makes this API critical for environments where data governance and resource management are essential.

Delete Agent Request and Response

To delete an agent, send a DELETE request to /v2/agents/{agent_id}. You specify the following parameter in the URL path:

  • agent_id (string, required): Unique agent identifier following the pattern agt_[0-9a-zA-Z_-]+$

The response returns HTTP status 204 (No Content) on successful deletion with no response body, or an error response if the deletion cannot be completed due to active sessions or other constraints.

Example Request

DELETE /v2/agents/agt_customer_support_001

Example Response

HTTP/1.1 204 No Content

Error Responses

The API returns standard HTTP error codes with detailed error information:

HTTP CodeError CodeDescription
400invalid_requestInvalid agent_id format or malformed request
401unauthorizedInvalid or missing API key
403forbiddenInsufficient permissions for deleting this agent
404agent_not_foundAgent with the specified ID does not exist
409agent_in_useCannot delete agent with active sessions
429rate_limit_exceededRequest rate limit exceeded