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

# Get Messages

> Retrieve the message history for a conversation, ordered chronologically.



## OpenAPI

````yaml openapi.json get /forms/{id}/chat/{conversationId}/messages
openapi: 3.1.0
info:
  title: GeniusForms API
  description: >-
    AI-powered form builder API. Create forms manually or generate them from
    natural language prompts.
  version: 1.0.0
  contact:
    name: GeniusForms Support
    email: support@geniusforms.ai
    url: https://geniusforms.ai
servers:
  - url: https://geniusforms.ai/api/v1
    description: Production
  - url: http://localhost:8000/api/v1
    description: Local Development
security:
  - ApiKeyAuth: []
paths:
  /forms/{id}/chat/{conversationId}/messages:
    get:
      tags:
        - Chat
      summary: Get Messages
      description: >-
        Retrieve the message history for a conversation, ordered
        chronologically.
      operationId: getMessages
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          description: Form ID
        - name: conversationId
          in: path
          required: true
          schema:
            type: integer
          description: Conversation ID
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
            maximum: 100
          description: Max results to return
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
          description: Pagination offset
      responses:
        '200':
          description: Conversation messages
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      $ref: '#/components/schemas/ChatMessage'
                  total:
                    type: integer
                  hasMore:
                    type: boolean
                  limit:
                    type: integer
                  offset:
                    type: integer
        '403':
          description: Access denied to this conversation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Conversation not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ChatMessage:
      type: object
      properties:
        id:
          type: integer
          example: 1
        role:
          type: string
          enum:
            - user
            - assistant
          example: assistant
        message:
          type: string
          example: Based on the 42 responses, the most common feedback theme is...
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          example: validation_error
        message:
          type: string
          example: Invalid request
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key obtained from your GeniusForms dashboard

````