Skip to main content
DELETE
https://jwhite.tail8bf327.ts.net
/
api
/
v1
/
sessions
/
{id}
Delete Session
curl --request DELETE \
  --url https://jwhite.tail8bf327.ts.net/api/v1/sessions/{id} \
  --header 'x-api-key: <api-key>'
{
  "success": true,
  "message": "Session deleted successfully"
}

Authentication

Requires API key authentication (x-api-key header).
x-api-key: ah_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Path Parameters

id
integer
required
The session ID to delete

Request

DELETE https://jwhite.tail8bf327.ts.net/api/v1/sessions/456
x-api-key: ah_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Response

{
  "success": true,
  "message": "Session deleted successfully"
}
{
  "success": false,
  "error": "Session not found or access denied"
}

Notes

  • You must own the session to delete it (user_id must match authenticated user)
  • Deleting a session will update the parent agent’s session statistics
  • The agent’s total_sessions count will be decremented
  • The agent’s avg_duration will be recalculated without this session
  • This action is permanent and cannot be undone
  • Session transcript and metadata will be permanently deleted

Use Cases

  • Data Cleanup: Remove test or development sessions
  • Privacy: Delete sessions containing sensitive information
  • Error Correction: Remove sessions that were created in error
  • Data Management: Keep session lists clean and relevant

Error Responses

For information about error responses and status codes, see Error Responses.

Common Errors for This Endpoint

  • 401 Unauthorized - Invalid or missing API key
  • 404 Not Found - Session not found or not owned by user
  • 500 Internal Server Error - Server error