> ## 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 a knowledge gap

> Resolve or dismiss a gap with POST /v1/agents/{agentId}/knowledge/suggestions/{gapId}/resolve or /dismiss (knowledge:write).



## OpenAPI

````yaml /api-reference/openapi.json get /v1/agents/{agentId}/gaps/{gapId}
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}/gaps/{gapId}:
    get:
      tags:
        - Knowledge gaps
      summary: Get a knowledge gap
      description: >-
        Resolve or dismiss a gap with POST
        /v1/agents/{agentId}/knowledge/suggestions/{gapId}/resolve or /dismiss
        (knowledge:write).
      operationId: PublicApiGapsController_get
      parameters:
        - name: gapId
          required: true
          in: path
          schema:
            type: string
        - name: agentId
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeGapDetailDto'
        '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:
    KnowledgeGapDetailDto:
      type: object
      properties:
        id:
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/KnowledgeSuggestionStatus'
        question:
          type: string
          description: The question customers ask, normalised.
        category:
          type: string
        verification:
          nullable: true
          description: >-
            MISSING: not in knowledge. PARTIAL: partly covered. RETRIEVAL_MISS:
            the knowledge covers it but search did not find it. Null: not
            checked yet.
          allOf:
            - $ref: '#/components/schemas/KnowledgeGapVerification'
        verificationLabel:
          type: string
          example: Not in knowledge
        verifiedAt:
          type: string
          nullable: true
          format: date-time
        signals:
          type: array
          description: >-
            JUDGE: the reply was judged weak. NEGATIVE_FEEDBACK: thumbs-down.
            HANDOVER: handed to a person.
          items:
            $ref: '#/components/schemas/KnowledgeGapSignal'
        occurrences:
          type: number
          description: Conversations it came up in.
        sampleQuestions:
          description: >-
            How customers asked it. Emails and phone numbers are masked unless
            the key has customers:read.
          type: array
          items:
            type: string
        suggestedAnswerDraft:
          type: string
          nullable: true
          description: >-
            A draft answer taken from a team member reply to this question.
            Emails and phone numbers are always masked.
        suggestedAction:
          type: string
        reasoning:
          type: string
        impactScore:
          type: number
        conversationIds:
          type: array
          items:
            type: string
        evidence:
          description: >-
            Knowledge excerpts the verification found (for PARTIAL and
            RETRIEVAL_MISS).
          type: array
          items:
            $ref: '#/components/schemas/GapEvidenceDto'
        retest:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GapRetestDto'
        resolvedBySourceId:
          type: string
          nullable: true
        resolvedAt:
          type: string
          nullable: true
          format: date-time
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - status
        - question
        - category
        - verification
        - verificationLabel
        - verifiedAt
        - signals
        - occurrences
        - sampleQuestions
        - suggestedAnswerDraft
        - suggestedAction
        - reasoning
        - impactScore
        - conversationIds
        - evidence
        - retest
        - resolvedBySourceId
        - resolvedAt
        - createdAt
    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
    KnowledgeSuggestionStatus:
      type: string
      enum:
        - PENDING
        - DISMISSED
        - RESOLVED
    KnowledgeGapVerification:
      type: string
      enum:
        - MISSING
        - PARTIAL
        - RETRIEVAL_MISS
    KnowledgeGapSignal:
      type: string
      enum:
        - JUDGE
        - NEGATIVE_FEEDBACK
        - HANDOVER
    GapEvidenceDto:
      type: object
      properties:
        sourceId:
          type: string
          nullable: true
        score:
          type: number
        excerpt:
          type: string
          description: The knowledge excerpt the check found.
      required:
        - sourceId
        - score
        - excerpt
    GapRetestDto:
      type: object
      properties:
        status:
          allOf:
            - $ref: '#/components/schemas/KnowledgeGapRetestStatus'
        testedAt:
          type: string
          nullable: true
          format: date-time
      required:
        - status
        - testedAt
    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
    KnowledgeGapRetestStatus:
      type: string
      enum:
        - PENDING
        - PASSED
        - FAILED
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

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