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

# Get thread detail with a page of messages

> Returns thread metadata, participants, and the MOST RECENT page of
messages — not the whole thread.

`limit` (1-2000, default 500) sizes the page; `before_seq` walks
backwards from a known seq to fetch older messages. Paging is by
cursor rather than offset because the stale-message reconcile
reassigns `seq`, so an offset over this table skips and repeats rows.

The response carries `message_total`, a COUNT over the whole thread,
and `has_older`. `message_total` is NOT `messages.length`: a total
derived from the page agrees with itself and would report a truncated
thread as complete.

Requires participant membership or admin role.




## OpenAPI

````yaml /ai-app/openapi.yaml get /chat/threads/{id}
openapi: 3.0.3
info:
  title: Hill90 API
  description: Hill90 platform API — agent management and lifecycle operations.
  version: 0.1.0
servers:
  - url: /
    description: Relative (behind Traefik reverse proxy)
security: []
paths:
  /chat/threads/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    get:
      summary: Get thread detail with a page of messages
      description: |
        Returns thread metadata, participants, and the MOST RECENT page of
        messages — not the whole thread.

        `limit` (1-2000, default 500) sizes the page; `before_seq` walks
        backwards from a known seq to fetch older messages. Paging is by
        cursor rather than offset because the stale-message reconcile
        reassigns `seq`, so an offset over this table skips and repeats rows.

        The response carries `message_total`, a COUNT over the whole thread,
        and `has_older`. `message_total` is NOT `messages.length`: a total
        derived from the page agrees with itself and would report a truncated
        thread as complete.

        Requires participant membership or admin role.
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 2000
            default: 500
        - name: before_seq
          in: query
          required: false
          description: Return messages older than this seq.
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: Thread with messages
        '404':
          description: Thread not found or not a participant
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````