Skip to main content
Upload files to a collection in a single request. The file is stored, validated, and immediately queued for parsing and knowledge extraction.

Upload a file

curl -X POST https://aigmented.io/api/v1/collections/49/files/upload \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -F "file=@/path/to/document.pdf"
Response:
{
  "file_id": 250,
  "filename": "document.pdf",
  "status": "processing",
  "content_type": "application/pdf",
  "size_bytes": 1048576
}
The file enters the processing pipeline automatically. Check the collection status to know when extraction is complete.

Supported formats

FormatExtensionsMIME Type
PDF.pdfapplication/pdf
Excel.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
CSV.csvtext/csv
Word.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.document

Validation

Files are validated in three layers before upload:
  1. Extension — must be one of the supported formats above
  2. MIME type — must match the expected type for the extension
  3. Magic bytes — file header is checked to confirm actual format (prevents renaming executables to .pdf)
Executable files (.exe, .sh, .bat, .dll, etc.) and binary files (ELF, Mach-O) are always rejected.

Limits

LimitValue
Max file size50 MB
Allowed formatsPDF, XLSX, CSV, DOCX

Error codes

StatusMeaning
201 CreatedFile uploaded and processing started
400 Bad RequestNo file provided (use field name file)
413 Payload Too LargeFile exceeds 50 MB
415 Unsupported Media TypeFile format not allowed or magic bytes mismatch

Processing pipeline

After upload, the file goes through the processing pipeline:
  1. Parsing — document is parsed into zones (sections, tables, etc.)
  2. Extraction — knowledge cards are extracted from zones using LLM
  3. Indexing — cards are embedded and indexed in the vector database
Reference files (.xlsx, .csv) follow a separate pipeline optimized for tabular data. The collection status changes to processing during this time and processed when complete.