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

# List chat messages

> Returns the latest saved messages of a chat you can open, oldest first. Page backwards with `before`. A reply appears here once its turn finishes.




## OpenAPI

````yaml /openapi/chat.yaml get /ai-chat/messages
openapi: 3.1.0
info:
  title: Connie Chat API
  version: 1.0.0
  description: >
    Endpoints the Connie web app uses for chat. They authenticate with your
    signed-in browser session — see
    https://docs.connie.ai/api-reference/authentication. These are the app's own
    endpoints and can change when the app changes.
servers:
  - url: https://connie.ai/api
security:
  - sessionCookie: []
tags:
  - name: Chats
    description: List, create, rename, pin and delete chats.
  - name: Turns
    description: Send a message to Connie and stop a running reply.
  - name: Chat messages
    description: Read the saved messages of a chat.
  - name: Artifacts
    description: Workflows, tables, canvases, analytics views and apps attached to a chat.
  - name: Sharing
    description: >-
      Share a chat or a single file or canvas, and read a chat through its
      public link.
paths:
  /ai-chat/messages:
    get:
      tags:
        - Chat messages
      summary: List chat messages
      description: >
        Returns the latest saved messages of a chat you can open, oldest first.
        Page backwards with `before`. A reply appears here once its turn
        finishes.
      operationId: listMessages
      parameters:
        - name: conversation_id
          in: query
          required: true
          description: The chat. Note the snake-case name.
          schema:
            type: string
            format: uuid
        - name: limit
          in: query
          description: How many of the most recent messages to return, at most 200.
          schema:
            type: integer
            default: 100
            maximum: 200
        - name: before
          in: query
          description: >-
            Only messages created before this ISO timestamp. Pass the
            `created_at` of the oldest message you have.
          schema:
            type: string
            format: date-time
        - name: request_id
          in: query
          description: >-
            Only the messages of one turn, by the `requestId` from Send a
            message.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Messages in chronological order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      $ref: '#/components/schemas/Message'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The chat's history was edited while loading. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Message:
      type: object
      properties:
        id:
          type: string
          format: uuid
        conversation_id:
          type: string
          format: uuid
        role:
          type: string
          description: >-
            `user` or `assistant` for the visible conversation; tool and system
            rows can also appear.
        content:
          type: string
        request_id:
          type:
            - string
            - 'null'
          description: >-
            The turn this message belongs to (the `requestId` from Send a
            message).
        metadata:
          type:
            - object
            - 'null'
          description: >-
            Display data such as attachments, tool runs and cards. Its shape
            follows the app and may change.
          additionalProperties: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: Machine-readable code, when there is one.
      required:
        - error
  responses:
    BadRequest:
      description: A required field is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        No valid session (`UNAUTHORIZED`), or the session has expired
        (`SESSION_EXPIRED`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found, or you can't open it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: header
      name: Cookie
      description: >-
        The full Cookie header copied from a signed-in connie.ai browser
        request. See the Authentication page.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.