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

# Upload Document

> Upload a document. Returns 202 with a 'processing' document immediately;
extract/chunk/embed runs in the background (it can take minutes on a large
file). Poll GET /{kb_id}/documents/{doc_id} for the ready/failed transition.



## OpenAPI

````yaml /openapi.json post /v1/knowledge-bases/{kb_id}/documents
openapi: 3.1.0
info:
  title: TurnCall
  description: Production voice agent platform API
  version: 0.1.0
servers: []
security: []
paths:
  /v1/knowledge-bases/{kb_id}/documents:
    post:
      tags:
        - knowledge-bases
      summary: Upload Document
      description: >-
        Upload a document. Returns 202 with a 'processing' document immediately;

        extract/chunk/embed runs in the background (it can take minutes on a
        large

        file). Poll GET /{kb_id}/documents/{doc_id} for the ready/failed
        transition.
      operationId: upload_document_v1_knowledge_bases__kb_id__documents_post
      parameters:
        - name: kb_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Kb Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_document_v1_knowledge_bases__kb_id__documents_post
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: >-
                  Response Upload Document V1 Knowledge Bases  Kb Id  Documents
                  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_upload_document_v1_knowledge_bases__kb_id__documents_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
        - file
      title: Body_upload_document_v1_knowledge_bases__kb_id__documents_post
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````