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

# Get Messages

> Retrieve messages from a thread using cursor-based pagination.



## OpenAPI

````yaml /api-reference/openapi.json get /threads/{thread_id}/messages
openapi: 3.1.0
info:
  title: Puppeteer Core API
  description: >-
    Core API for the Puppeteer AI platform. Manages domain models,
    conversations, voice calls, simulations, and integrations.


    [Documentation](https://docs.puppeteerai.com)
  version: 1.0.0
servers:
  - url: https://api.puppeteerai.com
    description: Production
security: []
tags:
  - name: Auth
    description: JWT token generation and organization creation.
  - name: Messages
    description: >-
      Send and receive messages, retrieve conversation history, search, and
      create messages in threads.
  - name: Threads
    description: Create and manage threads, aliases, scheduled events, and bulk operations.
  - name: Voice
    description: Voice call handling, scheduling, batch calls, and WebSocket LLM.
paths:
  /threads/{thread_id}/messages:
    get:
      tags:
        - Messages
      summary: Get Messages
      description: Retrieve messages from a thread using cursor-based pagination.
      operationId: get_messages_threads__thread_id__messages_get
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            title: Thread Id
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Base64-encoded pagination cursor. If not provided, returns the
              latest 20 messages.
            title: Cursor
          description: >-
            Base64-encoded pagination cursor. If not provided, returns the
            latest 20 messages.
        - name: reverse
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Controls the direction of message retrieval. When false (default),
              returns messages older than the cursor. When true, returns
              messages newer than the cursor.
            default: false
            title: Reverse
          description: >-
            Controls the direction of message retrieval. When false (default),
            returns messages older than the cursor. When true, returns messages
            newer than the cursor.
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CursorMessagesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CursorMessagesResponse:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/CursorMessageModel'
          type: array
          title: Messages
          description: List of messages.
        pagination:
          $ref: '#/components/schemas/routers__conversations__CursorPagination'
        is_locked:
          type: boolean
          title: Is Locked
          description: >-
            True when the access link locks on conversation end and the latest
            conversation has ended. The widget must disable input and hide the
            ended conversation's history.
          default: false
      type: object
      required:
        - messages
        - pagination
      title: CursorMessagesResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CursorMessageModel:
      properties:
        message_id:
          type: string
          title: Message Id
          description: Unique identifier of the message.
        role:
          type: string
          title: Role
          description: The role of the sender, either "user" or "AI".
        message:
          type: string
          title: Message
          description: The message text.
        conversation_id:
          type: integer
          title: Conversation Id
          description: ID of the conversation this message belongs to.
        timestamp:
          type: integer
          title: Timestamp
          description: Unix timestamp (seconds) when the message was sent.
        extras:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extras
          description: Additional metadata attached to the message.
        conversation_end_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation End Time
          description: >-
            ISO timestamp the parent conversation ended at, or null if still
            active.
      type: object
      required:
        - message_id
        - role
        - message
        - conversation_id
        - timestamp
      title: CursorMessageModel
    routers__conversations__CursorPagination:
      properties:
        cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Cursor
          description: >-
            Base64-encoded cursor for the next batch of messages. Null if no
            more results.
      type: object
      required:
        - cursor
      title: CursorPagination
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````