Skip to main content
List Messages
Returns a cursor-paginated list of ChatMessage objects. By default returns the main conversation stream (excludes thread replies). Pass parentMessageId to fetch replies for a specific thread. Deleted and removed messages stay in the list as placeholders, in their place: a removed message is shown in full to its author. See Deleted and removed messages. Pages are anchored on a message: pass the id of the first or last message you hold as before or after to get the messages next to it. See Paging. The caller must be a member. Former members (who left) can only read messages up to when they left. In a space chat, the caller must also be an active member of the chat’s space and able to see it (visibility). Anyone else, including a pending, rejected or banned member and someone who left or was removed from the space, gets 403 chat/not-a-member, as a non-member does, even while they still hold a conversation membership. Deleting their own messages, leaving the conversation and muting it stay allowed: they need the conversation membership and sight of the space, not an active space membership. A former member of the space keeps no access to the history.

Path Parameters

string
required
The ID of the conversation.

Query Parameters

string
If provided, returns thread replies to this message instead of the main stream. Named like the message’s own parentMessageId field (and like sending a reply).
string
A message id. Returns the limit messages just before that message. Used for loading older messages: pass the oldest message you hold. Mutually exclusive with after. See Paging.
string
A message id. Returns the limit messages just after that message. Used for loading newer messages: pass the newest message you hold. Mutually exclusive with before. See Paging.
number
Number of messages to return, from 1 to 100. Defaults to 50.
string
The order of the messages in data, by creation time: asc or desc (either case). Defaults to desc for the main stream, asc for threads. With before or after it only orders the page; which messages are in it is decided by the anchor.
string
Extra fields to include, as a comma-separated value (include=files,grants) or repeated params. Values:
  • files — the message’s images and files, images with their variants
  • grants — the reputation-grant summary for each message
Matching ignores case. An unknown value returns 400 chat/invalid-query.
object
Optional filters object, serialized as bracket-notation query params (e.g. filters[hasReplies]=true).
  • hasReplies (boolean) — When true, returns only messages that have thread replies (threadReplyCount > 0). When false, returns only messages with no thread replies. This filters by thread replies, not quotings (quotedMessageId).
Threads are one level deep — a reply can never have its own replies. So filters[hasReplies]=true combined with parentMessageId always returns an empty list; the response includes a notice field explaining why.
string
Service key only, and required with one: the user this request acts as. Must be a member of the conversation. The response is what that user’s own access token would get, moderation details (moderationReason, moderatedById, moderatedByType) included only where that user may see them. A user token always acts as its own user and must not send it (400 chat/acting-user-not-allowed).

Paging

A message’s position is its createdAt, then its id for messages created at the same moment, so every message has exactly one place in the list and no page boundary skips or repeats one.
  • No before or after: with sortDir=desc (the main stream’s default), the newest limit messages; with asc (a thread’s default), the oldest limit.
  • before=<id>: the limit messages nearest that message on the older side. pagination.hasMore says whether there are older ones still.
  • after=<id>: the limit messages nearest that message on the newer side. pagination.hasMore says whether there are newer ones still.
The anchor itself is never in the page. To keep going, pass the message at the far end of the page: for older messages the oldest one in data (its last item with desc), for newer ones the newest (its last item with asc). The anchor must be a message of this conversation at the same thread level as the request: a top-level message when parentMessageId is left out, a reply to that same message when it is sent. A deleted or moderated message is still a valid anchor. Anything else, such as an id that isn’t a message, a message of another conversation or a reply from a different thread, returns 400 chat/invalid-cursor with param naming before or after. If the message you paged from is gone, start again without an anchor. A former member only gets messages from before they left, whatever the anchor.

Space-scoped reputation

This endpoint has a space in context, so it accepts the opt-in reputation params. They add a spaceReputation field to each message sender’s user, alongside the always-present reputation total. Requires the reputation bundle. See the Reputation data model for the full contract.

Response

ChatMessage[]
The page of messages, in sortDir order. Each includes reactionCounts, userReactions, user, and quotedMessage fields. File attachments are included only when include=files is specified.
object
string
Present only when a filter combination can’t return results — e.g. hasReplies: true together with parentMessageId. Explains why the list is empty.

Error Responses

A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
Returned when a service key names an actingUserId that isn’t a user in this project.
The request sent userId. On this route the user a service key acts as is actingUserId.With a service key:
With a user token, or with no credentials:
The request sent parentId. A thread’s replies are listed with parentMessageId.
A service key sent no actingUserId.
before or after isn’t a message of this conversation at the request’s thread level. param names the one sent.
For example sortDir other than asc/desc, both before and after, a limit outside 1–100, sort (not accepted; use sortDir), or an unknown include value. error starts with the field name.