Upload files to knowledge base or folder
Changed onUpload 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. A path with folders (docs/2026/a.txt) creates those folders, as a folder upload does.
Rejected files
A file whose extension is not supported, or that is larger than the size limit, does not fail the request: it is reported as a file:failed event (reason UNSUPPORTED_TYPE or EXCEEDS_SIZE_LIMIT, stage: upload) and the other files go on. A file whose name is already used in the same place fails the same way with reason DUPLICATE_NAME and stage: index. The request still answers 200 when every file failed. There is no 413.
Ignored fields
recordName, recordType and origin are validated (non-empty, and recordName is checked for HTML and format specifiers) but do not affect the records: each record is named after its file, with origin UPLOAD and type FILE. Other fields and unknown query parameters are ignored; rejectedFiles and fileBuffers are set by the gateway itself, so a value sent for them is replaced.
Access
OWNER and WRITER may upload. A READER gets 403; a caller with no role on the knowledge base gets 404. Only a multipart body is read: a JSON body has no files and is refused with 400.
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.
Request
- Base URLhttps://app.pipeshub.com/api/v1
- URLhttps://app.pipeshub.com/api/v1/knowledgeBase/{kbId}/upload
- Auth
- HTTP bearer
- or OAuth 2Authorization code: /api/v1/oauth2/authorizeClient credentialsToken URL: /api/v1/oauth2/token scopes: kb:upload, kb:read
Path parameters
Knowledge base ID (UUID)
Query parameters
Target folder ID. Omit to upload to the KB root. A folder that is not in this knowledge base is answered 404.
Request body multipart/form-data
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.
Changes
- breaking
for the
queryrequest parameterfolderId, the minLength was increased from0to1 - breaking
for the
pathrequest parameterkbId, the format changed from no format touuid - breaking
request property
was restricted to a list of enum values - breaking
the
request property's minItems was increased to1 - breaking
the
request property's minLength was increased from0to1 - breaking
the
request property type changed fromstringtoarray - info
added the new optional request property
- info
added the new optional request property
- info
the
request property default value changed fromtruetotrue - info
added the new
enum value to the request property - info
added the new
0enum value to the request property - info
added the new
1enum value to the request property - info
added the new
falseenum value to the request property - info
added the new
trueenum value to the request property - info
the
request property type was generalized frombooleantostring - info
removed the non-success response with the status
- breaking
- breaking
the
response's property type changed fromobjecttostringfor status
- breaking