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

# Batch upload knowledge base sources

> Upload multiple raw text sources to the knowledge base



## OpenAPI

````yaml /swagger.yml post /public/knowledge-base/batch
openapi: 3.0.0
info:
  title: Public API Docs
  description: Clerk Public API
  version: '1.0'
  contact: {}
servers:
  - url: https://web-api.clerk.chat
    description: Production server
  - url: http://localhost:3000
    description: Production server
security: []
tags: []
paths:
  /public/knowledge-base/batch:
    post:
      tags:
        - Knowledge Base
      summary: Batch upload knowledge base sources
      description: Upload multiple raw text sources to the knowledge base
      operationId: PublicKnowledgeBaseController_batchUploadRaw
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadSourceBatchRequest'
      responses:
        '201':
          description: Batch upload initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadSourceBatchResponse'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized request
        '403':
          description: You do not have permission to access this resource
        '404':
          description: Resource not found
        '422':
          description: Invalid request parameters
        '429':
          description: Too many requests for this resource
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    UploadSourceBatchRequest:
      type: object
      properties:
        sources:
          description: The list of sources to upload
          type: array
          items:
            $ref: '#/components/schemas/UploadSourceRequest'
        upsert:
          type: boolean
          description: >-
            If true, updates existing sources with matching titles. If false,
            creates new sources (default: false)
          example: false
      required:
        - sources
    UploadSourceBatchResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SourceResponse'
        total:
          type: number
          description: The total number of sources uploaded
          example: 1
      required:
        - data
        - total
    UploadSourceRequest:
      type: object
      properties:
        title:
          type: string
          maxLength: 200
          description: The title of the source
          example: RCS Overview
        content:
          type: string
          description: The content of the source
          example: RCS is a revolutionary customer support tool...
      required:
        - title
        - content
    SourceResponse:
      type: object
      properties:
        id:
          type: number
          description: The ID of the knowledge source
        title:
          type: string
          description: The title of the knowledge source
        status:
          enum:
            - init
            - parsed
            - parse_fail
            - split_fail
            - split_finished
            - embed_failed
            - done
          type: string
          description: The status of the knowledge source
          example: processing
      required:
        - id
        - title
        - status
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apiKey

````