Upload files to knowledge base or folder
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
Knowledge base ID
Query parameters
Target folder ID. Omit to upload to the KB root.
Response
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.