---
title: "Uploads a document to a knowledge base"
method: POST
path: "/apiops/projects/{projectName}/knowledge-bases/{kbName}/documents/"
tags: ["KnowledgeBase"]
---

# Uploads a document to a knowledge base

`POST /apiops/projects/{projectName}/knowledge-bases/{kbName}/documents/`

## Request

- Base URL: `http://167.86.118.166:32080`
- URL: `http://167.86.118.166:32080/apiops/projects/{projectName}/knowledge-bases/{kbName}/documents/`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apinizer/apis/apinizer-management-apis/docs/apiops/projects/:projectName/knowledge-bases/:kbName/documents/post.ts> (a function with typed inputs; its response is checked against the schema)

Uploads a document (multipart) to the named knowledge base. Indexing is async — the returned document has status=PENDING.

## Path parameters

- `projectName` string, required
- `kbName` string, required

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: Document file to be uploaded

## Response `200`

successful operation!

- ApiOpsResponseKnowledgeDocument
  - `status` 'SUCCESS' | 'FAILURE'
  - `resultMessage` string
  - `resultList` AiKnowledgeDocumentDTO[]
    - `id` string
    - `knowledgeBaseId` string
    - `projectId` string
    - `fileName` string
    - `contentType` string
    - `sizeBytes` integer
    - `sha256` string
    - `status` string
    - `chunkCount` integer
    - `uploadedAt` string, date-time
    - `errorMessage` string
  - `resultCount` integer

## Other responses

- `401`: not authorized for this operation!
- `500`: internal error!

## Changes

- **2026-08-11** `9ae232e55479`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/apinizer/apis/apinizer-management-apis/changes/apiops/projects/:projectName/knowledge-bases/:kbName/documents/post.md)

---

[API](https://skmtc.dev/apinizer/apis/apinizer-management-apis.md) - [All operations](https://skmtc.dev/apinizer/apis/apinizer-management-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/apinizer/apis/apinizer-management-apis/revisions/e083046b24cd?raw)
