curl --request POST \
--url https://api.trycomp.ai/v1/knowledge-base/documents/upload \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"organizationId": "<string>",
"fileName": "rbac-matrix.xlsx",
"fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
organizationId: '<string>',
fileName: 'rbac-matrix.xlsx',
fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
};
fetch('https://api.trycomp.ai/v1/knowledge-base/documents/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/knowledge-base/documents/upload"
payload = {
"organizationId": "<string>",
"fileName": "rbac-matrix.xlsx",
"fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Upload knowledge base document | Comp AI API
Upload supporting documentation so Comp AI can process approved source material for questionnaire answers and policy workflows.
curl --request POST \
--url https://api.trycomp.ai/v1/knowledge-base/documents/upload \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"organizationId": "<string>",
"fileName": "rbac-matrix.xlsx",
"fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
organizationId: '<string>',
fileName: 'rbac-matrix.xlsx',
fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
};
fetch('https://api.trycomp.ai/v1/knowledge-base/documents/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/knowledge-base/documents/upload"
payload = {
"organizationId": "<string>",
"fileName": "rbac-matrix.xlsx",
"fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
API key for authentication
Body
Organization ID that owns the document
File name
"rbac-matrix.xlsx"
MIME type of the file
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
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.
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.
Optional description
Response
Document uploaded successfully
Was this page helpful?

