Login / Register
GET
/api/public/v1/conversations/{conversationId}/messages

List messages in a conversation

Top-level messages, newest first. **Cursor-paginated, not offset-paginated**: a busy channel gains messages while you page, and an offset would hand you the same one twice. Pass the oldest id you received back as `before` (or its older name, `cursor`) to get the page before it; a null `nextCursor` means you have reached the start of the conversation. To read forward instead, pass `after` (a message id) or `unreadOnly=true`, which starts from the caller’s own `lastReadAt` — everything after it, including your own posts and system lines for context, or the whole conversation when nothing has been read. Those come back **oldest first** and `nextCursor` is the newest id to hand back as `after`. `unreadOnly` needs a membership, since that is where the read marker lives. `after` cannot be combined with `before`. Thread replies are not included. Each message carries `replyCount`, `lastReplyAt` and the caller’s `unreadReplyCount`; read the replies with the thread endpoint. `lastReadAt` in the response is the caller’s own conversation marker, or null. A public channel is readable by anyone in the company even without joining; a private one, a DM and a group need membership. An archived channel is readable only with `threads:admin`.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, and to a teammate under Employee → Permissions.

threads:read

Path Parameters

NameTypeRequiredDescription
conversationIdstringRequiredConversation ID.

Query Parameters

NameTypeRequiredDescription
beforestringOptionalA message id. Returns the page older than it, newest first.
cursorstringOptionalThe older name for `before`.
afterstringOptionalA message id. Returns the messages newer than it, oldest first.
unreadOnlybooleanOptionalStart from the caller’s `lastReadAt` and read forward, oldest first. Needs a membership.
limitnumberOptional1-100.Default: 30
GETExample request
curl
curl -X GET "https://www.pxb.app/api/public/v1/conversations/{conversationId}/messages" \
  -H "Authorization: Bearer your_access_token"
200Example response
json
{
  "message": "Messages retrieved successfully!",
  "content": {
    "messages": [
      {
        "id": "msg_9931",
        "conversationId": "cnv_5150",
        "authorEmployeeId": "emp_12ab",
        "parentMessageId": null,
        "content": "Deploying the billing export now — <@emp_44f1> heads up.",
        "type": "TEXT",
        "replyCount": 2,
        "lastReplyAt": "2026-08-29T18:22:00.000Z",
        "unreadReplyCount": 1,
        "editedAt": null,
        "deletedAt": null,
        "pinnedAt": null,
        "attachments": [],
        "reactions": [],
        "mentions": [
          {
            "employeeId": "emp_44f1"
          }
        ],
        "createdAt": "2026-08-29T18:10:00.000Z"
      }
    ],
    "nextCursor": "msg_9800",
    "hasMore": true,
    "order": "newest-first",
    "lastReadAt": "2026-08-29T17:58:00.000Z"
  }
}
403Example response
json
{
  "message": "You are not a member of this conversation."
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Threads
/threads
  1. Open a conversation from the sidebar.