> ## 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: threads
  - name: tasks
  - name: messages
  - name: reviews
  - name: usage
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
          required: false
        - name: limit
          in: query
          schema:
            type: integer
          required: false
      responses:
        '200':
          description: MessagePage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessagePage'
        '401':
          description: capy/Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_Unauthorized'
        '404':
          description: capy/ThreadNotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_ThreadNotFound'
      security:
        - bearerAuth: []
components:
  schemas:
    MessagePage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Message'
        cursor:
          anyOf:
            - type: string
              allOf:
                - minLength: 26
                - maxLength: 26
            - type: 'null'
      required:
        - items
        - cursor
      additionalProperties: false
    capy_Unauthorized:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Unauthorized
      required:
        - _tag
      additionalProperties: false
    capy_ThreadNotFound:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/ThreadNotFound
        threadId:
          type: string
      required:
        - _tag
        - threadId
      additionalProperties: false
    Message:
      type: object
      properties:
        id:
          type: string
        source:
          type: string
          enum:
            - user
            - assistant
            - tool
        tool:
          type: string
        text:
          type: string
        authorName:
          type: string
        model:
          type: string
        attachments:
          type: array
          items:
            type: object
            properties:
              file:
                type: object
                properties:
                  fileId:
                    type: string
                  name:
                    type: string
                  mediaType:
                    type: string
                  sizeBytes:
                    anyOf:
                      - anyOf:
                          - type: number
                          - type: string
                            enum:
                              - NaN
                          - type: string
                            enum:
                              - Infinity
                          - type: string
                            enum:
                              - '-Infinity'
                      - type: string
                        enum:
                          - Infinity
                          - '-Infinity'
                          - NaN
                  preview:
                    type: boolean
                  width:
                    anyOf:
                      - anyOf:
                          - type: number
                          - type: string
                            enum:
                              - NaN
                          - type: string
                            enum:
                              - Infinity
                          - type: string
                            enum:
                              - '-Infinity'
                      - type: string
                        enum:
                          - Infinity
                          - '-Infinity'
                          - NaN
                  height:
                    anyOf:
                      - anyOf:
                          - type: number
                          - type: string
                            enum:
                              - NaN
                          - type: string
                            enum:
                              - Infinity
                          - type: string
                            enum:
                              - '-Infinity'
                      - type: string
                        enum:
                          - Infinity
                          - '-Infinity'
                          - NaN
                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.

````