Upload several documents
HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("http://localhost:8080/v2/documents/batch")) .header("Authorization", "Bearer <token>") .header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001") .method("POST", HttpRequest.BodyPublishers.ofString("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"file\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"metadataList\"\r\nContent-Type: application/json\r\n\r\n[ { \"contentType\": \"example\", \"fileName\": \"example\", \"expiresAt\": \"2026-04-15T12:00:00Z\", \"size\": 1, \"processDefinitionId\": \"example\", \"processInstanceKey\": \"example\", \"customProperties\": {} } ]\r\n-----011000010111000001101001--\r\n")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());const url = 'http://localhost:8080/v2/documents/batch';const form = new FormData();form.append('files', 'file');form.append('metadataList', '[ { "contentType": "example", "fileName": "example", "expiresAt": "2026-04-15T12:00:00Z", "size": 1, "processDefinitionId": "example", "processInstanceKey": "example", "customProperties": {} } ]');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/v2/documents/batch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form files=@file \ --form 'metadataList=[ { "contentType": "example", "fileName": "example", "expiresAt": "2026-04-15T12:00:00Z", "size": 1, "processDefinitionId": "example", "processInstanceKey": "example", "customProperties": {} } ]'Stores several files in one request: each file in a part named
files, and optionally a part metadataList with a JSON array of
metadata objects matched to the files by position (it must have as
many entries as there are files, else 400). A file’s metadata may
also come from its X-Document-Metadata part header. Every file
needs a file name, from its part or its metadata. When every file is
stored the answer is 201; when some fail it is 207, with one
problem per failed file (its file name, status, title and detail)
next to the references of the stored ones. The upload limit applies
to the files of the request together.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”The store id from the reference (in-memory, local or s3). Another value answers 404 (400 on an upload).
Header Parameters
Section titled “Header Parameters”Tenant selection. A principal bound to one tenant may omit it; if
sent, it must equal that tenant (403 otherwise). A principal that
may act in several tenants must send it on every request:
without it the request is refused with 400, and a tenant it may
not act in is refused with 403.
Request Bodyrequired
Section titled “Request Bodyrequired”object
What an upload says about a document. Unknown properties are refused with 400.
object
Must lie in the future.
Accepted and ignored; the stored size is the content’s.
A process instance key as a decimal string.
object
Responses
Section titled “ Responses ”Every document was stored.
object
A document reference, as apps store it in process variables.
object
The document-type discriminator; always this value.
The lower-case hex SHA-256 of the content.
object
object
object
Example
{ "createdDocuments": [ { "camunda.document.type": "camunda" } ]}Some documents were stored and others failed.
object
A document reference, as apps store it in process variables.
object
The document-type discriminator; always this value.
The lower-case hex SHA-256 of the content.
object
object
object
Example
{ "createdDocuments": [ { "camunda.document.type": "camunda" } ]}The request is malformed, or it uses a property or filter this release does not support.
An RFC 9457 problem document. type is a stable TinyConductor URN.
object
The request path.
Present only on mode-not-supported. It names the engine’s mode.
Example
{ "type": "urn:bpm:error:invalid-argument", "title": "Bad Request", "status": 400, "detail": "entity key must be a positive int64 string", "instance": "/v2/process-instances/0"}No valid credential was presented.
An RFC 9457 problem document. type is a stable TinyConductor URN.
object
The request path.
Present only on mode-not-supported. It names the engine’s mode.
Example
{ "type": "urn:bpm:error:unauthorized", "title": "Unauthorized", "status": 401, "detail": "A valid bearer credential is required", "instance": "/v2/documents/batch"}Headers
Section titled “Headers”The caller lacks the required permission, a tenant named in the request is not the caller’s tenant, or a cookie write has no valid CSRF token.
An RFC 9457 problem document. type is a stable TinyConductor URN.
object
The request path.
Present only on mode-not-supported. It names the engine’s mode.
Example
{ "type": "urn:bpm:error:forbidden", "title": "Forbidden", "status": 403, "detail": "The principal lacks the action this route requires", "instance": "/v2/documents/batch"}The body exceeds the configured request-size bound.
An RFC 9457 problem document. type is a stable TinyConductor URN.
object
The request path.
Present only on mode-not-supported. It names the engine’s mode.
Example
{ "type": "urn:bpm:error:payload-too-large", "title": "Payload Too Large", "status": 413, "detail": "The request exceeds the configured size limit", "instance": "/v2/documents/batch"}The request body is not multipart/form-data.
An RFC 9457 problem document. type is a stable TinyConductor URN.
object
The request path.
Present only on mode-not-supported. It names the engine’s mode.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "mode": "example"}An internal failure. The details are never exposed.
An RFC 9457 problem document. type is a stable TinyConductor URN.
object
The request path.
Present only on mode-not-supported. It names the engine’s mode.
Example
{ "type": "urn:bpm:error:internal", "title": "Internal Server Error", "status": 500, "detail": "The request could not be completed", "instance": "/v2/documents/batch"}No document store is configured on this engine (problem type urn:bpm:error:document-store-not-configured).
An RFC 9457 problem document. type is a stable TinyConductor URN.
object
The request path.
Present only on mode-not-supported. It names the engine’s mode.
Example
{ "type": "urn:bpm:error:mode-not-supported", "title": "Mode Not Supported", "status": 501, "detail": "POST /v2/documents/batch is not supported in embedded mode", "instance": "/v2/documents/batch", "mode": "embedded"}