Skip to main content
Version: Next

Documents API

Use the Documents API to upload files, read metadata, preview, download, list, and delete task documents.

Operations​

MethodPathSummary
GET/api/documentsList documents
POST/api/documentsUpload a document
DELETE/api/documents/{id}Delete a document
GET/api/documents/{id}Get document metadata
GET/api/documents/{id}/downloadDownload a document
GET/api/documents/{id}/previewPreview a document inline

GET /api/documents​

List documents

Returns document metadata list, optionally filtered by taskId

PropertyValue
Operation IDlist
AuthBearer token required unless security is disabled.
Response DTODocumentResponseDto[]

Parameters​

NameInRequiredTypeDescription
taskIdqueryNointeger(int64)

Example request​

curl -X GET "http://localhost:8080/api/documents?taskId=123" \
-H "Authorization: Bearer $TOKEN"

Responses​

StatusDescriptionSchema
200OKDocumentResponseDto[]

Example response​

Status: 200 OK

[
{
"id": "3f3c7af7-34ae-4dd4-96e4-cbcba52c6b8f",
"fileName": "contract.pdf",
"contentType": "application/pdf",
"fileSize": 245760,
"taskId": 123,
"processInstanceId": 456,
"formFieldKey": "signedContract",
"uploadedBy": "admin",
"createdAt": "2026-06-17T10:00:00"
}
]

POST /api/documents​

Upload a document

Upload a file and associate it with a task, process instance and/or form field

PropertyValue
Operation IDupload
AuthBearer token required unless security is disabled.
Request DTODocumentUploadRequest
Request content typemultipart/form-data
Response DTODocumentResponseDto

Parameters​

NameInRequiredTypeDescription
taskIdqueryNointeger(int64)
processInstanceIdqueryNointeger(int64)
formFieldKeyqueryNostring

Request body​

RequiredContent typeDTO/schema
Yesmultipart/form-dataDocumentUploadRequest

Example multipart fields:

FieldExample
file@contract.pdf
taskId123
processInstanceId456
formFieldKeysignedContract

Example request​

curl -X POST "http://localhost:8080/api/documents?taskId=123&processInstanceId=456&formFieldKey=signedContract" \
-H "Authorization: Bearer $TOKEN" \
-F "file=@contract.pdf" \
-F "taskId=123" \
-F "processInstanceId=456" \
-F "formFieldKey=signedContract"

Responses​

StatusDescriptionSchema
200OKDocumentResponseDto

Example response​

Status: 201 Created

{
"id": "3f3c7af7-34ae-4dd4-96e4-cbcba52c6b8f",
"fileName": "contract.pdf",
"contentType": "application/pdf",
"fileSize": 245760,
"taskId": 123,
"processInstanceId": 456,
"formFieldKey": "signedContract",
"uploadedBy": "admin",
"createdAt": "2026-06-17T10:00:00"
}

GET /api/documents/{id}​

Get document metadata

Returns document metadata without binary content

PropertyValue
Operation IDgetMetadata
AuthBearer token required unless security is disabled.
Response DTODocumentResponseDto

Parameters​

NameInRequiredTypeDescription
idpathYesstring(uuid)

Example request​

curl -X GET "http://localhost:8080/api/documents/3f3c7af7-34ae-4dd4-96e4-cbcba52c6b8f" \
-H "Authorization: Bearer $TOKEN"

Responses​

StatusDescriptionSchema
200OKDocumentResponseDto

Example response​

Status: 200 OK

{
"id": "3f3c7af7-34ae-4dd4-96e4-cbcba52c6b8f",
"fileName": "contract.pdf",
"contentType": "application/pdf",
"fileSize": 245760,
"taskId": 123,
"processInstanceId": 456,
"formFieldKey": "signedContract",
"uploadedBy": "admin",
"createdAt": "2026-06-17T10:00:00"
}

DELETE /api/documents/{id}​

Delete a document

Permanently deletes a stored document

PropertyValue
Operation IDdelete
AuthBearer token required unless security is disabled.
Response DTONo body

Parameters​

NameInRequiredTypeDescription
idpathYesstring(uuid)

Example request​

curl -X DELETE "http://localhost:8080/api/documents/3f3c7af7-34ae-4dd4-96e4-cbcba52c6b8f" \
-H "Authorization: Bearer $TOKEN"

Responses​

StatusDescriptionSchema
200OK-

Example response​

Status: 204 No Content

No response body.

GET /api/documents/{id}/download​

Download a document

Returns the document content as an attachment

PropertyValue
Operation IDdownload
AuthBearer token required unless security is disabled.
Response DTObinary file

Parameters​

NameInRequiredTypeDescription
idpathYesstring(uuid)

Example request​

curl -X GET "http://localhost:8080/api/documents/3f3c7af7-34ae-4dd4-96e4-cbcba52c6b8f/download" \
-H "Authorization: Bearer $TOKEN"

Responses​

StatusDescriptionSchema
200OKstring(binary)

Example response​

Status: 200 OK

Binary file response with Content-Disposition: attachment; filename="contract.pdf"

GET /api/documents/{id}/preview​

Preview a document inline

Returns the document content inline (suitable for PDF embed). Falls back to attachment for non-PDF types.

PropertyValue
Operation IDpreview
AuthBearer token required unless security is disabled.
Response DTObinary file

Parameters​

NameInRequiredTypeDescription
idpathYesstring(uuid)

Example request​

curl -X GET "http://localhost:8080/api/documents/3f3c7af7-34ae-4dd4-96e4-cbcba52c6b8f/preview" \
-H "Authorization: Bearer $TOKEN"

Responses​

StatusDescriptionSchema
200OKstring(binary)

Example response​

Status: 200 OK

Binary file response. PDFs use Content-Disposition: inline; filename="contract.pdf"