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

# List messages in a conversation

> Returns the messages, newest first. To page back, pass the id of the oldest message you hold as `before`;
`meta.nextBefore` gives it. When `meta.hasMore` is `false` you have reached the start of the conversation.

Required scope: `conversations:read`.




## OpenAPI

````yaml /openapi.yaml get /conversations/{conversationId}/messages
openapi: 3.1.0
info:
  title: Cerium API
  version: 1.0.0
  description: |
    Send your customers and their conversations to Cerium from your own backend.
    Every request is authenticated with an API key.
servers:
  - url: https://api.usecerium.com/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Customers
  - name: Conversations
  - name: Messages
paths:
  /conversations/{conversationId}/messages:
    parameters:
      - $ref: '#/components/parameters/ConversationId'
    get:
      tags:
        - Messages
      summary: List messages in a conversation
      description: >
        Returns the messages, newest first. To page back, pass the id of the
        oldest message you hold as `before`;

        `meta.nextBefore` gives it. When `meta.hasMore` is `false` you have
        reached the start of the conversation.


        Required scope: `conversations:read`.
      operationId: listMessages
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: before
          in: query
          description: >-
            Cursor. The id of the oldest message you already hold. Returns the
            messages before it.
          schema:
            type: string
            maxLength: 40
        - name: order
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        '200':
          description: A page of messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageList'
        '400':
          $ref: '#/components/responses/Invalid'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    ConversationId:
      name: conversationId
      in: path
      required: true
      description: The conversation's id.
      schema:
        type: string
      example: thr_01k9z3m4q8
  schemas:
    MessageList:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          example: success
        data:
          type: array
          items:
            $ref: '#/components/schemas/Message'
        meta:
          type: object
          properties:
            hasMore:
              type: boolean
            nextBefore:
              type:
                - string
                - 'null'
              description: >-
                Pass this as `before` to get the next page. `null` when there
                are no more.
    Message:
      type: object
      properties:
        id:
          type: string
          example: msg_5d1c
        conversationId:
          type: string
          example: thr_01k9z3m4q8
        from:
          type: string
          enum:
            - customer
            - agent
          description: Which side wrote it. AI replies and system notices are `agent`.
        senderType:
          type: string
          enum:
            - customer
            - agent
            - ai
            - system
        senderName:
          type:
            - string
            - 'null'
          example: Ada Obi
        body:
          type: string
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        status:
          type: string
          example: sent
        sentAt:
          type: string
          format: date-time
    Error:
      type: object
      description: >
        `message` is always present. `code` is a stable identifier for specific
        errors you may want to handle in code.

        A validation error has a `message` that is a list of everything to fix.
      properties:
        code:
          type: string
          description: A stable identifier you can match on.
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: integer
        error:
          type: string
      required:
        - message
    Attachment:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          maxLength: 2048
          description: An https address the team can open.
        fileName:
          type:
            - string
            - 'null'
          maxLength: 255
        mimeType:
          type:
            - string
            - 'null'
          maxLength: 100
        size:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Size in bytes.
  responses:
    Invalid:
      description: The request is not valid. `message` says what to fix.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            error: Bad Request
            message:
              - email must be an email
    Unauthorized:
      description: The key is missing or not valid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Authentication token is missing.
    Forbidden:
      description: The key does not have the scope this call needs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            message: This key cannot do that.
    NotFound:
      description: Nothing has that id.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: thread_not_found
            message: No conversation has that id.
    RateLimited:
      description: Too many requests. Wait, then try again.
      headers:
        Retry-After:
          description: Seconds to wait before trying again.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >
        Your API key, sent as `Authorization: Bearer <key>`. Create keys in the
        Cerium dashboard.

        Keep them on your servers only.

````