Upload and process documents into a document store. This endpoint handles file uploads, chunking, embedding, and upserting to the vector store.
Path Parameters
The unique identifier of the document store to upsert documents into
Request Body
This endpoint accepts multipart/form-data for file uploads.
Array of files to upload. Supports PDF, TXT, DOCX, CSV, and other formats depending on configured loaders
Specific loader ID to use for processing files
Size of text chunks (default varies by loader)
Overlap between chunks (default varies by loader)
Additional metadata to attach to all documents
Response
Number of new documents added
Number of existing documents updated
Number of documents skipped
Number of documents deleted
Example Request
curl -X POST \
'https://your-flowise-instance.com/api/v1/document-store/upsert/store-123' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'files=@/path/to/document.pdf' \
-F 'files=@/path/to/guide.txt' \
-F 'chunkSize=1000' \
-F 'chunkOverlap=200'
curl -X POST \
'https://your-flowise-instance.com/api/v1/document-store/upsert/store-123' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'files=@/path/to/document.pdf' \
-F 'metadata={"category":"technical","version":"1.0"}'
Example Response
{
"numAdded": 45,
"numUpdated": 0,
"numSkipped": 0,
"numDeleted": 0,
"addedDocs": [
"doc-001",
"doc-002",
"doc-003"
]
}
Supported File Types
Depending on configured loaders, supported formats include:
- PDF (
.pdf)
- Text (
.txt)
- Word (
.docx)
- Markdown (
.md)
- CSV (
.csv)
- JSON (
.json)
- HTML (
.html)
Processing Steps
- Upload - Files are uploaded and validated
- Load - Appropriate loader processes the files
- Chunk - Content is split into chunks
- Embed - Chunks are embedded using configured embedding model
- Upsert - Embeddings are upserted to vector store
- Index - Documents are indexed for retrieval
Chunking Strategies
- Fixed Size - Split by character count
- Recursive - Split by paragraphs, sentences, then characters
- Semantic - Split by semantic meaning
Error Responses
Bad Request - Invalid file format or missing required fields
Unauthorized - Invalid or missing API key
Forbidden - Insufficient permissions to upsert documents
Not Found - Document store not found
Precondition Failed - Missing store ID or workspace ID
Internal Server Error - Error processing documents