Skip to main content
POST
Rate limit tier: submission, 60 requests/min. See Rate limits. Uploads 1–100 files as a single document packet in the workflow’s dataset, with an optional ground_truth for that packet. Creation is all-or-nothing. One rejected file or a ground-truth failure fails the whole request and stores nothing. An unsupported type and disguised bytes both cause a rejection. Send the files as multipart form data under the files field, repeating the field for a multi-file document. The response returns a stable document_packet_id. The presigned upload-slot ids stay hidden. The client orchestrates bulk ingestion: loop this endpoint, one call per document. The API has no batch endpoint, so every call stays bounded, atomic and independently retryable. The SDKs provide the per-document loop. Filenames are unique within a workflow. Under the default, on_conflict=error, a document whose name collides with a live dataset member fails with 409. The response lists each conflict and the name it would take. No rename is ever silent. Pass on_conflict=rename to rename the collision instead. The returned file’s name is then the name it landed under, and original_name holds the name you sent. original_name is null when no rename happened. Ground truth arrives in the optional ground_truth field. It holds the expected document for this document packet, as a JSON-encoded object sent as a string, because multipart carries no nested objects. The keys are the workflow schema’s field identifiers. Use persistent_id; the API also accepts sanitized_name. A scalar field maps to string | null, and a table or 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 the API registers no duplicate document. 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..100 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.