---
title: "Upload files to knowledge base or folder"
method: POST
path: "/knowledgeBase/{kbId}/upload"
tags: ["Knowledge Base"]
---

# Upload files to knowledge base or folder

`POST /knowledgeBase/{kbId}/upload`

Upload one or more files to a knowledge base root or to a specific folder.

**Overview**

Batch upload multiple files in a single request. Each file becomes a new record with automatic content indexing.
Omit the `folderId` query parameter to upload to the KB root; include it to upload into that folder.

**Upload Limits**

- **Max files per request:** 1000
- **Default max file size:** 30MB (configurable via platform settings)
- Use `GET /knowledgeBase/limits` to check current limits

**Supported File Types**

Documents (PDF, DOCX, DOC, XLS, XLSX, PPT, PPTX, TXT, CSV, MD), Images (PNG, JPG, JPEG, SVG, WebP), Web (HTML, HTM), and Google Workspace formats.

**File Metadata**

Use `files_metadata` to provide additional info like file paths and last modified timestamps.

**Versioning**

Set `isVersioned: true` to enable version tracking for uploaded files.

**Streaming response**

This endpoint responds with `Content-Type: text/event-stream`.
The upload and its per-file progress are a single request: the body streams
a `file:succeeded` or `file:failed` event per file
(including files rejected up front for size/type), followed by a final
`done` summary, then closes. See the
`UploadStreamSSEEvent` schema for the event/payload contract.

## Path parameters

- `kbId` string, required

## Query parameters

- `folderId` string

## Response `200`

SSE stream (`text/event-stream`) of per-file upload outcomes. The
stream emits `file:succeeded` / `file:failed` per file and a final
`done` summary, then closes. See `UploadStreamSSEEvent`.

## Other responses

- `400` — Invalid request - Check file types and sizes
- `401` — Unauthorized
- `403` — Insufficient permissions (requires WRITER or higher)
- `404` — Knowledge base or folder not found
- `413` — File size exceeds maximum allowed
- `429` — Too many upload requests, or too many concurrent uploads for this user
- `500` — Failed to verify knowledge base or folder access

---

[API](https://skmtc.net/pipeshub-ai/apis/pipeshub-api.md) · [All operations](https://skmtc.net/pipeshub-ai/apis/pipeshub-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pipeshub-ai/pipeshub-api/versions/abd27cfefc73/schema)
