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:
Provider + Type Format:
Specific Reader:
Returns: UploadResponse: Contains upload status, successful uploads, and any errors.
Examples: Upload a single file with native reader: POST /upload Form data:
Upload PowerPoint with MarkItDown (converts to markdown): POST /upload Form data:
Upload scanned PDF with better OCR: POST /upload Form data:
Upload from URLs: POST /upload Form data:
Upload direct text content: POST /upload Form data:
Upload file without ingesting (metadata only): POST /upload Form data:
Raises: HTTPException: 403 if collection not accessible
HTTPException: 400 if invalid parameters
HTTPException: 500 if upload processing fails
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The workspace ID
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'Successful Response