DELETE
/
api
/
messaging
/
sessions
/
{sessionId}
End a session
curl --request DELETE \
  --url http://localhost:3000/api/messaging/sessions/{sessionId}
// 404 - Session not found
{
  "error": "Session not found",
  "code": "SESSION_NOT_FOUND",
  "details": {
    "sessionId": "abc-123"
  }
}
This endpoint immediately ends a session regardless of its timeout configuration. The session is removed from memory but the underlying channel and messages are preserved for historical reference.

Path Parameters

sessionId
string
required
The unique identifier of the session to delete

Response

success
boolean
Whether the session was successfully deleted
message
string
Confirmation message with the session ID

Example Response

{
  "success": true,
  "message": "Session abc-123-def-456 deleted successfully"
}

Error Responses

// 404 - Session not found
{
  "error": "Session not found",
  "code": "SESSION_NOT_FOUND",
  "details": {
    "sessionId": "abc-123"
  }
}

Important Notes

  • Deleting a session does not delete the conversation history
  • The underlying channel and messages remain in the database
  • Active WebSocket connections for the session will be terminated
  • Any pending operations on the session will fail after deletion

Path Parameters

sessionId
string
required

ID of the session to end

Response

Session ended successfully

message
string
Example:

"Session ended successfully"