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

# Upload a knowledge base document

> Uploads a document to a knowledge base store and queues it for processing. Accepts the file either as multipart/form-data (binary `file`) or as application/json (base64 `file`).



## OpenAPI

````yaml https://cool.jobmojito.com/functions/v1/openapi post /knowledge-base-document-upload
openapi: 3.1.0
info:
  title: JobMojito API
  version: 1.0.0
  description: >-
    Public API for JobMojito, served by Supabase Edge Functions. Authenticate
    with a Supabase JWT access token via the Authorization header.
servers:
  - url: https://cool.jobmojito.com/functions/v1
    description: Production
security: []
tags:
  - name: Interviews
    description: >-
      Create, configure and manage interview / coaching / assessment
      definitions.
  - name: Results
    description: >-
      Interview results, transcripts, reports, re-attempt requests and
      analytics.
  - name: Candidates
    description: List and manage candidates.
  - name: Knowledge base
    description: Upload documents used to generate knowledge-base interviews.
  - name: Resume & Form verification
    description: Pre-screen candidates from resumes and forms.
  - name: Admin
    description: >-
      Account administration — invite team/coaching users, manage sub-merchants
      and avatar templates.
paths:
  /knowledge-base-document-upload:
    post:
      tags:
        - Knowledge base
      summary: Upload a knowledge base document
      description: >-
        Uploads a document to a knowledge base store and queues it for
        processing. Accepts the file either as multipart/form-data (binary
        `file`) or as application/json (base64 `file`).
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/KnowledgeBaseDocumentUploadMultipart'
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeBaseDocumentUploadJson'
      responses:
        '200':
          description: The document was uploaded and queued for processing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseDocumentUploadResponse'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >-
            Server error (includes authorization failures and a missing/invalid
            file or store).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    KnowledgeBaseDocumentUploadMultipart:
      type: object
      properties:
        knowledge_base_store_id:
          type: string
          minLength: 1
          description: The knowledge base store to add the document to.
          example: d9d6f121-1230-48fd-b3a7-8b5a1e8db052
        name:
          type: string
          description: >-
            Document name (with extension). Falls back to the uploaded file name
            for multipart.
        merchant_id:
          type: string
          description: Override merchant id (admin / sub-merchant only).
        file:
          type: string
          description: The document file (binary).
          format: binary
      required:
        - knowledge_base_store_id
        - file
    KnowledgeBaseDocumentUploadJson:
      type: object
      properties:
        knowledge_base_store_id:
          type: string
          minLength: 1
          description: The knowledge base store to add the document to.
          example: d9d6f121-1230-48fd-b3a7-8b5a1e8db052
        name:
          type: string
          description: >-
            Document name (with extension). Falls back to the uploaded file name
            for multipart.
        merchant_id:
          type: string
          description: Override merchant id (admin / sub-merchant only).
        file:
          type: string
          minLength: 1
          description: The document file, base64-encoded.
      required:
        - knowledge_base_store_id
        - file
    KnowledgeBaseDocumentUploadResponse:
      type: object
      properties:
        knowledge_base_id:
          type: string
          description: Id of the created knowledge_base record.
      required:
        - knowledge_base_id
    Error:
      type: object
      properties:
        error:
          type: string
          example: Field is required.
        name:
          type: string
          example: interview_result_id
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase JWT access token, passed as `Authorization: Bearer <token>`.'

````