Uploads a file to knowledge base (max file size: 10MB)
POST/knowledge-bases/files
Uploads a PDF, DOC, or DOCX file (max 10MB) into a knowledge base for training. WHEN TO USE: use this when you need to add a document source; use getFilesByKnowledgeBasePublic to list uploads; use deleteFile to remove a file. Do not use this for website pages — use discoverWebsite / trainDiscoveredUrls. RETURNS: success and the uploaded file url, fileId, and folder path.
Request
Version stringrequired
API Version
Available options
v3- multipart/form-data
- Body
- Example (auto)
Bodyrequired
File upload with metadata
locationIdstring
location id
knowledgeBaseIdstringrequired
knowledge base id
filestring<binary>required
File to upload (max size: 10MB). Supported formats: PDF, DOC, DOCX
{
"locationId": "ocQHyuzHvysMo5N5VsXc",
"knowledgeBaseId": "ocQHyuzHvysMo5N5VsXc",
"file": "string"
}
Uploads a file to knowledge base
- application/json
- Schema
- Example (auto)
Schema
successbooleanrequired
success
dataobjectrequired
details of the uploaded file
{
"success": true,
"data": {
"url": "https://storage.googleapis.com/bucket/locations/abc123/file.pdf",
"fileId": "ocQHyuzHvysMo5N5VsXc",
"folderPath": "locations/ocQHyuzHvysMo5N5VsXc"
}
}