Upload
Upload content (files, URLs, or text) to a collection.
Args:
collection_id (str): Required. ID of the collection to upload to.
file (UploadFile, optional): Single file to upload.
files (List[UploadFile], optional): Multiple files to upload.
content (str, optional): Direct text content to upload.
urls (List[str], optional): List of URLs to download and upload.
content_type (str, optional): Type of content - ‘file’, ‘url’, or ‘text’. Default: ‘file’.
metadata (Dict[str, Any], optional): Additional metadata to attach to uploaded content.
label (str, optional): Custom label for the content. description (str, optional): Description of the content. crawl (bool, optional): Whether to crawl linked content from URLs. Default: False. ingest (bool, optional): Whether to ingest content into vector database. Default: True. If False, only file metadata is stored. Use POST /v1/chunks/create to ingest later. reader (str, optional): Reader to use for processing files. Default: ‘native’.
Reader Parameter: Controls how uploaded files are processed. Supported formats:
Provider Format:
- ‘native’: Use native implementation (default, fastest)
- ‘langchain’: Use LangChain readers for all files
- ‘markitdown’: Use MarkItDown for universal conversion to markdown
Provider + Type Format:
- ‘langchain_pdfplumber’: LangChain with PDFPlumber (better OCR, tables)
- ‘langchain_pypdf’: LangChain with PyPDF (faster for text-based PDFs)
Specific Reader:
- ‘pdf’, ‘csv’, ‘docx’, ‘json’, ‘markdown’, ‘text’
Returns: UploadResponse: Contains upload status, successful uploads, and any errors.
- collection_id: ID of the collection
- content_type: Type of content uploaded
- uploads: List of successfully uploaded content
- errors: List of failed uploads with error details
- total_uploads: Total number attempted
- successful_uploads: Number successful
- failed_uploads: Number failed
Examples: Upload a single file with native reader: POST /upload Form data:
- file: document.pdf
- collection_id: “my_docs”
- reader: “native”
Upload PowerPoint with MarkItDown (converts to markdown): POST /upload Form data:
- file: presentation.pptx
- collection_id: “presentations”
- reader: “markitdown”
Upload scanned PDF with better OCR: POST /upload Form data:
- file: scanned.pdf
- collection_id: “scans”
- reader: “langchain_pdfplumber”
Upload from URLs: POST /upload Form data:
- urls: [“https://example.com/doc1.pdf”, “https://example.com/doc2.pdf”]
- collection_id: “web_docs”
- content_type: “url”
Upload direct text content: POST /upload Form data:
- content: “This is my text content”
- collection_id: “notes”
- content_type: “text”
- label: “Quick Note”
Upload file without ingesting (metadata only): POST /upload Form data:
- file: document.pdf
- collection_id: “pending_docs”
- ingest: false Note: Use POST /v1/chunks/create later to ingest content
Raises: HTTPException: 403 if collection not accessible
HTTPException: 400 if invalid parameters
HTTPException: 500 if upload processing fails
Documentation Index
Fetch the complete documentation index at: https://docs.mielto.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The workspace ID
Body
Reader to use for processing files. Supported values:
- 'native': Use native implementation (default)
- 'langchain': Use LangChain readers for all files
- 'markitdown': Use MarkItDown for universal conversion to markdown
Provider + Type Format:
- 'langchain_pdfplumber': LangChain with PDFPlumber (better OCR, tables)
- 'langchain_pypdf': LangChain with PyPDF (faster for text-based PDFs)
Specific Reader:
- 'pdf', 'csv', 'docx', 'json', 'markdown', 'text'Response
Successful Response