Skip to main content
POST
Rate limit tier: submission (60 req/min) — see Rate limits. Uploads 1–10 files as a single document packet in the workflow’s dataset, plus an optional 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.
Filenames are unique within a workflow. By default (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 (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.
Retries are safe with 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

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Headers

Idempotency-Key
string | null

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

workflow_id
string
required

Body

multipart/form-data
files
file[]
required

1..10 files forming ONE document (one document packet in the dataset).

ground_truth
string | null

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.

on_conflict
enum<string>
default:error

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.pdfinvoice (1).pdf).

Available options:
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.

document_packet_id
string
required

Unique identifier of the created dataset document packet (hyphenated UUID).

Example:

"069dcc2c-e14c-7606-8000-2ee4fb17b4e1"

files
DatasetUploadFileV3 · object[]
required

Files in the packet, in the order they were provided.

ground_truth_saved
boolean
required

Whether ground truth was supplied and saved for this document packet.