Knowledge Base

Upload files to knowledge base or folder

Changed on

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. 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.

post/knowledgeBase/{kbId}/upload

Request

  • Base URL
    https://app.pipeshub.com/api/v1
  • URL
    https://app.pipeshub.com/api/v1/knowledgeBase/{kbId}/upload
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: /api/v1/oauth2/authorize
      Client credentials
      Token URL: /api/v1/oauth2/token scopes: kb:upload, kb:read

Path parameters

kbIdstring uuid required

Knowledge base ID (UUID)

Query parameters

folderIdstring

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

filesstring[] required

Files to upload (max 1000)

isVersioned'true' | 'false' | '1' | '0' | ''

Enable version tracking. true/1 and false/0/empty are read as booleans; any other text is answered 500 (the validator throws a plain error).

recordNamestring

Validated, then ignored (records are named after their files).

originstring

Validated, then ignored (records get origin UPLOAD).

recordTypestring

Validated, then ignored (records get type FILE).

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 query request parameter folderId, the minLength was increased from 0 to 1

    • breaking

      for the path request parameter kbId, the format changed from no format to uuid

    • breaking

      request property was restricted to a list of enum values

    • breaking

      the request property's minItems was increased to 1

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the request property type changed from string to array

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      the request property default value changed from true to true

    • info

      added the new enum value to the request property

    • info

      added the new 0 enum value to the request property

    • info

      added the new 1 enum value to the request property

    • info

      added the new false enum value to the request property

    • info

      added the new true enum value to the request property

    • info

      the request property type was generalized from boolean to string

    • info

      removed the non-success response with the status

    • breaking

      the response's property type changed from object to string for status