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

# Get messages for a thread

> Get messages for a specific thread with cursor-based pagination



## OpenAPI

````yaml get /api/v1/threads/{threadId}/messages
openapi: 3.0.0
info:
  version: 1.0.0
  title: Feather AI API
servers:
  - url: https://prod.featherhq.com
    description: Production environment
security: []
paths:
  /api/v1/threads/{threadId}/messages:
    get:
      tags:
        - SMS Threads
      summary: Get messages for a thread
      description: Get messages for a specific thread with cursor-based pagination
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: threadId
          in: path
        - schema:
            type: string
          required: false
          description: 'Number of messages per page (default: 50, max: 100)'
          name: limit
          in: query
        - schema:
            type: string
          required: false
          description: Cursor for pagination (ID of the last message in previous page)
          name: cursor
          in: query
        - schema:
            type: string
            enum:
              - INBOUND
              - OUTBOUND
          required: false
          description: Filter by message direction (INBOUND or OUTBOUND)
          name: direction
          in: query
        - schema:
            type: string
            enum:
              - QUEUED
              - SENDING
              - SENT
              - DELIVERED
              - FAILED
              - UNDELIVERED
              - READ
              - RECEIVED
              - DISCARDED
          required: false
          description: Filter by message status
          name: status
          in: query
      responses:
        '200':
          description: Thread messages
          content:
            application/json:
              schema:
                type: object
                properties:
                  thread:
                    type: object
                    properties:
                      agentId:
                        type: string
                      agentDetails:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          description:
                            type: string
                            nullable: true
                          agentType:
                            type: string
                            enum:
                              - CALL
                              - TEXT
                        required:
                          - id
                          - name
                          - description
                          - agentType
                      agentVersionId:
                        type: string
                      agentVersionDetails:
                        type: object
                        properties:
                          id:
                            type: string
                          version:
                            type: number
                          name:
                            type: string
                          mode:
                            type: string
                            enum:
                              - FLOW
                              - PROMPT
                          smsMaxTokens:
                            type: number
                            nullable: true
                          smsTemperature:
                            type: number
                            nullable: true
                          discardInboundSms:
                            type: boolean
                        required:
                          - id
                          - version
                          - name
                          - mode
                          - smsMaxTokens
                          - smsTemperature
                          - discardInboundSms
                      messages:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            threadId:
                              type: string
                            direction:
                              type: string
                              enum:
                                - INBOUND
                                - OUTBOUND
                            messageBody:
                              type: string
                            status:
                              type: string
                              enum:
                                - QUEUED
                                - SENDING
                                - SENT
                                - DELIVERED
                                - FAILED
                                - UNDELIVERED
                                - READ
                                - RECEIVED
                                - DISCARDED
                            twilioMessageSid:
                              type: string
                              nullable: true
                            twilioAccountSid:
                              type: string
                              nullable: true
                            twilioNumSegments:
                              type: number
                              nullable: true
                            twilioPrice:
                              type: string
                              nullable: true
                            twilioPriceCurrency:
                              type: string
                              nullable: true
                            twilioErrorCode:
                              type: string
                              nullable: true
                            twilioErrorMessage:
                              type: string
                              nullable: true
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                            sentAt:
                              type: string
                              nullable: true
                            deliveredAt:
                              type: string
                              nullable: true
                            readAt:
                              type: string
                              nullable: true
                          required:
                            - id
                            - threadId
                            - direction
                            - messageBody
                            - status
                            - twilioMessageSid
                            - twilioAccountSid
                            - twilioNumSegments
                            - twilioPrice
                            - twilioPriceCurrency
                            - twilioErrorCode
                            - twilioErrorMessage
                            - createdAt
                            - updatedAt
                            - sentAt
                            - deliveredAt
                            - readAt
                      pagination:
                        type: object
                        properties:
                          limit:
                            type: number
                            minimum: 1
                            maximum: 100
                            default: 10
                          nextCursor:
                            type: string
                    required:
                      - agentId
                      - agentDetails
                      - agentVersionId
                      - agentVersionDetails
                      - messages
                      - pagination
                required:
                  - thread
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 400
                  message:
                    type: string
                    default: Bad request
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    default: BAD_REQUEST
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
        '404':
          description: Thread not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 400
                  message:
                    type: string
                    default: Bad request
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    default: BAD_REQUEST
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 500
                  message:
                    type: string
                    default: Internal server error
                  code:
                    type: string
                    enum:
                      - INTERNAL_SERVER_ERROR
                    default: INTERNAL_SERVER_ERROR
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key

````