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

# List conversations

> Fetch paginated conversations with insights and sentiment analysis. Messages are embedded only with `include=messages`. Without the `customers:read` scope, emails and phone numbers in message text, extracted questions, product insights and `userId` are masked.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/conversations
openapi: 3.0.0
info:
  title: Totebot Public API
  description: >-
    Manage your agents (settings, instructions, widget, skills, actions, MCP
    connections, integrations), their knowledge, test questions, the help desk,
    customers and your team from code, read conversations and analytics, and
    analyse which knowledge each answer used.


    Authenticate with a Bearer token: a team API key (`tb_live_…`, created by a
    team owner in Team settings → API keys) or a legacy per-agent key.

    New keys can only read. Write access is opt-in per area (`agents:write`,
    `plugins:write`, `knowledge:write`, `conversations:write`, `helpdesk:write`,
    `team:write`, `members:write`, `chat:write`, `customers:delete`,
    `quality:write`, `experiments:write`, `sales:write`). Provider cost in USD
    needs the opt-in `billing:read` scope. A key may also be limited to some
    agents.

    Routes that act on one agent take it from the `agentId` path parameter or,
    on the older `/v1/<resource>` routes, from the `X-Agent-Id` header.

    Write routes accept an `Idempotency-Key` header. Over the rate limit you get
    429 with `Retry-After`. Errors share one shape: `{ status: "error", error: {
    code, message, details } }`.

    Not available through the API, on purpose: billing and plan changes,
    deleting the team, creating or changing API keys, and OAuth connect flows.


    This spec is public at https://api.totebot.ai/v1/openapi.json (and .yaml).
  version: '2.0'
  contact: {}
servers:
  - url: https://api.totebot.ai
