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

# Create a new knowledge base



## OpenAPI

````yaml https://blackbox.dasha.ai/swagger/v1/swagger.json post /api/v1/rag/kb
openapi: 3.0.4
info:
  title: Dasha BlackBox Agent API
  description: API for managing AI agents and calls
  contact:
    name: DashaAI Team
    email: support@dasha.ai
  version: v1
servers:
  - url: https://blackbox.dasha.ai
    description: Dasha BlackBox Agent API
security:
  - ApiKey: []
  - OAuth: []
tags:
  - name: ActivityLogs
  - name: Agents
  - name: AgentTestCases
  - name: CallResults
  - name: Calls
  - name: Chats
  - name: Copilot
  - name: CustomerData
  - name: Mcp
  - name: Media
  - name: Misc
  - name: PronunciationDictionaries
  - name: Providers
  - name: SipAliases
  - name: SipCredentials
  - name: SipPhoneNumbers
  - name: TextChat
  - name: TwilioProvider
  - name: Voice
  - name: WebhookTest
  - name: WebIntegrations
  - name: WebSocket
    description: WebSocket endpoints for real-time communication
paths:
  /api/v1/rag/kb:
    post:
      tags:
        - KnowledgeBase
      summary: Create a new knowledge base
      requestBody:
        description: Knowledge base creation request
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/KnowledgeBaseCreateRequest'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/KnowledgeBaseCreateRequest'
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/KnowledgeBaseCreateRequest'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/KnowledgeBaseCreateRequest'
      responses:
        '201':
          description: Created
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseInfo'
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseInfo'
            text/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseInfo'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema: {}
            application/json:
              schema: {}
            text/json:
              schema: {}
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema: {}
            application/json:
              schema: {}
            text/json:
              schema: {}
components:
  schemas:
    KnowledgeBaseCreateRequest:
      required:
        - name
        - type
      type: object
      properties:
        name:
          maxLength: 255
          minLength: 1
          type: string
        description:
          maxLength: 1000
          type: string
          nullable: true
        type:
          allOf:
            - $ref: '#/components/schemas/KnowledgeBaseType'
        settings:
          allOf:
            - $ref: '#/components/schemas/KnowledgeBaseSettings'
          nullable: true
        embeddingsName:
          maxLength: 255
          type: string
          nullable: true
      additionalProperties: false
    KnowledgeBaseInfo:
      type: object
      properties:
        id:
          type: string
          format: uuid
        customerId:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        type:
          allOf:
            - $ref: '#/components/schemas/KnowledgeBaseType'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        statistics:
          allOf:
            - $ref: '#/components/schemas/KnowledgeBaseStatistics'
          nullable: true
        settings:
          allOf:
            - $ref: '#/components/schemas/KnowledgeBaseSettings'
          nullable: true
        embeddingsName:
          type: string
          nullable: true
        status:
          allOf:
            - $ref: '#/components/schemas/KnowledgeBaseStatus'
      additionalProperties: false
    KnowledgeBaseType:
      enum:
        - Files
      type: string
    KnowledgeBaseSettings:
      type: object
      additionalProperties: false
    KnowledgeBaseStatistics:
      type: object
      properties:
        knowledgeBaseId:
          type: string
          format: uuid
        storageByDocumentType:
          type: object
          additionalProperties:
            type: integer
            format: int64
          nullable: true
        documentsByStatus:
          type: object
          properties:
            Uploaded:
              type: integer
              format: int32
            Queued:
              type: integer
              format: int32
            Processing:
              type: integer
              format: int32
            Indexed:
              type: integer
              format: int32
            Failed:
              type: integer
              format: int32
            Cancelled:
              type: integer
              format: int32
            PendingDelete:
              type: integer
              format: int32
            Deleting:
              type: integer
              format: int32
          additionalProperties: false
          nullable: true
      additionalProperties: false
    KnowledgeBaseStatus:
      enum:
        - Active
        - PendingDelete
        - Deleting
      type: string
  securitySchemes:
    ApiKey:
      type: http
      description: API Key Authentication (Bearer {key})
      scheme: Bearer
    OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://auth.dasha.ai/connect/authorize
          scopes:
            platform_api: Platform API

````