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

# Get thread messages

> Retrieve all messages for a specific thread. Messages are returned in chronological order.



## OpenAPI

````yaml https://api.camelai.com/api/schema/ get /api/v1/threads/{thread_id}/messages
openapi: 3.0.3
info:
  title: camelAI API
  version: 1.0.0 (v1)
  description: API for camelAI - AI-powered data analytics platform
servers:
  - url: https://api.camelai.com
    description: camelAI API server
security: []
paths:
  /api/v1/threads/{thread_id}/messages:
    get:
      tags:
        - threads
      summary: Get thread messages
      description: >-
        Retrieve all messages for a specific thread. Messages are returned in
        chronological order.
      operationId: threads_messages_retrieve
      parameters:
        - in: path
          name: thread_id
          schema:
            type: integer
          description: ID of the thread
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadMessagesResponse'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadMessagesAccessDeniedResponse'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadMessagesNotFoundResponse'
          description: ''
      security:
        - ApiKeyAuth: []
        - {}
components:
  schemas:
    ThreadMessagesResponse:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
        thread_id:
          type: integer
          description: ID of the thread
        message_count:
          type: integer
          description: Total number of messages
      required:
        - message_count
        - messages
        - thread_id
    ThreadMessagesAccessDeniedResponse:
      type: object
      properties:
        error:
          type: string
          description: Access denied error message
      required:
        - error
    ThreadMessagesNotFoundResponse:
      type: object
      properties:
        error:
          type: string
          description: Thread not found error message
      required:
        - error
    Message:
      type: object
      description: Serializer for Message model.
      properties:
        id:
          type: integer
          readOnly: true
        role:
          enum:
            - user
            - assistant
            - system
            - tool
            - hidden
          type: string
          description: |-
            * `user` - User
            * `assistant` - Assistant
            * `system` - System
            * `tool` - Tool
            * `hidden` - Hidden
          x-spec-enum-id: 3831a1334a76899e
        content: {}
        created_at:
          type: string
          format: date-time
          readOnly: true
        metadata: {}
        source:
          enum:
            - UI
            - API
            - MCP
          type: string
          x-spec-enum-id: 5aae49abdf40e222
          readOnly: true
          description: |-
            How this message was created

            * `UI` - Web UI
            * `API` - REST API
            * `MCP` - MCP Server
      required:
        - created_at
        - id
        - source
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: API key authentication using Bearer scheme

````