security: []
tags: []
paths:
  /v1/conversations:
    get:
      tags:
        - Conversations
      summary: List conversations
      description: >-
        Fetch paginated conversations with insights and sentiment analysis.
        Messages are embedded only with `include=messages`. Without the
        `customers:read` scope, emails and phone numbers in message text,
        extracted questions, product insights and `userId` are masked.
      operationId: PublicApiConversationsController_getConversations
      parameters:
        - name: X-Agent-Id
          in: header
          description: >-
            The agent to act on. Required for team API keys that cover more than
            one agent; ignored for per-agent keys.
          required: false
          schema:
            type: string
        - name: page
          required: false
          in: query
          description: Page number (1-based)
          schema:
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Items per page (max 250)
          schema:
            default: 20
            type: number
        - name: startDate
          required: false
          in: query
          description: Filter conversations created after this date (ISO 8601)
          schema:
            example: '2024-01-01T00:00:00.000Z'
            type: string
        - name: endDate
          required: false
          in: query
          description: Filter conversations created before this date (ISO 8601)
          schema:
            example: '2024-12-31T23:59:59.999Z'
            type: string
        - name: source
          required: false
          in: query
          description: Filter by conversation source
          schema:
            type: string
            enum:
              - PREVIEW
              - EMBED
              - TELEGRAM
              - WHATSAPP
              - EMAIL
        - name: sentiment
          required: false
          in: query
          description: Filter by sentiment
          schema:
            type: string
            enum:
              - POSITIVE
              - NEGATIVE
              - NEUTRAL
        - name: product
          required: false
          in: query
          description: Filter by product name mentioned
          schema:
            type: string
        - name: purchased
          required: false
          in: query
          description: Filter by purchase status
          schema:
            type: string
            enum:
              - 'yes'
              - 'no'
        - name: customerId
          required: false
          in: query
          description: Filter by customer ID
          schema:
            type: string
        - name: include
          required: false
          in: query
          description: >-
            Set to `messages` to embed each conversation's messages. Off by
            default; fetch one conversation's messages with GET
            /v1/conversations/{conversationId}/messages.
          schema:
            type: string
            enum:
              - messages
      responses:
        '200':
          description: Paginated list of conversations with full data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiConversationsResponseDto'
        '400':
          description: Invalid request, or rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '401':
          description: Invalid or missing API key
        '403':
          description: >-
            The plan lacks the feature, or the key lacks a scope
            (`error.details.missingScopes`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '404':
          description: Not found, or not an agent this key can access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
      security:
        - api-key: []
components:
  schemas:
    PublicApiConversationsResponseDto:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/ConversationsMetaDto'
        data:
          type: array
          items:
            $ref: '#/components/schemas/ConversationDto'
      required:
        - meta
        - data
    ApiErrorDto:
      type: object
      properties:
        status:
          type: string
          example: error
        error:
          $ref: '#/components/schemas/ApiErrorBodyDto'
        path:
          type: string
          example: /v1/agents/clx123
        timestamp:
          type: string
          example: '2026-11-24T10:00:00.000Z'
      required:
        - status
        - error
        - path
        - timestamp
    ConversationsMetaDto:
      type: object
      properties:
        agentId:
          type: string
          example: clxyz123
        agentName:
          type: string
          example: My Agent
        pagination:
          $ref: '#/components/schemas/PaginationDto'
      required:
        - agentId
        - agentName
        - pagination
    ConversationDto:
      type: object
      properties:
        id:
          type: string
          example: clxyz789
        createdAt:
          type: string
          example: '2024-01-15T10:00:00.000Z'
        source:
          type: string
          enum:
            - PREVIEW
            - EMBED
            - TELEGRAM
            - WHATSAPP
            - EMAIL
        userId:
          type: string
          example: user_123
          nullable: true
          description: >-
            The id your site passed for the visitor. Emails and phone numbers in
            it are masked without `customers:read`.
        messages:
          description: Present only with `include=messages`.
          type: array
          items:
            $ref: '#/components/schemas/MessageDto'
        insights:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/InsightsDto'
        usage:
          nullable: true
          description: >-
            Tokens the conversation used. Null for conversations from before
            usage was recorded per conversation.
          allOf:
            - $ref: '#/components/schemas/ConversationUsageDto'
      required:
        - id
        - createdAt
        - source
    ApiErrorBodyDto:
      type: object
      properties:
        code:
          type: string
          example: NotFoundException
        message:
          type: string
          example: Agent not found
        details:
          type: object
          description: >-
            Extra fields, e.g. `missingScopes` on 403 or `secondsRemaining` on a
            training cooldown.
          additionalProperties: true
      required:
        - code
        - message
    PaginationDto:
      type: object
      properties:
        page:
          type: number
          example: 1
        limit:
          type: number
          example: 20
        totalItems:
          type: number
          example: 150
        totalPages:
          type: number
          example: 8
      required:
        - page
        - limit
        - totalItems
        - totalPages
    MessageDto:
      type: object
      properties:
        id:
          type: string
          example: clxyz456
        createdAt:
          type: string
          example: '2024-01-15T10:30:00.000Z'
        role:
          type: string
          enum:
            - USER
            - ASSISTANT
            - HUMAN_AGENT
        content:
          type: string
          example: What products do you have?
          description: >-
            Emails and phone numbers are masked as [email] and [phone] without
            `customers:read`.
        feedback:
          type: string
          enum:
            - POSITIVE
            - NEGATIVE
          nullable: true
      required:
        - id
        - createdAt
        - role
        - content
    InsightsDto:
      type: object
      properties:
        sentimentLabel:
          type: string
          enum:
            - POSITIVE
            - NEGATIVE
            - NEUTRAL
          nullable: true
        sentimentScore:
          type: number
          example: 0.85
          nullable: true
        sentimentConfidence:
          type: number
          example: 0.92
          nullable: true
        intentPrimary:
          type: string
          example: product_inquiry
          nullable: true
        intentConfidence:
          type: number
          example: 0.88
          nullable: true
        intentAllScores:
          type: object
          nullable: true
          description: All intent scores as JSON
        productInsights:
          type: object
          nullable: true
          description: >-
            Product mentions and sentiment. Emails and phone numbers are masked
            without `customers:read`.
        extractedQuestions:
          type: object
          nullable: true
          description: >-
            Questions extracted from conversation. Emails and phone numbers are
            masked without `customers:read`.
    ConversationUsageDto:
      type: object
      properties:
        inputTokens:
          type: number
          example: 5400
        outputTokens:
          type: number
          example: 320
        costUsd:
          type: number
          example: 0.0042
          description: >-
            What the AI providers charged for this conversation, in USD. Only
            with the billing:read scope.
      required:
        - inputTokens
        - outputTokens
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

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