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

# Create Knowledge Base

> Create a new knowledge base from existing knowledge items



## OpenAPI

````yaml /api-reference/openapi.json post /v1/knowledge/base/
openapi: 3.1.0
info:
  title: Diga API
  version: 0.1.0
servers:
  - url: https://api.diga.io
    description: Production
security: []
paths:
  /v1/knowledge/base/:
    post:
      tags:
        - Knowledge Bases
      summary: Create Knowledge Base
      description: Create a new knowledge base from existing knowledge items
      operationId: create_knowledge_base_v1_knowledge_base__post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeBaseCreateSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - CustomHTTPBearer: []
components:
  schemas:
    KnowledgeBaseCreateSchema:
      properties:
        name:
          type: string
          title: Knowledge Base Name
          description: Name for the new knowledge base
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Knowledge Base Description
          description: Optional description for the new knowledge base
        knowledge_item_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Knowledge Item IDs
          description: Optional list of knowledge item IDs to associate with the base
      type: object
      required:
        - name
      title: KnowledgeBaseCreateSchema
    KnowledgeBaseResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Knowledge Base ID
          description: Unique identifier for the knowledge base
        name:
          type: string
          title: Knowledge Base Name
          description: Name of the knowledge base
        created_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created Date
          description: When the base was created
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Knowledge Base Description
          description: Optional description of the knowledge base
        knowledge_item_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Knowledge Item IDs
          description: List of knowledge item IDs associated with this base
        item_count:
          type: integer
          title: Item Count
          description: Number of knowledge items in this base
      type: object
      required:
        - id
        - name
        - knowledge_item_ids
        - item_count
      title: KnowledgeBaseResponseSchema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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:
    CustomHTTPBearer:
      type: http
      scheme: bearer

````