Skip to main content
POST
Upload knowledge base document

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
organizationId
string
required

Organization ID that owns the document

fileName
string
required

File name

Example:

"rbac-matrix.xlsx"

fileType
string
required

MIME type of the file

Example:

"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"

fileData
string

Base64-encoded file contents. For the web UI / direct callers. AI/MCP clients should instead upload via /v1/uploads/presign (purpose=document) and pass s3Key — base64 through an LLM is impractically slow and times out. Provide exactly one of fileData or s3Key.

s3Key
string

Key of a file already uploaded via /v1/uploads/presign (purpose=document). The server fetches the bytes from storage — no base64 needed. Provide exactly one of fileData or s3Key.

description
string

Optional description

Response

200

Document uploaded successfully