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

# Create knowledge base

> Creates a knowledge base (current behavior).

## Notes

* Supports mixed sources (texts, URLs, files)


## OpenAPI

````yaml post /api/knowledge-bases/create-knowledge-base
openapi: 3.0.3
info:
  title: Zudu API
  description: >-
    Comprehensive REST API for LiveKit Backend - Call Management, Agent
    Configuration, and Real-time Communication Services
  version: 1.0.0
  contact:
    name: Zudu AI Team
    url: https://zudu.ai
    email: support@zudu.ai
  license:
    name: Proprietary
    url: https://zudu.ai/license
servers:
  - url: https://api.zudu.ai
    description: Production (Customer-facing)
security:
  - apiKey: []
    apiSecret: []
tags:
  - name: Agent Management
    description: Create and manage AI agents
  - name: Call Data Management
    description: Call records and history
  - name: Customer API Keys
    description: Manage API keys
  - name: Post-Call Webhooks
    description: Webhook configuration
  - name: phone-number-controller
    description: Phone numbers
  - name: batch-call-controller
    description: Batch calls
  - name: MCP Server Management
    description: MCP servers
  - name: Knowledge Base Management
    description: Knowledge bases
  - name: Call Analysis
    description: Call analysis
paths:
  /api/knowledge-bases/create-knowledge-base:
    post:
      tags:
        - Knowledge Base Management
      summary: Create knowledge base
      description: >-
        Creates a new knowledge base with optional text, URL, and file sources.
        Uses multipart/form-data. Supports mixed sources; uses Azure Blob
        Storage for file sources. Requires orgId header.
      operationId: createKnowledgeBase
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - knowledge_base_name
              properties:
                knowledge_base_name:
                  type: string
                  description: Knowledge base name
                knowledge_base_texts:
                  type: string
                  description: >-
                    JSON array of text sources, e.g. [{"text": "...", "title":
                    "..."}]
                knowledge_base_urls:
                  type: string
                  description: JSON array of URL strings
                knowledge_base_files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: >-
                    File uploads (.txt, .pdf, .doc, .docx, .md, .csv, .json; max
                    50MB)
                enable_auto_refresh:
                  type: boolean
                  default: true
                  description: 'Enable auto-refresh (optional, default: true)'
            example:
              knowledge_base_name: Customer Support KB
              knowledge_base_texts: >-
                [{"text": "This is sample knowledge content.", "title": "Sample
                Knowledge"}]
              enable_auto_refresh: true
      responses:
        '200':
          description: Knowledge base created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseKnowledgeBase'
              example:
                message: Knowledge base created successfully
                status: success
                error: null
                data:
                  knowledge_base_id: knowledge_base_abc123
                  organization_id: your-org-id
                  knowledge_base_name: Customer Support KB
                  status: ready
                  enable_auto_refresh: true
                  last_refreshed_timestamp: 1704067200000
                  knowledge_base_sources: []
                  created_at: '2024-01-01T00:00:00Z'
                  updated_at: '2024-01-01T00:00:00Z'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseKnowledgeBase'
              example:
                message: Validation error
                status: error
                error: Knowledge base name is required
                data: null
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseKnowledgeBase'
              example:
                message: Failed to create knowledge base
                status: error
                error: Azure Storage connection failed
                data: null
components:
  schemas:
    ApiResponseKnowledgeBase:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
        error:
          type: string
        data:
          $ref: '#/components/schemas/KnowledgeBase'
    KnowledgeBase:
      type: object
      properties:
        knowledge_base_id:
          type: string
        organization_id:
          type: string
        knowledge_base_name:
          type: string
        status:
          type: string
          enum:
            - draft
            - in_progress
            - ready
            - failed
        enable_auto_refresh:
          type: boolean
        last_refreshed_timestamp:
          type: integer
          format: int64
        knowledge_base_sources:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBaseSource'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        access_info:
          type: object
          additionalProperties:
            type: object
        agent_info:
          type: array
          items:
            $ref: '#/components/schemas/AgentInfo'
    KnowledgeBaseSource:
      type: object
      properties:
        textSource:
          type: boolean
        urlSource:
          type: boolean
        documentSource:
          type: boolean
        source_id:
          type: string
        knowledge_base_id:
          type: string
        type:
          type: string
          enum:
            - text
            - url
            - document
        filename:
          type: string
        file_url:
          type: string
        title:
          type: string
        text:
          type: string
        url:
          type: string
        azure_blob_path:
          type: string
        file_size:
          type: integer
          format: int64
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
        processing_error:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    AgentInfo:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key for MCP server and external service authentication
      name: X-API-KEY
      in: header
    apiSecret:
      type: apiKey
      description: API Secret for MCP server and external service authentication
      name: X-API-SECRET
      in: header

````