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
| Method | Path | Description |
|---|---|---|
GET | /api/v1/documents | List documents, filterable by entity fields |
POST | /api/v1/documents | Upload a document with multipart form data |
POST | /api/v1/documents/presign | Request a presigned URL for direct upload |
GET | /api/v1/documents/{id} | Get document metadata |
GET | /api/v1/documents/{id}/download | Download the document file |
POST | /api/v1/documents/{id}/complete | Complete a presigned upload |
DELETE | /api/v1/documents/{id} | Soft-delete a document |
GET /api/v1/documents
200 OK returns DocumentListResponseDto:
{"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)
| Field | Type | Required | Description |
|---|---|---|---|
entityType | enum | yes | Target entity type |
entityId | uuid | yes | Target entity id |
category | string | yes | Document category |
fileName | string | yes | Original filename |
contentType | string | yes | MIME type |
sizeBytes | integer | yes | File size, max 26214400 |
201 Created returns documentId, presignedUrl, objectKey and expiresAt.
POST /api/v1/documents/{id}/complete
Request body (CompleteUploadRequestDto)
| Field | Type | Required | Description |
|---|---|---|---|
checksumSha256 | string | yes | SHA-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.