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

# List Documents

> Lists the documents in a knowledge base.

The data array is heterogeneous: each element is either a file document or a website document. Discriminate on document_type before reading type-specific fields.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/knowledge-bases/{kb_id}/documents
openapi: 3.1.0
info:
  title: Verbex Platform API
  description: API for managing AI agents, calls, phone numbers, and more.
  version: 1.0.0
servers: []
security: []
tags:
  - name: Knowledge Bases
    description: >-
      Create and manage knowledge bases, ingest documents into them, and search
      them semantically.


      **Authentication.** Every request carries a bearer token: `Authorization:
      Bearer <API_TOKEN>`. That is the only credential a client sends. The
      gateway resolves your identity from it and injects the tenant headers the
      service reads internally, so clients never send `x-user-org-id` or
      `x-verbex-id` themselves.


      **Tenancy is enforced on every route.** A knowledge base belongs to one
      organization and one user. Requesting one your token does not own returns
      `404 Knowledge base not found`, never `403`. This is deliberate: a
      nonexistent ID, a malformed ID and someone else's ID are indistinguishable
      in the response, so the API cannot be used to probe for other tenants'
      data. If you get a `404` on an ID you are certain exists, suspect the
      token before you suspect the ID.


      **Ingestion is asynchronous.** File upload and website crawl both answer
      `202` as soon as the material is stored and the job is queued. Parsing,
      chunking, embedding and indexing happen afterwards in a worker. Poll the
      document status endpoint until it reports `completed` before expecting
      search to see the content. That gap is the most common source of "why
      isn't my data showing up".


      **There is no document update endpoint.** Every submission mints a new
      `document_id`, so re-uploading a file or re-crawling the same URLs creates
      a second document while the first remains. To refresh material, delete
      then resubmit — and note that the sequence is not atomic.
paths:
  /api/v1/knowledge-bases/{kb_id}/documents:
    get:
      tags:
        - Knowledge Bases
      summary: List Documents
      description: >-
        Lists the documents in a knowledge base.


        The data array is heterogeneous: each element is either a file document
        or a website document. Discriminate on document_type before reading
        type-specific fields.
      operationId: list_documents_api_v1_knowledge_bases__kb_id__documents_get
      parameters:
        - name: kb_id
          in: path
          required: true
          schema:
            type: string
            title: Kb Id
          description: Knowledge Base ID.
      responses:
        '200':
          description: A page of documents.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentListResponse'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseErrorResponse'
        '404':
          description: >-
            Knowledge base not found, or not owned by your tenant. The two cases
            are deliberately indistinguishable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: >-
            Service unavailable. A database failure, not a problem with your
            payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseErrorResponse'
components:
  schemas:
    DocumentListResponse:
      properties:
        data:
          items:
            oneOf:
              - $ref: '#/components/schemas/FileDocumentResponse'
              - $ref: '#/components/schemas/WebsiteDocumentResponse'
            discriminator:
              propertyName: document_type
              mapping:
                file:
                  $ref: '#/components/schemas/FileDocumentResponse'
                website:
                  $ref: '#/components/schemas/WebsiteDocumentResponse'
          type: array
          title: Data
          description: >-
            Documents for the current page. A heterogeneous array - discriminate
            each element on document_type.
        next_page_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Page Token
          description: Opaque cursor for the next page. Null when there are no more pages.
      type: object
      required:
        - data
      title: DocumentListResponse
      description: Cursor-paginated list of documents.
    KnowledgeBaseErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A short error code identifying the type of error that occurred.
        message:
          type: string
          title: Message
          description: >-
            A detailed human-readable message explaining the error and possible
            solutions.
      type: object
      required:
        - error
        - message
      title: KnowledgeBaseErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FileDocumentResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the file document.
        document_type:
          type: string
          const: file
          title: Document Type
          description: 'Discriminator: this entry is a file document.'
        document_language:
          $ref: '#/components/schemas/DocumentLanguage'
          description: Language detected in the document content.
          default: en
        filename:
          type: string
          title: Filename
          description: Original name of the uploaded file.
        file_type:
          type: string
          title: File Type
          description: MIME type of the uploaded file.
        chunk_count:
          type: integer
          title: Chunk Count
          description: Number of chunks indexed from this document.
          default: 0
      type: object
      required:
        - id
        - document_type
        - filename
        - file_type
      title: FileDocumentResponse
    WebsiteDocumentResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the website document.
        document_type:
          type: string
          const: website
          title: Document Type
          description: 'Discriminator: this entry is a website document.'
        page_urls:
          items:
            type: string
          type: array
          title: Page Urls
          description: Pages covered by this document.
          default: []
        chunk_count:
          type: integer
          title: Chunk Count
          description: Number of chunks indexed from this document.
          default: 0
      type: object
      required:
        - id
        - document_type
      title: WebsiteDocumentResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DocumentLanguage:
      type: string
      enum:
        - bn
        - en
        - ja
      title: DocumentLanguage
      description: Language of ingested document content.

````