Upload Document
Uploads a document to a specific knowledge base.
Endpoint
Parameters
kb_id
string
Yes
ID of the knowledge base to upload to
Authentication
Requires a valid API key or user authentication token.
Request Body
Multipart form data containing the file to upload.
Request Fields
file
file
Yes
The document file to upload
Response
Returns the uploaded document's metadata.
Response Format
Response Fields
id
string
Unique identifier for the document
knowledge_base_id
string
ID of the knowledge base containing the document
name
string
Original filename of the document
content_type
string
MIME type of the document
size
integer
Size of the document in bytes
created_at
datetime
When the document was uploaded
status
string
Processing status ("processing", "ready", "error")
error
string
Error message if processing failed (null if successful)
Example Request
Example Response
Error Responses
400
Bad Request - Invalid file or file type
401
Unauthorized - Invalid or missing API key
403
Forbidden - Not authorized to access this knowledge base
404
Not Found - Knowledge base not found
413
Payload Too Large - File exceeds size limit
500
Internal Server Error
Notes
Supported file types: PDF, TXT, DOCX, MD
Maximum file size: 10MB
Documents are processed asynchronously
Initial status is "processing"
Check document status using the list documents endpoint
Processing time varies based on document size and complexity
Failed processing will set status to "error" with explanation
Processing States
processing: Document is being analyzed and indexed
ready: Document is processed and available for agent use
error: Processing failed, check error field for details
Last updated