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

# Create Knowledge Base

> This endpoint used to create the new knowledge base in the Pawa AI Platform.



## OpenAPI

````yaml POST /store/knowledge-base
openapi: 3.1.0
info:
  title: Pawa AI APIs
  description: >-
    API endpoints in Pawa Platform to perform CRUD operations on different
    features using Pawa AI, a digital assistant built for Africa for various
    tasks.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.pawa-ai.com/v1
    description: Production Server
security:
  - bearerAuth: []
paths:
  /store/knowledge-base:
    post:
      tags:
        - Create a knowledge base (KB)
      summary: Create a knowledge base (KB)
      description: >-
        This endpoint used to create the new knowledge base in the Pawa AI
        Platform.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                knowledgeBase:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: >-
                    One or more files to create a Knowledge Base (PDF, DOCX,
                    TXT, Excell, PPT, html, audio, images).
                name:
                  type: string
                  default: Pawa Knowledge Base
                  description: The name of the knowledge base
                  minimum: 3
                description:
                  type: string
                  default: This is a sample knowledge base for Pawa.
                  description: The description of the knowledge base
                  minimum: 250
              required:
                - knowledgeBase
                - name
                - description
      responses:
        '200':
          description: Knowledge base created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KBCreateResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                badRequest:
                  value:
                    success: false
                    message: Invalid input provided
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  value:
                    success: false
                    message: Unauthorized access
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                forbidden:
                  value:
                    success: false
                    message: You do not have permission to access this resource
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  value:
                    success: false
                    message: Resource does not exist
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                tooManyRequests:
                  value:
                    success: false
                    message: Rate limit exceeded. Please try again later.
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                serverError:
                  value:
                    success: false
                    message: Internal server error
components:
  schemas:
    KBCreateResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Knowledge base created successfully
        data:
          $ref: '#/components/schemas/KBData'
      required:
        - success
        - message
        - data
    ErrorResponse:
      required:
        - success
        - message
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: An error occurred
    KBData:
      type: object
      properties:
        id:
          type: number
          example: 21
        name:
          type: string
          example: WCF Knowledge Base
        kbReferenceId:
          type: string
          example: kb-5d76835d-fe3e-4793-b0d6-f2e1a668eb5d
        description:
          type: string
          example: >-
            This is a knowledge base for WCF, it contains information about
            various concerns about Workers Compesation Fund., it is used to
            answer questions about WCF
        status:
          type: string
          example: ACTIVE
        createdAt:
          format: date-time
          type: string
          example: '2025-08-04T16:35:37.522Z'
        updatedAt:
          format: date-time
          type: string
          example: '2025-08-04T16:35:37.522Z'
      required:
        - id
        - name
        - kbReferenceId
        - description
        - status
        - createdAt
        - updatedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````