List Messages
Overview
Retrieve a paginated list of messages for a conversation - for the main chat thread, message history, and scroll-back inside the messaging UI.
Each item includes sender info, content, delivery status, read receipts, reactions, pin/star flags for the signed-in user, and soft-delete metadata so you can render bubbles, system events, and action menus without extra round-trips.
When to use this endpoint?
Use List Messages when:
- Opening a conversation thread and loading the initial message history.
- Paginating older messages as the user scrolls up (infinite scroll / load-more).
- Refreshing the thread after reconnect or when returning to an active chat.
- Hydrating message state before merging real-time socket updates.
Part of the Chat Messages APIs for the chat package/SDK (not Platform → Messages). Requires a chat user Access Token for the signed-in messaging participant.
Response Data
Each item in data.list typically includes:
data.pagination includes currentPage, totalCount, hasNextPage, hasPreviousPage, and pageSize. Increment page while hasNextPage is true to load older messages.
{baseUrl}/api/{apiVersion}/message/get-all-from-conversation?conversationId={conversationId}&page=1&limit=10&sort=createdAt&sortType=desc- Authentication
- Required (Bearer token)
- Tenant-scoped
- Yes (tenant DB - requires x-client-id)
Request Headers
Query Parameters
Success Response (HTTP 200 OK)
On success, the API returns list and pagination. Bind list to your message list; use isLoggedUserStarred and isPinnedMessage for per-row UI state.
{ "success": true, "message": "Messages fetched successfully", "data": { "list": [ { "_id": "69b13009db7dd594ba0144f5", "conversationId": "69b12d08db7dd594ba013ebc", "sender": { "_id": "69a91733afd8cb7180a63fb2", "name": "chat2" }, "isSystemMessage": false, "content": "fgfg", "type": "text", "isEdited": false, "isForwarded": false, "status": "read", "readBy": [ { "_id": "69a5546ff54a9af3316020c9", "name": "chat1" }, { "_id": "69aaad3304c46f7cacc7a7a9", "name": "chat3" } ], "starredBy": [], "deletedFor": [], "isDeletedForEveryone": false, "reactions": [], "createdAt": "2026-03-11T09:04:09.578Z", "updatedAt": "2026-03-12T06:25:30.975Z", "__v": 0, "isLoggedUserStarred": false, "isPinnedMessage": false }, { "_id": "69b13150db7dd594ba01462e", "conversationId": "69b12d08db7dd594ba013ebc", "sender": { "_id": "69a91733afd8cb7180a63fb2", "name": "chat2" }, "isSystemMessage": false, "content": "fgfg", "type": "text", "isEdited": false, "isForwarded": false, "status": "read", "readBy": [ { "_id": "69a5546ff54a9af3316020c9", "name": "chat1" }, { "_id": "69aaad3304c46f7cacc7a7a9", "name": "chat3" } ], "starredBy": [], "deletedFor": [], "isDeletedForEveryone": false, "reactions": [], "createdAt": "2026-03-11T09:09:36.032Z", "updatedAt": "2026-03-12T06:25:30.975Z", "__v": 0, "isLoggedUserStarred": false, "isPinnedMessage": false }, ], "pagination": { "currentPage": 1, "totalCount": 13, "hasNextPage": true, "hasPreviousPage": false, "pageSize": 10 } }, "error": null}Common Errors
List fails when the token is missing, the user is not a participant, or the conversation does not exist in this tenant.
HTTP 401 Unauthorized - No token
{ "success": false, "message": "No token, authorization denied", "data": null, "error": "Unauthorized"}HTTP 403 Forbidden - Access denied
{ "success": false, "message": "Access denied: insufficient permissions", "data": null, "error": null}HTTP 404 Not Found - Conversation not found
{ "success": false, "message": "Conversation not found", "data": null, "error": null}Best Practices
- Load page 1 with
sortType=descon thread open; fetch the next page when the user scrolls to the top for infinite scroll of older messages. - Merge list results with real-time socket events (new message, edit, delete, reaction) instead of refetching the full thread on every event.
- Respect
isDeletedForEveryoneanddeletedForbefore rendering content - hide or show placeholders per user. - Use
isSystemMessageto render join/leave and group events inline without treating them as user sends. - Always send tenant headers with the chat user Bearer token over HTTPS.
Thread ready
Bind the list to your chat thread. Use Pinned Messages, Starred Messages, or message search endpoints next for pinned banners, starred screens, and in-thread search.