Presigned Document Upload

Upload a large document through the presign and complete flow.

Use presigned upload when the API should create document metadata but the file bytes should go directly to storage.

1. Request an upload URL

Shell
curl -X POST {{BASE_URL}}/api/v1/documents/presign \
-H "Authorization: Bearer $CONFORMA_PAT" \
-H "Content-Type: application/json" \
-d '{
"entityType": "SUPPLIER",
"entityId": "3f2b9a1c-4d2e-4b6e-9c1a-6f5b8e2d7c10",
"category": "POLICY",
"fileName": "supplier-policy.pdf",
"contentType": "application/pdf",
"sizeBytes": 1048576
}'

The response contains documentId, presignedUrl, objectKey and expiresAt.

2. Upload bytes to storage

Shell
curl -X PUT "$PRESIGNED_URL" \
-H "Content-Type: application/pdf" \
--data-binary @supplier-policy.pdf

The storage upload does not use your Conforma PAT.

3. Complete the document

Shell
curl -X POST {{BASE_URL}}/api/v1/documents/{documentId}/complete \
-H "Authorization: Bearer $CONFORMA_PAT" \
-H "Content-Type: application/json" \
-d '{ "checksumSha256": "64-character-sha256-hex" }'

The completed document returns with status: READY.