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

# List documents

> List knowledge base documents with optional parent filtering.



## OpenAPI

````yaml get /api/kb/documents
openapi: 3.1.0
info:
  title: CRM Backend
  description: >

    CRM Backend API for managing contacts, companies, deals, activities, and
    AI-powered chat.


    ## Authentication


    Protected endpoints accept either:


    - **JWT (Bearer)**: `Authorization: Bearer <jwt>` with `X-Account-ID` header

    - **API Key**: `Authorization: Bearer sk_xxx` or `X-API-Key: sk_xxx`


    API keys are created in Developer Settings and provide account-level access.
  version: 0.1.0
servers:
  - url: https://api.morphic.io
    description: Production
security: []
tags:
  - name: Contacts
    description: Manage contacts (people) in the CRM.
  - name: Companies
    description: Manage companies and their teams.
  - name: Deals
    description: Manage deals and pipeline stages.
  - name: Activities
    description: Log and track activities (calls, meetings, tasks).
  - name: Notes
    description: Create and manage notes attached to CRM entities.
  - name: Favorites
    description: Bookmark records and organize them into folders.
  - name: Exports
    description: Export CRM data to CSV files.
  - name: Imports
    description: Import data into the CRM from CSV files.
  - name: Email Drafts
    description: Create, manage, and send email drafts.
  - name: Email Templates
    description: Create and manage reusable email templates.
  - name: Knowledge Base
    description: Manage knowledge base documents and pages.
  - name: Chats
    description: AI-powered chat conversations and messages.
  - name: Cortex Search
    description: Semantic search and AI-powered Q&A over CRM data.
  - name: Custom Fields
    description: Define and manage custom field definitions and values.
  - name: Categories
    description: Organize CRM entities with categories and tags.
  - name: Transcription
    description: Transcribe audio files using AI.
paths:
  /api/kb/documents:
    get:
      tags:
        - Knowledge Base
      summary: List documents
      description: List knowledge base documents with optional parent filtering.
      operationId: list-kb-documents
      parameters:
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search in title and content
            title: Search
          description: Search in title and content
        - name: visibility
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by visibility
            title: Visibility
          description: Filter by visibility
        - name: parent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Omit or null = root only; uuid = direct children of that folder
            title: Parent Id
          description: Omit or null = root only; uuid = direct children of that folder
        - name: type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Filter by type: ''folder'' or ''page'''
            title: Type
          description: 'Filter by type: ''folder'' or ''page'''
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 100
            title: Page Size
        - name: x-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Account-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_KBDocument_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
components:
  schemas:
    PaginatedResponse_KBDocument_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/KBDocument'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        pages:
          type: integer
          title: Pages
      type: object
      required:
        - items
        - total
        - page
        - page_size
        - pages
      title: PaginatedResponse[KBDocument]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KBDocument:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        type:
          type: string
          title: Type
        title:
          type: string
          maxLength: 255
          title: Title
          description: Document title
        slug:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Slug
          description: URL-friendly slug (auto-generated if not provided)
        content:
          anyOf:
            - type: object
            - type: 'null'
          title: Content
          description: BlockNote block structure (JSON); null for folders
        content_markdown:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Markdown
          description: Rendered markdown for AI context; null for folders
        visibility:
          type: string
          title: Visibility
          description: 'Document visibility: ''private'' or ''public'''
          default: private
        parent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Id
        position:
          type: integer
          title: Position
          description: Position for ordering
          default: 0
        account_id:
          type: string
          format: uuid
          title: Account Id
        children_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Children Count
          description: For folders, number of direct children (only in list/get)
      type: object
      required:
        - id
        - created_at
        - updated_at
        - type
        - title
        - account_id
      title: KBDocument
    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
  securitySchemes:
    APIKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key (sk_xxx) from Developer Settings. No X-Account-ID needed.

````