v56

latestOpenAPI 3.0.0raw.githubusercontent.com2026-08-014121451.1 MB
Knowledge Base

Upload knowledge base document

Upload supporting documentation so Comp AI can process approved source material for questionnaire answers and policy workflows.

post/v1/knowledge-base/documents/upload

Request body

organizationIdstring required

Organization ID that owns the document

fileNamestring required

File name

fileTypestring required

MIME type of the file

fileDatastring

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.

s3Keystring

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.

descriptionstring

Optional description

Example request

{
  "fileName": "rbac-matrix.xlsx",
  "fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}

Response

Document uploaded successfully