Sync vs async — which to use?
Synchronous (/extract)
One HTTP call. Blocks until done, returns the result directly. Best for interactive integrations, small files, or when you need the result immediately. Use when processing typically completes in under 60 seconds.
Async (3-step)
Upload, start, poll. Each step returns immediately. Best for large files, batch workloads, or when you want to decouple ingestion from processing.
The three steps
Upload the file
POST /projects/{project_name}/tables/{table_id}/filesSend the file along with its metadata. This creates a row in the extraction table associated with the file but does not start processing.Returns: { "row_id": "uuid" } — hold onto this.Start a run
POST /projects/{project_name}/tables/{table_id}/runPass the row_id from step 1. This enqueues the AI job and returns immediately.Returns: { "run_id": "uuid" } — use this to poll.Optional: pass "zero_retention": true to run without persisting intermediate results.Run status values
| Status | Meaning |
|---|---|
pending | Queued, not yet started |
running | AI is actively processing |
done | Extraction complete — data field is populated |
error | Processing failed |
Full example
File type options
The
file_type field controls how Cloudsquid reads the file value:file_type | file field | Use when |
|---|---|---|
binary | Base64-encoded file content | Uploading directly from disk |
uri | Signed URL string | File is hosted remotely — Cloudsquid fetches it |
multipart | Array of parts | Email (RFC 822) with attachments |
Prefer one call? Use synchronous extraction
The
/extract endpoint blocks until done and returns results in a single response.