---
title: "Upload To Existing Kb"
method: POST
path: "/knowledge_bases/v2/{kb_id}/upload"
tags: ["Knowledge Bases V2"]
deprecated: true
---

# Upload To Existing Kb

`POST /knowledge_bases/v2/{kb_id}/upload`

> **Deprecated.**

Upload a new document version to an existing knowledge base.

This endpoint supports two modes:
1. **File Upload**: Provide 'file' parameter with document (PDF, DOCX, MD, TXT)
2. **Markdown Content**: Provide 'markdown_content' parameter with markdown text

Process:
1. Validates knowledge base exists and user has access
2. Creates document record (gets version number)
3. Uploads content to S3 with kb_id/version path
4. Updates document with S3 path
5. Returns document info for async processing

The new version will become active only after processing completes successfully.
The previous version remains active until the new one is ready.

Note: You must provide either 'file' OR 'markdown_content', but not both.

## Path parameters

- `kb_id` integer, required

## Response `201`

Successful Response

- KnowledgeDocumentUploadResponse — Response after uploading a knowledge base document
  - `success` boolean, required
  - `document_id` integer, required
  - `document_public_id` string, required
  - `knowledge_base_id` integer, required
  - `version` integer, required
  - `processing_status` string, required
  - `celery_task_id` string, nullable
  - `message` string, nullable

## Other responses

- `400` — Invalid file or upload error
- `404` — Knowledge base not found
- `413` — File too large
- `422` — Validation Error

---

[API](https://skmtc.net/myaltimate/apis/fastapi.md) · [All operations](https://skmtc.net/myaltimate/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myaltimate/fastapi/versions/103580dad816/schema)
