Upload to Dataset
Upload one document (+ optional ground truth) into a workflow dataset
ground_truth for that document packet. Creation is all-or-nothing: any rejected file (unsupported type, disguised bytes) or a ground-truth failure fails the whole request and nothing is stored.
Send the files as multipart form data under the files field (repeat the field for a multi-file document). The response returns a stable document_packet_id for the document; the presigned upload-slot ids stay hidden.
Bulk ingestion is client-orchestrated: loop this endpoint, one call per document. There is no batch endpoint — each call is bounded, atomic, and independently retryable. The SDKs provide the per-document loop.
on_conflict=error) a document whose name collides with a live dataset member fails with 409 (a rename is never silent); the response lists each conflict and the name it would take. Pass on_conflict=rename to auto-rename the collision instead — the returned file’s name is the name it landed under and original_name holds the name you sent (null when no rename happened).ground_truth). Optional; a JSON-encoded object — the expected document for this document packet (multipart can’t carry nested objects natively, so send the JSON as a string). Keys are the workflow schema’s field identifiers: advertise persistent_id (the API also accepts sanitized_name). A scalar field maps to string | null; a table/object field maps to an array of row objects. Ground truth attaches to the workflow’s current version. On success ground_truth_saved is true.Idempotency-Key. Pass any unique string; retrying the request with the same key replays the original document packet, so no duplicate document is registered. See Idempotency.Authorizations
API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.
Headers
Optional caller-supplied key (Stripe convention). Retrying the request with the same key replays the original document packet — no duplicate document is registered.
Path Parameters
Body
1..10 files forming ONE document (one document packet in the dataset).
Optional JSON-encoded object: the expected document for this document packet. Keys are the workflow schema's field identifiers — advertise persistent_id (the API also accepts sanitized_name). A scalar field maps to string | null; a table/object field maps to an array of row objects. Ground truth attaches to the workflow's current version.
How to handle an uploaded filename that already exists in the workflow (filenames are unique within a workflow). error (the default) rejects the whole request with 409 and lists the conflicting names, so a rename is never silent — the caller must opt in. rename accepts the collision and lets the server auto-rename the file by inserting a (n) counter before the extension (invoice.pdf → invoice (1).pdf).
error, rename Response
Successful Response
Response for POST /v3/workflows/{workflow_id}/dataset/upload/.
One dataset document packet, all-or-nothing. document_packet_id is the
stable handle for the deferred ground-truth-edit follow-up.
Unique identifier of the created dataset document packet (hyphenated UUID).
"069dcc2c-e14c-7606-8000-2ee4fb17b4e1"
Files in the packet, in the order they were provided.
Whether ground truth was supplied and saved for this document packet.
