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

# Explain the answers in a conversation

> Per customer message: the replies, the knowledge searches with the sources they returned, the tools the bot called, and whether it answered without any tool or search. Only customer, bot and team member messages are returned. Emails and phone numbers in customer text are masked unless the key has customers:read.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/agents/{agentId}/conversations/{conversationId}/answers
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/agents/{agentId}/conversations/{conversationId}/answers:
    get:
      tags:
        - Analysis
      summary: Explain the answers in a conversation
      description: >-
        Per customer message: the replies, the knowledge searches with the
        sources they returned, the tools the bot called, and whether it answered
        without any tool or search. Only customer, bot and team member messages
        are returned. Emails and phone numbers in customer text are masked
        unless the key has customers:read.
      operationId: PublicApiAnalysisController_answers
      parameters:
        - name: conversationId
          required: true
          in: path
          schema:
            type: string
        - name: agentId
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationAnswersDto'
        '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: Not found, or not an agent this key can access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
      security:
        - api-key: []
components:
  schemas:
    ConversationAnswersDto:
      type: object
      properties:
        conversationId:
          type: string
        createdAt:
          type: string
          format: date-time
        source:
          type: string
          example: EMBED
        truncated:
          type: boolean
          description: >-
            True when the conversation was longer than the first 400 messages
            returned.
        piiMasked:
          type: boolean
          description: >-
            Whether emails and phone numbers in the text are masked (keys
            without customers:read).
        turns:
          type: array
          items:
            $ref: '#/components/schemas/AnswerTurnDto'
      required:
        - conversationId
        - createdAt
        - source
        - truncated
        - piiMasked
        - turns
    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
    AnswerTurnDto:
      type: object
      properties:
        questionMessageId:
          type: string
          nullable: true
        question:
          type: string
          nullable: true
          description: The customer message. Null for replies before any customer message.
        replies:
          type: array
          items:
            $ref: '#/components/schemas/AnswerReplyDto'
        retrievals:
          type: array
          items:
            $ref: '#/components/schemas/RetrievalEventDto'
        toolCalls:
          nullable: true
          description: Tools the bot called for this turn; null when unknown.
          type: array
          items:
            $ref: '#/components/schemas/AnswerToolCallDto'
        toolCallsSource:
          type: string
          enum:
            - trace
            - checkpoint
            - unavailable
          description: >-
            trace: the stored playground trace. checkpoint: the conversation
            state the bot keeps. unavailable: neither is stored.
        usedNoTool:
          type: boolean
          nullable: true
          description: >-
            True when the bot called no tool and no knowledge search ran: it
            answered from the instructions and conversation alone. Null when
            unknown.
      required:
        - questionMessageId
        - question
        - replies
        - retrievals
        - toolCalls
        - toolCallsSource
        - usedNoTool
    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
    AnswerReplyDto:
      type: object
      properties:
        messageId:
          type: string
        role:
          allOf:
            - $ref: '#/components/schemas/AnswerReplyRole'
        content:
          type: string
        createdAt:
          type: string
          format: date-time
        feedback:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ChatMessageFeedback'
      required:
        - messageId
        - role
        - content
        - createdAt
        - feedback
    RetrievalEventDto:
      type: object
      properties:
        id:
          type: string
        createdAt:
          type: string
          format: date-time
        conversationId:
          type: string
          nullable: true
        messageId:
          type: string
          nullable: true
          description: The customer message that triggered the search.
        origin:
          allOf:
            - $ref: '#/components/schemas/RetrievalOrigin'
        query:
          type: string
          description: >-
            The search text. Emails and phone numbers are masked unless the key
            has customers:read.
        language:
          type: string
          nullable: true
          example: en
        resultCount:
          type: number
        topScore:
          type: number
          nullable: true
        empty:
          type: boolean
        failed:
          type: boolean
        latencyMs:
          type: number
        sources:
          description: Returned sources in rank order, one entry per source.
          type: array
          items:
            $ref: '#/components/schemas/RetrievedSourceDto'
      required:
        - id
        - createdAt
        - conversationId
        - messageId
        - origin
        - query
        - language
        - resultCount
        - topScore
        - empty
        - failed
        - latencyMs
        - sources
    AnswerToolCallDto:
      type: object
      properties:
        name:
          type: string
          example: knowledge_retriever
        kind:
          type: string
          enum:
            - knowledge_search
            - knowledge_prefetch
            - tool
        category:
          type: string
          nullable: true
          example: products
        status:
          type: string
          nullable: true
          description: >-
            succeeded, empty, failed or skipped. Null when read from the
            checkpoint.
      required:
        - name
        - kind
        - category
        - status
    AnswerReplyRole:
      type: string
      enum:
        - ASSISTANT
        - HUMAN_AGENT
    ChatMessageFeedback:
      type: string
      enum:
        - POSITIVE
        - NEGATIVE
    RetrievalOrigin:
      type: string
      enum:
        - TOOL
        - PREFETCH
        - PRODUCT_FINDER
    RetrievedSourceDto:
      type: object
      properties:
        sourceId:
          type: string
          nullable: true
          example: clx1source
        productId:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
          description: Q&A question, text title, URL or file name.
        type:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/KnowledgeSourceType'
        score:
          type: number
          description: Best similarity score of its chunks, 0 to 1.
      required:
        - sourceId
        - productId
        - title
        - type
        - score
    KnowledgeSourceType:
      type: string
      enum:
        - DOC
        - QA
        - LINK
        - TEXT
        - SITEMAP
        - NOTION
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

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