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

# List knowledge base documents

> List the Q&A document rows held in the vector store (the document plane; the singular `/knowledge-base` path). Pass `knowledge_base_id` to scope to one collection, or omit it for the workspace-wide 'all documents' view. Agent-session tokens are rejected here (they may only search). Scope `knowledge_base:read`.



## OpenAPI

````yaml /api-reference/openapi.json get /knowledge-base
openapi: 3.1.0
info:
  title: Lehar API
  version: v0
  description: >-
    Customer-facing REST API for the Lehar voice-AI platform. Platform-admin
    endpoints are intentionally excluded from this reference. Regenerate with
    `npm run sync:openapi`.
servers:
  - url: https://api.lehar.ai/ca/api/v0
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /knowledge-base:
    get:
      tags:
        - Knowledge Base
      summary: List knowledge base documents
      description: >-
        List the Q&A document rows held in the vector store (the document plane;
        the singular `/knowledge-base` path). Pass `knowledge_base_id` to scope
        to one collection, or omit it for the workspace-wide 'all documents'
        view. Agent-session tokens are rejected here (they may only search).
        Scope `knowledge_base:read`.
      operationId: list_knowledge_base_ca_api_v0_knowledge_base_get
      parameters:
        - name: knowledge_base_id
          in: query
          required: false
          description: >-
            Restrict the listing to one knowledge base. Omit to list every
            document in the workspace (the management 'all documents' view).
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Max rows to return. Defaults to 50 and is capped at 100.
          schema:
            type: integer
            default: 50
            maximum: 100
            minimum: 0
        - name: offset
          in: query
          required: false
          description: Number of rows to skip. Defaults to 0.
          schema:
            type: integer
            default: 0
            minimum: 0
      responses:
        '200':
          description: >-
            Page of Q&A document rows. `total` is the count for the selected
            scope (one KB, or the whole workspace when `knowledge_base_id` is
            omitted).
          content:
            application/json:
              example:
                data:
                  - id: b7e6f0a4-2c1d-5f3a-9b8c-1d2e3f4a5b6c
                    question: What are your support hours?
                    response: Our team is available 9am to 6pm IST, Monday to Friday.
                    knowledge_base_id: kb_01jq8x9m2h4z7c0r5v3b8t6n1e
                    created_at: '2026-09-02T10:20:00Z'
                pagination:
                  limit: 50
                  offset: 0
                  total: 1
        '400':
          description: limit/offset are not non-negative integers.
          content:
            application/json:
              example:
                error:
                  code: invalid_request
                  message: limit and offset must be non-negative integers
        '401':
          description: No valid authentication was supplied.
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: Authentication required
        '403':
          description: >-
            The caller lacks `knowledge_base:read`, or is an agent-session token
            (which may only search).
          content:
            application/json:
              example:
                error:
                  code: forbidden
                  message: Agent session tokens can only search the knowledge base
        '500':
          description: Unexpected server error.
          content:
            application/json:
              example:
                error:
                  code: internal_error
                  message: An unexpected error occurred
        '503':
          description: No vector store is configured, so the document plane is unavailable.
          content:
            application/json:
              example:
                error:
                  code: service_unavailable
                  message: Knowledge base service is not configured
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    BearerAuth:
      type: http
      scheme: bearer

````