---
title: "Upload Document"
method: POST
path: "/api/v1/knowledge-bases/{kb_id}/documents"
tags: ["Knowledge Bases", "Knowledge Bases"]
---

# Upload Document

`POST /api/v1/knowledge-bases/{kb_id}/documents`

Upload a document to a knowledge base.

The document will be processed asynchronously. Check the status field to
monitor processing progress.

## Path parameters

- `kb_id` string, uuid, required

## Response `201`

Successful Response

- KnowledgeBaseDocumentRead
  - `id` string, uuid, required
  - `tenant_id` string, uuid, required
  - `knowledge_base_id` string, uuid, required
  - `document_id` string, uuid, required
  - `title` string, required
  - `source_type` string, required
  - `status` 'WAITING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED', required
  - `error_message` string, nullable, required
  - `chunk_count` integer, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-03** `d65b8fefae34` — 1 breaking, 3 info
  - the `file` request property contentMediaType changed from `` to `application/octet-stream`
  - the `file` request property format was generalized from `binary` to no format
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status

[Change history](https://skmtc.dev/getanana/apis/cleon-api/changes/api/v1/knowledge-bases/:kb_id/documents/post.md)

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getanana/apis/cleon-api/revisions/5ebfe310b84c?raw)
