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

# Search current active indexed knowledge

> Semantic lookup in current active knowledge (up to twenty chunks), including returned sourceId/chunkId for get_knowledge_source/get_knowledge_chunk. Omitted scope filters search the whole connected business; propertyIds selects properties and includeGlobal controls shared knowledge (default true when scoped). This may call the embedding provider. mode=fallback_all means a bounded unranked fallback, not a successful semantic match; totalActive is an eligible count, not returned count. This differs from the runtime planner/scanner and never reproduces a saved answer. Use get_conversation_answer_trace for saved evidence before a new lookup. Inactive knowledge and asset-only uploads are excluded. Required permission: knowledge:read. Connected business only; no tenant override.



## OpenAPI

````yaml /openapi.json post /knowledge/sources/search
openapi: 3.0.3
info:
  title: Visito M2M API
  version: 1.0.0
  description: >-
    Tenant-scoped server-to-server API for channels, conversations, commerce,
    custom AI tools, and WhatsApp templates. Send operations are asynchronous
    and return queued acknowledgements. Expansion adds conversation controls,
    knowledge, sales opportunities, delivery status, reporting, and signed
    webhooks.
servers:
  - url: https://platform-api.visitoai.com/m2m/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Channels
  - name: Conversations
  - name: Commerce
  - name: Custom tools
  - name: WhatsApp templates
  - name: Properties
  - name: Knowledge
  - name: Sales CRM
  - name: Delivery
  - name: Reporting
  - name: Webhooks
paths:
  /knowledge/sources/search:
    post:
      summary: Search current active indexed knowledge
      description: >-
        Semantic lookup in current active knowledge (up to twenty chunks),
        including returned sourceId/chunkId for
        get_knowledge_source/get_knowledge_chunk. Omitted scope filters search
        the whole connected business; propertyIds selects properties and
        includeGlobal controls shared knowledge (default true when scoped). This
        may call the embedding provider. mode=fallback_all means a bounded
        unranked fallback, not a successful semantic match; totalActive is an
        eligible count, not returned count. This differs from the runtime
        planner/scanner and never reproduces a saved answer. Use
        get_conversation_answer_trace for saved evidence before a new lookup.
        Inactive knowledge and asset-only uploads are excluded. Required
        permission: knowledge:read. Connected business only; no tenant override.
      operationId: searchKnowledge
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeSearchInput'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeSearch'
        '400':
          description: Invalid request
        '403':
          description: Missing permission
        '404':
          description: Resource not found
        '409':
          description: Conflict; read state and reconcile
components:
  schemas:
    KnowledgeSearchInput:
      type: object
      additionalProperties: false
      properties:
        query:
          type: string
          maxLength: 2000
          description: >-
            Search terms for current active indexed knowledge. This performs a
            new semantic lookup; it is not a saved-answer replay.
          minLength: 1
        topK:
          type: integer
          minimum: 1
          maximum: 20
        sourceType:
          type: string
          enum:
            - text
            - file
            - url
        propertyIds:
          type: array
          items:
            type: string
            maxLength: 128
          maxItems: 50
        includeGlobal:
          type: boolean
      required:
        - query
    KnowledgeSearch:
      type: object
      additionalProperties: false
      properties:
        mode:
          type: string
          enum:
            - vector
            - all
            - fallback_all
            - empty_query
        totalActive:
          type: integer
          minimum: 0
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeSearchChunk'
          maxItems: 20
      required:
        - mode
        - totalActive
        - chunks
    KnowledgeSearchChunk:
      type: object
      additionalProperties: false
      properties:
        chunkId:
          type: string
          maxLength: 128
        chunkIndex:
          type: integer
          minimum: 0
        sourceId:
          type: string
          maxLength: 128
        sourceType:
          type: string
          enum:
            - text
            - file
            - url
        propertyId:
          type: string
          maxLength: 128
        propertyName:
          type: string
          maxLength: 160
        title:
          type: string
          maxLength: 160
        text:
          type: string
          maxLength: 4000000
        score:
          type: number
        url:
          type: string
          maxLength: 2048
        tokens:
          type: integer
          minimum: 0
      required:
        - sourceId
        - sourceType
        - text
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Visito M2M API key
      description: Server-side tenant-scoped credential created from Build > API Keys.

````

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