Skip to content

Mark Messages as Read

Mark all messages in a session as read. Works for both stores and admins.

Endpoint

POST /v1/chat/message/read/

Authentication

Required: Admin or Store authentication token

Authorization: Token <your_token>

Request Body

{
  "session_id": 1
}

Parameters

Field Type Required Description
session_id integer Yes ID of the session to mark messages as read

Response

Success (200 OK)

{
  "status": "ok"
}

Error Responses

Missing Session ID (400)

{
  "error": "session_id is required"
}

Session Not Found (404)

{
  "error": "Session not found"
}

Forbidden (403)

{
  "error": "Forbidden"
}

or

{
  "error": "Session belongs to another admin"
}

Unauthorized (401)

{
  "error": "Unauthorized"
}

Example Request

curl -X POST "https://api.luxmart.site/v1/chat/message/read/" \
  -H "Authorization: Token your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": 1
  }'

Notes

  • For Stores: Can only mark messages as read in their own sessions
  • For Admins: Can only mark messages as read in sessions assigned to them
  • Marks all messages in the session as read (updates message status)
  • Sends WebSocket event to notify the other party that messages were read
  • Message read status is used to show read receipts in the chat interface