Documents
Create a document
Create a new document record and receive a pre-signed URL for uploading the file.
Workflow
- Call this endpoint with document metadata (type, fileName, contentType)
- Receive the created document with an uploadUrl
- Upload the file directly to S3 using the uploadUrl (PUT request)
- Document status changes from PENDING_UPLOAD to UPLOADED automatically
Upload Instructions
The uploadUrl is a pre-signed S3 URL. Upload your file with:
curl -X PUT -H "Content-Type: application/pdf" \
--data-binary @your-file.pdf \
"https://s3.amazonaws.com/bucket/key?signature=..."
Important:
- The uploadUrl expires after 15 minutes
- Use the exact contentType specified in the request
- Maximum file size: 100MB
post/documents
Request body
Example request
{
"key": "doc-inv-2025-001",
"fileName": "invoice-2025-001.pdf",
"contentType": "application/pdf",
"fileSize": 102400,
"tags": {
"invoiceNumber": "INV-2025-001"
}
}Response
Document created successfully
Example response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"key": "doc-inv-2025-001",
"fileName": "invoice-2025-001.pdf",
"extension": "pdf",
"contentType": "application/pdf",
"fileSize": 102400,
"uploadUrl": "https://s3.amazonaws.com/bucket/key?signature=...",
"downloadUrl": "https://s3.amazonaws.com/bucket/key?signature=...",
"tags": {
"invoiceNumber": "INV-2025-001",
"customerPO": "PO-12345"
},
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:35:00Z"
}