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

Path Parameters

session_id
string
required
The ID of the session to delete

Response

success
boolean
Whether the request was successful
message
string
Success message

Important Notes

Deletion Restrictions: Sessions can only be deleted if they have not been started yet (status is created).Once a session is started (status is started or ended), it cannot be deleted. This is to preserve the session history and analytics data.

Behavior

  • Only sessions in created status can be deleted
  • The session is permanently removed from the database
  • Returns an error if the session has been started
  • Only the session owner can delete their own sessions
  • This action cannot be undone

Use Cases

  • Cancel a session that was created by mistake
  • Clean up pending sessions that are no longer needed
  • Remove test sessions before they’re started
{
  "success": true,
  "message": "Session deleted successfully"
}