> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replyke.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Messages

> Fetch messages in a conversation or thread

Returns a cursor-paginated list of [ChatMessage](/data-models/chat-message) objects. By default returns the main conversation stream (excludes thread replies). Pass `parentId` to fetch replies for a specific thread.

The caller must be a member. Former members (who left) can only read messages up to when they left.

## Path Parameters

<ParamField path="conversationId" type="string" required>
  The ID of the conversation.
</ParamField>

## Query Parameters

<ParamField query="parentId" type="string">
  If provided, returns thread replies to this message instead of the main stream.
</ParamField>

<ParamField query="before" type="string">
  ISO 8601 timestamp. Returns messages created before this time. Used for loading older messages. Mutually exclusive with `after`.
</ParamField>

<ParamField query="after" type="string">
  ISO 8601 timestamp. Returns messages created after this time. Used for loading newer messages. Mutually exclusive with `before`.
</ParamField>

<ParamField query="limit" type="number">
  Number of messages to return. Defaults to 50.
</ParamField>

<ParamField query="sort" type="string">
  Sort order: `asc` or `desc`. Defaults to `desc` for the main stream, `asc` for threads.
</ParamField>

<ParamField query="include" type="string">
  Comma-separated list of extra fields to include. Currently supports `files`. Example: `include=files`.
</ParamField>

## Response

<ResponseField name="messages" type="ChatMessage[]">
  Array of message objects. Each includes `reactionCounts`, `userReactions`, `user`, and `quotedMessage` fields. File attachments are included only when `include=files` is specified.
</ResponseField>

<ResponseField name="hasMore" type="boolean">
  Whether more messages exist in the requested direction.
</ResponseField>

<ResponseField name="oldestCreatedAt" type="string | null">
  ISO timestamp of the oldest message in this page. `null` if no messages were returned.
</ResponseField>

<ResponseField name="newestCreatedAt" type="string | null">
  ISO timestamp of the newest message in this page. `null` if no messages were returned.
</ResponseField>

## Error Responses

<AccordionGroup>
  <Accordion title="Forbidden — 403">
    ```json theme={null}
    { "error": "You are not a member of this conversation.", "code": "chat/not-a-member" }
    ```
  </Accordion>
</AccordionGroup>
