Upload one batch item

Stores one item of a job from a multipart upload. A batch's items arrive
one per request. The item carries either a document extraction
(whose input file rides as raw bytes in the file part) or a
create extraction (JSON only, no file).

The upload enforces these rules:

  • Set exactly one of document or create. Setting both, or
    neither, is a 400.
  • When document is set, file is required — it supplies the
    document's binary content (PDF or image).
  • When create is set, file is forbidden — a create item carries
    no file.
  • document and create must each be a JSON object.

Only the item's structure is checked here: the fields inside document
or create are not validated at upload. A body that is well-formed JSON
but not a valid request for its endpoint is still accepted with 202
and fails later during processing, recorded as an item error. A
wrong-typed field the endpoint cannot decode fails as invalid_input; a
body that decodes but the pipeline rejects (for example, a missing
required field) fails as processing_failed.

Supplying request_id makes the upload idempotent on that token. A
re-upload under the same token overwrites the same item rather than
adding a second, so a client that lost an upload's response can safely
re-send it. The response's deduplicated is true only when the
re-uploaded payload matches the one already stored; a same-token upload
with a changed payload overwrites in place and returns false.

Set a request_id on every upload: re-sending under the same token
is the only way to repair a lost or incomplete upload, including the one
a finalize 409 reports. Without one, a re-send adds a new item instead
of replacing the missing one, and the job cannot be finalized.

Uploads are rejected once the job has been finalized (409), once it
holds its 500-item limit (409), or when the item is too large (413
see the raw-file limit in the API description).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
Body Params
document
object

The JSON body of POST /lang2fhir/document/multi, without
its base64 content field — the uploaded file supplies the
content. Accepts that endpoint's fields (version, provider,
patient_reference, implementation_guide, detection_effort,
validation_method, config). This is the multi-resource
body: it has no single-resource field, and the item's result
is a DocumentMultiResponse (a Bundle of resources). Mutually
exclusive with create; requires file.

create
object

The JSON body of POST /lang2fhir/create/multi. Accepts that
endpoint's fields (text, version, provider,
patient_reference, implementation_guide, detection_effort,
validation_method, resource_review). This is the
multi-resource body: it has no single-resource field, and
the item's result is a CreateMultiResponse (a Bundle of
resources). Mutually exclusive with document; must not be
accompanied by a file.

file

The document's binary content (PDF, PNG, JPEG, or TIFF).
Required with document; forbidden with create.

string
length ≤ 256

Optional idempotency token (max 256 bytes). Re-uploading under
the same token overwrites the same item instead of adding a
new one. The token is scoped to this job; the same token in
another job is independent and creates a separate item.

string
length ≤ 512

Optional caller-supplied correlation label (max 512 bytes),
echoed back on status and result listings so you can match the
server's item_id to your own record.

Responses

400

Invalid upload — e.g. both or neither of document/create set, a
non-object document/create, a document item missing its file, a
create item carrying a file, or an over-length request_id/id.

401

Unauthorized

404

Batch job not found

409

The job is finalized (no longer accepting items) or holds its 500-item limit

413

The upload is too large. Both size trips return 413: the request body
exceeding the 32 MiB upload cap, and the item's stored payload
exceeding the 28 MiB per-item limit (~21 MiB of raw file once
base64-encoded).

499

Client closed request before response was ready

500

Server error

504

Request timed out

Language
Credentials
Bearer
JWT
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json