Skip to main content
Version: 2.0

Delete Agent Session API Definition

The Delete Agent Session API enables you to permanently remove a conversational session and all its associated events and interaction history from the Vectara platform. This API supports session lifecycle management, privacy compliance, and resource cleanup by providing controlled deletion capabilities for completed or inactive conversations.

Organizations use this API to comply with data retention policies, clean up test and development sessions, remove sensitive conversations upon customer request, and maintain organized session inventories by removing completed interactions that are no longer needed for operational or analytical purposes.

Delete Agent Session Request and Response

To delete an agent session, send a DELETE request to /v2/agents/{agent_key}/sessions/{session_key}. You specify the following parameters in the URL path:

  • agent_key (string, required): Agent identifier following the pattern agt_[0-9a-zA-Z_-]+$
  • session_key (string, required): Session identifier following the pattern ase_[0-9a-zA-Z_-]+$

The response returns HTTP status 204 (No Content) on successful deletion with no response body, indicating that the session and all associated events have been permanently removed from the system.

Example Request

DELETE /v2/agents/agt_customer_support/sessions/ase_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_key or session_key format
401unauthorizedInvalid or missing API key
403forbiddenInsufficient permissions for deleting this session
404agent_not_foundAgent with the specified agent_key does not exist
404session_not_foundSession with the specified session_key does not exist
429rate_limit_exceededRequest rate limit exceeded