Skip to main content
Version: v0.1.4-beta.2

Documents

Easy BPM stores documents uploaded through task forms or API calls. Metadata is returned through JSON endpoints, while file content is retrieved through download or preview endpoints.

Upload a document​

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

The response includes:

FieldDescription
idDocument UUID.
fileNameOriginal file name.
contentTypeMIME type.
fileSizeSize in bytes.
taskIdAssociated task, if provided.
processInstanceIdAssociated process instance, if provided.
formFieldKeyForm field that produced the document, if provided.
uploadedByAuthenticated username.
createdAtUpload timestamp.

Get metadata​

curl http://localhost:8080/api/documents/{documentId} \
-H "Authorization: Bearer $TOKEN"

Download content​

curl -L http://localhost:8080/api/documents/{documentId}/download \
-H "Authorization: Bearer $TOKEN" \
-o contract.pdf

Preview content​

curl http://localhost:8080/api/documents/{documentId}/preview \
-H "Authorization: Bearer $TOKEN"

PDF files are returned inline for browser preview. Other file types fall back to attachment behavior.

List documents for a task​

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

Delete a document​

curl -X DELETE http://localhost:8080/api/documents/{documentId} \
-H "Authorization: Bearer $TOKEN"