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

# Get Messages for Conversation

Returns paginated messages for a given conversation. This endpoint is useful for building a chat interface and fetch past conversation history based on the `conversation_id`.

You must have to save the `conversation_id` at the start of the conversation and use it in this endpoint to fetch messages for the conversation.


## OpenAPI

````yaml get /get_messages_for_conversation
openapi: 3.0.0
info:
  title: Chatzy AI API
  version: 1.0.0
  description: >-
    Chatzy AI REST API for messaging, contact conversations, and agent
    interactions.
  contact:
    name: Chatzy
    url: https://chatzy.ai
    email: support@chatzy.ai
servers:
  - url: https://vevdoh3hve.execute-api.us-east-1.amazonaws.com/prod
    description: Production Server
security: []
tags:
  - name: Authentication
    description: Authentication to access the API
  - name: Contact Conversations
    description: Get contact conversations
  - name: Conversational AI Agent Interactions
    description: Interact with the conversational AI agent
  - name: Authorized iframe Access
    description: APIs for authorized iframe access
paths:
  /get_messages_for_conversation:
    get:
      tags:
        - Conversational AI Agent Interactions
      summary: Get Messages for Conversation
      parameters:
        - name: conversation_id
          in: query
          required: true
          description: UUID of the conversation to fetch messages for.
          schema:
            type: string
            format: uuid
            example: 0913fa4c-7eac-4377-b801-58f0c1a151e6
        - name: limit
          in: query
          required: false
          description: 'Maximum number of messages to return (default: 20, max: 100).'
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: offset
          in: query
          required: false
          description: 'Number of messages to skip (for pagination, default: 0).'
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: access_token
          in: query
          required: false
          description: Optional access token for iframe-authenticated conversations.
          schema:
            type: string
      responses:
        '200':
          description: Paginated messages of the conversation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      type: object
                      properties:
                        message_id:
                          type: string
                          format: uuid
                        conversation_id:
                          type: string
                          format: uuid
                        conversation_created_at:
                          type: string
                          format: date-time
                        content:
                          type: string
                        role:
                          type: string
                          enum:
                            - user
                            - assistant
                        tool_calls:
                          type: string
                          nullable: true
                        documents:
                          type: array
                          nullable: true
                        created_at:
                          type: string
                          format: date-time
                        message_order:
                          type: integer
                      required:
                        - message_id
                        - conversation_id
                        - conversation_created_at
                        - content
                        - role
                        - created_at
                        - message_order
                required:
                  - messages

````