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

# List thread messages



## OpenAPI

````yaml /openapi.json get /api/v1/threads/{threadId}/messages
openapi: 3.1.0
info:
  title: Capy API
  version: 1.0.0
  description: Programmatic access to Capy's agent platform.
servers:
  - url: https://api.capy.ai
security:
  - bearerAuth: []
tags:
  - name: automations
  - name: projects
  - name: threads
  - name: captains
  - name: folders
  - name: subagents
  - name: tasks
  - name: messages
  - name: streams
  - name: reviews
  - name: reviewRules
  - name: reviewFilters
  - name: usage
  - name: users
paths:
  /api/v1/threads/{threadId}/messages:
    get:
      tags:
        - messages
      summary: List thread messages
      operationId: messages.list
      parameters:
        - name: threadId
          in: path
          schema:
            type: string
          required: true
        - name: after
          in: query
          schema:
            type: string
            allOf:
              - minLength: 26
              - maxLength: 26
            description: >-
              Exclusive forward event-ID cursor from cursor. Without either
              bound, returns the oldest page.
          required: false
        - name: before
          in: query
          schema:
            type: string
            allOf:
              - minLength: 26
              - maxLength: 26
            description: >-
              Exclusive backward event-ID cursor from beforeCursor. Without
              after, returns the nearest older page.
          required: false
        - name: limit
          in: query
          schema:
            type: integer
          required: false
      responses:
        '200':
          description: TranscriptPage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptPageEncoded'
        '401':
          description: capy/Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_UnauthorizedEncoded'
        '403':
          description: capy/Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_ForbiddenEncoded'
        '404':
          description: capy/ThreadNotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_ThreadNotFoundEncoded'
        '429':
          description: capy/RateLimited
          headers:
            retry-after:
              schema:
                type: integer
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_RateLimitedEncoded'
      security:
        - bearerAuth: []
components:
  schemas:
    TranscriptPageEncoded:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/MessageEncoded'
        cursor:
          anyOf:
            - type: string
              allOf:
                - minLength: 26
                - maxLength: 26
            - type: 'null'
          description: >-
            Opaque exclusive event-ID cursor for after. Stable across
            compaction. Null when no newer events remain. An unchanged cursor
            means unsettled messages still block forward paging. Retry after
            they settle.
        beforeCursor:
          anyOf:
            - type: string
              allOf:
                - minLength: 26
                - maxLength: 26
            - type: 'null'
          description: >-
            Opaque exclusive event-ID cursor for before. Stable across
            compaction. Null when no older events remain.
      required:
        - items
        - cursor
        - beforeCursor
      additionalProperties: false
    capy_UnauthorizedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Unauthorized
      required:
        - _tag
      additionalProperties: false
    capy_ForbiddenEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Forbidden
      required:
        - _tag
      additionalProperties: false
    capy_ThreadNotFoundEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/ThreadNotFound
        threadId:
          type: string
      required:
        - _tag
        - threadId
      additionalProperties: false
    capy_RateLimitedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/RateLimited
        retryAfterSeconds:
          type: integer
      required:
        - _tag
        - retryAfterSeconds
      additionalProperties: false
    MessageEncoded:
      type: object
      properties:
        id:
          type: string
        source:
          type: string
          enum:
            - user
            - assistant
            - tool
        tool:
          type: string
        calls:
          type: array
          items:
            type: object
            properties:
              tool:
                type: string
              durationMs:
                anyOf:
                  - type: number
                  - type: string
                    enum:
                      - Infinity
                      - '-Infinity'
                      - NaN
            required:
              - tool
              - durationMs
            additionalProperties: false
        text:
          type: string
        authorName:
          type: string
        clientKey:
          type: string
          minLength: 1
          maxLength: 64
        editOf:
          type: string
          allOf:
            - minLength: 26
            - maxLength: 26
        model:
          type: string
        callId:
          type: string
        attachments:
          type: array
          items:
            type: object
            properties:
              file:
                type: object
                properties:
                  fileId:
                    type: string
                  name:
                    type: string
                  mediaType:
                    type: string
                  sizeBytes:
                    anyOf:
                      - type: number
                      - type: string
                        enum:
                          - Infinity
                          - '-Infinity'
                          - NaN
                  preview:
                    type: boolean
                  previewBytes:
                    anyOf:
                      - type: number
                      - type: string
                        enum:
                          - Infinity
                          - '-Infinity'
                          - NaN
                  width:
                    anyOf:
                      - type: number
                      - type: string
                        enum:
                          - Infinity
                          - '-Infinity'
                          - NaN
                  height:
                    anyOf:
                      - type: number
                      - type: string
                        enum:
                          - Infinity
                          - '-Infinity'
                          - NaN
                  pageCount:
                    type: integer
                    minimum: 1
                  sourcePath:
                    type: string
                  contentSha:
                    type: string
                required:
                  - fileId
                  - name
                  - mediaType
                  - sizeBytes
                additionalProperties: false
              title:
                type: string
            required:
              - file
            additionalProperties: false
        createdAt:
          type: string
      required:
        - id
        - source
        - text
        - createdAt
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Capy API key
      description: An API key created in Capy under Settings → API.

````

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