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

# List Messages

> Fetch messages in a conversation or thread

export const SpaceReputationParams = ({variant = "context", field = "path"}) => {
  const isUser = variant === "user";
  return <>
      <ParamField {...{
    [field]: "spaceReputation",
    type: "object"
  }}>
        Opt-in. Adds a <code>spaceReputation</code> number to each returned user,
        scoped to a single space. Requires the <code>reputation</code> bundle.
        The <code>reputation</code> total is always present regardless;{" "}
        <code>spaceReputation</code> is purely additive and only appears when you
        pass this object. <strong>This object is the primary form</strong> — it
        replaces the deprecated flat props below. See the{" "}
        <a href="/v8/data-models/reputation">Reputation data model</a> for the
        full contract.

        <Expandable title="spaceReputation">
          {isUser ? <ParamField name="spaceId" type="string | &quot;none&quot;" required>
              Which bucket to read. A space <strong><code>&lt;uuid&gt;</code></strong> reads that
              space's bucket; <strong><code>"none"</code></strong> reads the
              project-general (space-less) bucket.{" "}
              <strong><code>"context"</code> is rejected (400)</strong> on this
              endpoint — there is no space context to derive. The empty string
              and the legacy <code>general</code> / <code>null</code> aliases are
              also rejected. Missing buckets read as <code>0</code>.
            </ParamField> : <ParamField name="spaceId" type="string | &quot;none&quot; | &quot;context&quot;" required>
              Which bucket to read. One of: a space <strong><code>&lt;uuid&gt;</code></strong>{" "}
              (that space's bucket), <strong><code>"none"</code></strong> (the
              project-general, space-less bucket), or{" "}
              <strong><code>"context"</code></strong> (the space derived from the
              request context — resolved per-row on lists, or the single space on
              member/team/conversation surfaces). The empty string and the legacy{" "}
              <code>general</code> / <code>null</code> aliases are rejected (400).
              Missing buckets read as <code>0</code>.
            </ParamField>}
          <ParamField name="includeDescendants" type="boolean">
            Only honored when <code>spaceId</code> is an explicit space <code>&lt;uuid&gt;</code>.
            When <code>true</code>, <code>spaceReputation</code> is the{" "}
            <strong>subtree sum</strong> — the named space plus all of its
            descendant spaces (the root space's own bucket included). Ignored for{" "}
            <code>"none"</code>; not allowed with <code>"context"</code>.
          </ParamField>
        </Expandable>
      </ParamField>

      {isUser ? <ParamField {...{
    [field]: "spaceReputationId",
    type: "string",
    deprecated: true
  }}>
          <strong>Deprecated</strong> — use the <code>spaceReputation</code>{" "}
          object instead. The flat form of <code>spaceReputation.spaceId</code>.
          Still accepted (the object wins if both are passed); removal is a later
          major version. Accepts a space <code>&lt;uuid&gt;</code> or <code>"none"</code> only —{" "}
          <code>"context"</code> is rejected (400) on this endpoint.
        </ParamField> : <ParamField {...{
    [field]: "spaceReputationId",
    type: "string",
    deprecated: true
  }}>
          <strong>Deprecated</strong> — use the <code>spaceReputation</code>{" "}
          object instead. The flat form of <code>spaceReputation.spaceId</code>.
          Still accepted (the object wins if both are passed); removal is a later
          major version. Accepts a space <code>&lt;uuid&gt;</code>, <code>"none"</code>, or{" "}
          <code>"context"</code>.
        </ParamField>}

      <ParamField {...{
    [field]: "spaceReputationDescendants",
    type: "boolean",
    deprecated: true
  }}>
        <strong>Deprecated</strong> — use{" "}
        <code>spaceReputation.includeDescendants</code> instead. The flat form,
        only honored alongside an explicit <code>spaceReputationId</code> <code>&lt;uuid&gt;</code>.
      </ParamField>
    </>;
};

Returns a cursor-paginated list of [ChatMessage](/v8/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: `files` (attachments) and `grants` (the [reputation-grant summary](/v8/data-models/reputation-grant#grantsummary)). Combine them as `include=files,grants`.
</ParamField>

<ParamField query="filters" type="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`).

  <Note>Threads are one level deep — a reply can never have its own replies. So `filters[hasReplies]=true` combined with `parentId` always returns an empty list; the response includes a `notice` field explaining why.</Note>
</ParamField>

### 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](/v8/data-models/reputation) for the full contract.

<SpaceReputationParams variant="context" field="query" />

## 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>

<ResponseField name="notice" type="string">
  Present only when a filter combination can't return results — e.g. `hasReplies: true` together with `parentId`. Explains why the list is empty.
</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>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.