> ## 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.

# Get conversation

> Fetch a single conversation with all messages and insights. 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/{conversationId}
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/{conversationId}:
    get:
      tags:
        - Conversations
      summary: Get conversation
      description: >-
        Fetch a single conversation with all messages and insights. Without the
        `customers:read` scope, emails and phone numbers in message text,
        extracted questions, product insights and `userId` are masked.
      operationId: PublicApiConversationsController_getConversation
      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: conversationId
          required: true
          in: path
          description: Conversation ID
          schema:
            type: string
      responses:
        '200':
          description: Conversation with full data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationDetailDto'
        '400':
          description: Invalid request, or rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '401':
          description: Missing, invalid, revoked or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '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: Conversation not found
      security:
        - api-key: []
components:
  schemas:
    ConversationDetailDto:
      type: object
      properties:
        id:
          type: string
        createdAt:
          type: string
          format: date-time
        source:
          allOf:
            - $ref: '#/components/schemas/ChatSource'
        status:
          allOf:
            - $ref: '#/components/schemas/ConversationStatus'
        userId:
          type: string
          nullable: true
          description: >-
            Emails and phone numbers are masked as [email] and [phone] without
            `customers:read`.
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ConversationMessageDto'
        insights:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConversationInsightsDto'
        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
        - status
        - userId
        - messages
        - insights
        - usage
    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
    ChatSource:
      type: string
      enum:
        - PREVIEW
        - EMBED
        - TELEGRAM
        - WHATSAPP
        - EMAIL
    ConversationStatus:
      type: string
      enum:
        - ACTIVE
        - ARCHIVED
        - HANDOVER_REQUESTED
        - HUMAN_ACTIVE
        - RESOLVED
    ConversationMessageDto:
      type: object
      properties:
        id:
          type: string
        createdAt:
          type: string
          format: date-time
        role:
          description: Only customer, assistant and human agent messages are returned.
          allOf:
            - $ref: '#/components/schemas/PublicMessageRole'
        content:
          type: string
          description: >-
            Emails and phone numbers are masked as [email] and [phone] without
            `customers:read`.
        feedback:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ChatMessageFeedback'
      required:
        - id
        - createdAt
        - role
        - content
        - feedback
    ConversationInsightsDto:
      type: object
      properties:
        sentimentLabel:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConversationSentiment'
        sentimentScore:
          type: number
          nullable: true
        sentimentConfidence:
          type: number
          nullable: true
        intentPrimary:
          type: string
          nullable: true
        intentConfidence:
          type: number
          nullable: true
        intentAllScores:
          description: Free-form JSON.
          nullable: true
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        productInsights:
          description: >-
            Emails and phone numbers are masked as [email] and [phone] without
            `customers:read`.
          nullable: true
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        extractedQuestions:
          description: >-
            Emails and phone numbers are masked as [email] and [phone] without
            `customers:read`.
          nullable: true
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items: {}
      required:
        - sentimentLabel
        - sentimentScore
        - sentimentConfidence
        - intentPrimary
        - intentConfidence
        - intentAllScores
        - productInsights
        - extractedQuestions
    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
    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
    PublicMessageRole:
      type: string
      enum:
        - USER
        - ASSISTANT
        - HUMAN_AGENT
      description: Only customer, assistant and human agent messages are returned.
    ChatMessageFeedback:
      type: string
      enum:
        - POSITIVE
        - NEGATIVE
    ConversationSentiment:
      type: string
      enum:
        - POSITIVE
        - NEGATIVE
        - NEUTRAL
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

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