Bulk upload documents with real-time progress
Uploads multiple documents to a Knowledge Base using Server-Sent Events (SSE) to provide real-time progress updates during the process.
The endpoint processes documents in batches and provides:
- Initial validation
- Text preparation
- Embedding generation
- Database insertion
- Final results
Path Parameters
Unique ID of the Knowledge Base
Request Body
application/json
List of documents to upload
1 <= itemsResponse Body
text/event-stream
application/json
application/json
application/json
curl -X POST "https://app.docutray.com/api/knowledge-bases/string/documents/bulk-upload" \ -H "Content-Type: application/json" \ -d '{ "documents": [ { "documentId": "manual-001", "content": { "title": "Installation Manual", "text": "Steps to install the system...", "category": "manual" }, "metadata": { "author": "Tech Team", "version": "2.0" } }, { "documentId": "faq-001", "content": { "title": "Frequently Asked Questions", "text": "How to configure...?", "category": "faq" } } ] }'"data: {\"type\":\"connected\",\"message\":\"Connected to bulk upload stream\",\"timestamp\":\"2023-01-01T12:00:00.000Z\"}\n"{
"error": "Invalid request data",
"details": [
{}
]
}{
"error": "Unauthorized"
}{
"error": "Internal server error"
}Start asynchronous document type identification POST
Identify the document type asynchronously from a provided list of options. **Supported file formats:** - image/jpeg (JPEG) - image/png (PNG) - image/gif (GIF) - image/bmp (BMP) - image/webp (WebP) - application/pdf (PDF) **Size limits:** - Maximum file size: 100MB - URL download timeout: 30 seconds **Request methods:** 1. **multipart/form-data**: Direct file upload 2. **application/json with base64**: Base64-encoded image 3. **application/json with URL**: Image URL for automatic download **Async workflow:** 1. Submit document for identification (returns identification_id) 2. Poll `/api/identify-async/status/{id}` for completion 3. Retrieve identified document type when status is SUCCESS
Delete document from Knowledge Base DELETE
Deletes a specific document from the Knowledge Base.