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

# List Documents

> Returns all documents in a knowledge base.
Requires `knowledge:view` permission.




## OpenAPI

````yaml GET /api/knowledge-bases/{id}/documents
openapi: 3.1.0
info:
  title: Naturalead Knowledge Bases API
  version: 1.0.0
  description: >
    API for managing knowledge bases, documents, sitemap crawl jobs, and webhook

    sources in the Naturalead platform. All endpoints require API key
    authentication

    and are scoped to the caller's account.
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - BearerAuth: []
tags:
  - name: Knowledge Bases
    description: Knowledge base CRUD operations
  - name: Documents
    description: Document management within a knowledge base
  - name: Sitemap & Crawl Jobs
    description: Sitemap scanning and web crawl job management
  - name: Webhook Sources
    description: Webhook source management for auto-updating content
paths:
  /api/knowledge-bases/{id}/documents:
    get:
      tags:
        - Documents
      summary: List documents
      description: |
        Returns all documents in a knowledge base.
        Requires `knowledge:view` permission.
      operationId: listDocuments
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseId'
      responses:
        '200':
          description: List of documents
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Document'
components:
  parameters:
    KnowledgeBaseId:
      name: id
      in: path
      required: true
      description: Knowledge base ID
      schema:
        type: string
  schemas:
    Document:
      type: object
      properties:
        _id:
          type: string
          description: Unique identifier
        knowledgeBaseId:
          type: string
          description: Parent knowledge base ID
        accountId:
          type: string
          description: Owning account ID
        title:
          type: string
          description: Document title
        sourceType:
          type: string
          description: Type of source content
        content:
          type: string
          description: Document content
        sourceUrl:
          type: string
          description: URL where the content was sourced from
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - _id
        - knowledgeBaseId
        - accountId
        - title
        - sourceType
        - content
        - createdAt
        - updatedAt
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````