Documents API

Generic document metadata, upload, presigned upload, download and deletion.

The generic document store attaches files to supported entity types. Resource-specific document pages describe convenience upload surfaces for suppliers, purchases and product materials.

Endpoints

MethodPathDescription
GET/api/v1/documentsList documents, filterable by entity fields
POST/api/v1/documentsUpload a document with multipart form data
POST/api/v1/documents/presignRequest a presigned URL for direct upload
GET/api/v1/documents/{id}Get document metadata
GET/api/v1/documents/{id}/downloadDownload the document file
POST/api/v1/documents/{id}/completeComplete a presigned upload
DELETE/api/v1/documents/{id}Soft-delete a document

GET /api/v1/documents

200 OK returns DocumentListResponseDto:

JSON
{
"items": [],
"total": 0,
"page": 1,
"pageSize": 20
}

The endpoint is filterable by entityType, entityId and category.

POST /api/v1/documents

Uploads a small document directly as multipart/form-data.

201 Created returns DocumentDto.

POST /api/v1/documents/presign

Request body (PresignUploadRequestDto)

FieldTypeRequiredDescription
entityTypeenumyesTarget entity type
entityIduuidyesTarget entity id
categorystringyesDocument category
fileNamestringyesOriginal filename
contentTypestringyesMIME type
sizeBytesintegeryesFile size, max 26214400

201 Created returns documentId, presignedUrl, objectKey and expiresAt.

POST /api/v1/documents/{id}/complete

Request body (CompleteUploadRequestDto)

FieldTypeRequiredDescription
checksumSha256stringyesSHA-256 checksum of the uploaded bytes

200 OK returns the completed DocumentDto with status: READY.

Document schema

DocumentDto includes id, entityType, entityId, category, status, objectKey, originalFilename, contentType, sizeBytes, checksumSha256, storageBackend, uploadedByUserId, metadata, createdAt, updatedAt and deletedAt.