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

# Upload Document

> Upload a document to an assistant's knowledge base.

This endpoint allows you to upload a document to an assistant's knowledge base for Retrieval-Augmented Generation (RAG). The document will be processed, chunked, and stored as embeddings in a vector database.

The request must be sent as `multipart/form-data`.

### Path Parameters

* `assistant_id` (string, **required**): The unique identifier of the assistant to whom the document will be added.

### Form Data

* `file` (file, **required**): The document to upload. Supported file types include `.txt`, `.pdf`, `.md`, and `.docx`.

### Response

A successful request will immediately return a document object with a `processing` status. The document will be processed in the background. You can check the status later using the [Get Document Status](/api-reference/assistants/documents/get-status) endpoint.

```json Response theme={null}
{
  "id": "doc_1234567890",
  "user_id": "user_12345",
  "organization_id": "org_67890",
  "assistant_id": "asst_a1b2c3d4e5f67890",
  "name": "product_faq.pdf",
  "status": "processing",
  "created_at": "2023-10-28T16:00:00Z",
  "updated_at": "2023-10-28T16:00:00Z"
}
```


## OpenAPI

````yaml POST /api/v1/assistants/{assistant_id}/documents/upload
openapi: 3.1.0
info:
  title: Burki
  description: A system that uses AI to answer customer Calls.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/assistants/{assistant_id}/documents/upload:
    post:
      tags:
        - assistants
      summary: Upload Document
      description: Upload a document to an assistant's knowledge base.
      operationId: upload_document_api_v1_assistants__assistant_id__documents_upload_post
      parameters:
        - name: assistant_id
          in: path
          required: true
          schema:
            type: integer
            title: Assistant Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_document_api_v1_assistants__assistant_id__documents_upload_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_upload_document_api_v1_assistants__assistant_id__documents_upload_post:
      properties:
        file:
          type: string
          format: binary
          title: File
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        tags:
          anyOf:
            - type: string
            - type: 'null'
          title: Tags
      type: object
      required:
        - file
      title: >-
        Body_upload_document_api_v1_assistants__assistant_id__documents_upload_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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````