Close Chat Session
Close an active chat session. Only admins can close sessions they have claimed.
Endpoint
Authentication
Required: Admin authentication token
Request Body
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
session_id |
integer | Yes | ID of the session to close |
Response
Success (200 OK)
Returns the closed session object.
{
"id": 1,
"store_id": 5,
"admin_id": 2,
"status": "closed",
"last_message_at": "2025-12-16T10:30:00Z",
"closed_at": "2025-12-16T11:00:00Z",
"created": "2025-12-16T10:00:00Z",
"updated": "2025-12-16T11:00:00Z"
}
Error Responses
Missing Session ID (400)
Session Not Found or Not Assigned (403)
Session Already Closed (400)
Unauthorized (401)
Example Request
curl -X POST "https://api.luxmart.site/v1/chat/admin/close/" \
-H "Authorization: Token your_admin_token" \
-H "Content-Type: application/json" \
-d '{
"session_id": 1
}'
Notes
- Only admins can close sessions
- Admin must have claimed the session (session must be assigned to them)
- Closing a session sets status to
"closed"and recordsclosed_attimestamp - WebSocket events are sent to both the store and all admins when a session is closed
- Once closed, a session cannot be reopened (a new session must be created)