Skip to main content
Upload a file to Morphik for processing. The file is stored and a background worker handles parsing and chunking.
from morphik import Morphik

db = Morphik("your-uri")

doc = db.ingest_file(
    file="report.pdf",
    filename="Q4_Report.pdf",
    metadata={"department": "sales", "year": 2025, "quarter": "Q4"},
    use_colpali=True
)

doc.wait_for_completion()
print(f"Document ID: {doc.external_id}")

Parameters

ParameterTypeDefaultDescription
filefilerequiredThe file to upload
filenamestringnullOverride filename (optional)
metadataobject{}Custom metadata to attach to the document
use_colpalibooleantrueUse Morphik multimodal embeddings for better image/table retrieval
folder_namestringnullTarget folder path for organization

Supported File Types

CategoryExtensions
Documents.pdf
Word.docx, .doc
PowerPoint.pptx, .ppt, .ppsx
Excel.xlsx, .xls, .xlsm
Images.jpg, .png, .gif, .webp, .tiff, .bmp, .svg
Video.mp4, .mpeg, .mov, .avi, .webm, .mkv, .3gp
Text.txt, .md, .rst, .log
Data.json, .csv, .tsv, .yaml, .xml
Web.html, .htm

Response

{
  "external_id": "doc_abc123",
  "filename": "report.pdf",
  "content_type": "application/pdf",
  "metadata": { "department": "sales", "year": 2025 },
  "system_metadata": { "status": "processing" }
}

Waiting for Processing

Documents are processed asynchronously. Use these methods to wait for completion:
doc.wait_for_completion()