Skip to main content
Every FlexOrch pipeline starts with a document upload. The Python SDK exposes three upload methods — single file, batch, and connector-based — so you can integrate with your existing storage and workflow without restructuring your code.

Single file upload

Pass a local file path to client.documents.upload(). The call is synchronous and returns a Job object as soon as the document is queued.
import os
from flexorch import FlexOrch

client = FlexOrch(api_key=os.environ["FLEXORCH_API_KEY"])

job = client.documents.upload("invoice.pdf")
print(f"Job ID: {job.id} | Status: {job.status}")
Supported file types include PDF, DOCX, PPTX, XLSX, HTML, Markdown, and plain text. FlexOrch auto-detects the MIME type from the file contents.

Multi-file upload

Use client.documents.upload_many() to upload a list of files in a single call. Each file gets its own job; the method returns a list of Job objects in the same order as the input paths.
paths = ["contract.pdf", "memo.docx", "slides.pptx"]

jobs = client.documents.upload_many(paths)

for job in jobs:
    print(f"{job.id}{job.status}")
upload_many() issues uploads concurrently under the hood, so submitting 20 files takes roughly the same wall-clock time as submitting one.

Upload from a connector

If your documents live in a connected storage source (S3, Google Drive, SharePoint, and others), you can pull them directly using a connector ID and a list of object keys. No local download required.
jobs = client.documents.upload_from_connector(
    connector_id=1,
    keys=["reports/q1.pdf", "reports/q2.pdf"],
)

for job in jobs:
    print(f"{job.id}{job.status}")
You can find connector IDs in the FlexOrch dashboard under Settings → Connectors.

Duplicate detection

Every upload is fingerprinted against previously processed documents in your workspace. When a duplicate is detected, the returned Job object contains is_duplicate = True and points to the original job via original_job_id.
job = client.documents.upload("invoice.pdf")

if job.is_duplicate:
    print(f"Duplicate detected. Original job: {job.original_job_id}")
else:
    print("New document — processing started.")
Duplicate jobs are still billed at the standard rate unless you have duplicate suppression enabled on your plan. Check your plan settings before uploading large batches.

File size limits

PlanMax file sizeMax files per batch
Starter25 MB10
Growth100 MB50
Enterprise500 MBUnlimited
Uploading a file that exceeds your plan’s size limit raises a FileTooLargeError. Catch it and inform users before they attempt the upload.
from flexorch.exceptions import FileTooLargeError

try:
    job = client.documents.upload("large_scan.pdf")
except FileTooLargeError as exc:
    print(f"File rejected: {exc}")

Next steps

Manage Jobs

Poll status and access extraction results for uploaded documents.

Build Datasets

Combine completed jobs into exportable, LLM-ready datasets.