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

# List messages in a conversation

> Messages oldest-first.

`inference_run_id` on an outbound message points at the AI run that produced it — pass its timestamp as `since` to the trace endpoint to see why the agent said that.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/conversations/{conversation_id}/messages
openapi: 3.1.0
info:
  description: >-
    The Sailer REST API for CRM, conversations, and campaigns.


    **Authentication.** Send a scoped token as `Authorization: Bearer
    sk_live_...`.

    Tokens are workspace-scoped; the workspace is implied by the token, so no

    tenant header is needed. A workspace administrator creates and revokes them;

    the secret is shown once at creation and cannot be recovered afterwards.


    **Pagination.** Collections return `{data, meta, links}`. Follow
    `links.next`

    until it is `null`; treat the cursor as opaque.


    **Errors.** Every non-2xx response is `{"error": {...}}` with a stable
    `code`.

    Quote `error.request_id` when contacting support.


    **Custom fields.** Workspace-defined fields appear under `custom_fields`,
    keyed

    by `field_key`. Read a record to see which keys a workspace uses; a
    dedicated

    field-discovery endpoint is not part of this release.
  title: Sailer API
  version: 1.0.0
servers:
  - url: https://api.chatsailer.com
security:
  - SailerApiToken: []
tags:
  - description: Token introspection and workspace capabilities.
    name: Meta
  - description: >-
      People you talk to. Called *leads* in older Sailer surfaces; `contact` is
      the current name.
    name: Contacts
  - description: Companies that contacts belong to (B2B accounts).
    name: Organizations
  - description: Opportunities moving through a pipeline.
    name: Deals
  - description: Pipelines and their stages.
    name: Pipelines
  - description: Field definitions, including custom fields.
    name: Fields
  - description: Free-text annotations on CRM records.
    name: Notes
  - description: Scheduled and logged CRM activities.
    name: Activities
  - description: Per-entity label catalogs.
    name: Tags
  - description: Message threads with contacts, across every channel.
    name: Conversations
  - description: Outbound campaigns and their participants.
    name: Campaigns
paths:
  /v1/conversations/{conversation_id}/messages:
    get:
      tags:
        - Conversations
      summary: List messages in a conversation
      description: >-
        Messages oldest-first.


        `inference_run_id` on an outbound message points at the AI run that
        produced it — pass its timestamp as `since` to the trace endpoint to see
        why the agent said that.
      operationId: list_conversation_messages
      parameters:
        - in: path
          name: conversation_id
          required: true
          schema:
            description: Unique identifier for a conversation.
            examples:
              - conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4
            pattern: ^conv_[0-9a-f]{32}$
            title: Conversation Id
            type: string
        - description: Items per page (max 200).
          in: query
          name: limit
          required: false
          schema:
            default: 50
            description: Items per page (max 200).
            maximum: 200
            minimum: 1
            title: Limit
            type: integer
        - description: Opaque cursor from a previous response's `links.next`.
          in: query
          name: cursor
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Opaque cursor from a previous response's `links.next`.
            title: Cursor
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageList'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - SailerApiToken: []
components:
  schemas:
    MessageList:
      description: A page of messages.
      properties:
        data:
          items:
            $ref: '#/components/schemas/Message'
          title: Data
          type: array
        links:
          $ref: '#/components/schemas/PageLinks'
        meta:
          $ref: '#/components/schemas/PageMeta'
      required:
        - data
        - meta
        - links
      title: MessageList
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    Message:
      description: One message in a conversation.
      properties:
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
        conversation_id:
          description: Unique identifier for a conversation.
          examples:
            - conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4
          pattern: ^conv_[0-9a-f]{32}$
          title: Conversation Id
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        delivered_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Delivered At
        direction:
          description: >-
            Derived from who sent it. Inbound is from the contact; everything
            Sailer or a teammate sends is outbound.
          enum:
            - inbound
            - outbound
          title: Direction
          type: string
        has_media:
          default: false
          description: >-
            Whether an attachment is present. The file itself is not served
            here.
          title: Has Media
          type: boolean
        id:
          description: Unique identifier for a message.
          examples:
            - msg_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4
          pattern: ^msg_[0-9a-f]{32}$
          title: Id
          type: string
        inference_run_id:
          anyOf:
            - description: Unique identifier for an inference run.
              examples:
                - run_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4
              pattern: ^run_[0-9a-f]{32}$
              type: string
            - type: 'null'
          description: >-
            The AI run that produced this message, when one did. Pass it to the
            conversation trace to see why the agent said this.
          title: Inference Run Id
        object:
          const: message
          default: message
          title: Object
          type: string
        read_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Read At
        sender:
          $ref: '#/components/schemas/MessageSenderType'
          description: 'Who sent it: the contact, an AI agent, a teammate, the system.'
        sender_classification:
          anyOf:
            - $ref: '#/components/schemas/SenderClassification'
            - type: 'null'
          description: For inbound messages, whether the sender looks human or automated.
        sent_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Sent At
        status:
          $ref: '#/components/schemas/MessageStatus'
        type:
          $ref: '#/components/schemas/MessageType'
      required:
        - id
        - conversation_id
        - direction
        - sender
        - type
        - status
        - created_at
      title: Message
      type: object
    PageLinks:
      properties:
        next:
          anyOf:
            - type: string
            - type: 'null'
          description: Opaque cursor for the following page; null on the last page.
          title: Next
      title: PageLinks
      type: object
    PageMeta:
      properties:
        has_more:
          description: True when a next page exists.
          title: Has More
          type: boolean
        limit:
          description: Maximum items requested for this page.
          title: Limit
          type: integer
      required:
        - limit
        - has_more
      title: PageMeta
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    MessageSenderType:
      enum:
        - attendant
        - agent
        - lead
        - device
        - system
      title: MessageSenderType
      type: string
    SenderClassification:
      description: Whether inbound lead messages look human or automated.
      enum:
        - human
        - automated
      title: SenderClassification
      type: string
    MessageStatus:
      enum:
        - received
        - processed
        - pending
        - canceled
        - sent
        - failed
        - delivered
        - read
        - deleted
        - retry_scheduled
      title: MessageStatus
      type: string
    MessageType:
      enum:
        - question
        - answer
        - outbound
        - follow_up
        - activity
      title: MessageType
      type: string
  securitySchemes:
    SailerApiToken:
      description: >-
        A workspace API token. Create one in Settings → API. Send it as
        `Authorization: Bearer sk_live_...`.
      scheme: bearer
      type: http

````