Upload your first documents
This guide walks you through storing a document with metadata in Paperoffice.
Prerequisites
- Valid access token with the
documents.writescope. - A file (PDF, PNG, TIFF, or JPEG) to upload.
Step 1: Create an upload session
curl -X POST https://api.paperoffice.ai/v1/documents/uploads \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"file_name": "contract.pdf",
"collection_id": "COL-12345",
"metadata": {
"reference": "CUSTOMER-4711",
"received_at": "2025-11-09T10:00:00Z"
}
}'
Step 2: Upload the file
curl -X PUT "https://uploads.paperoffice.ai/<UPLOAD_ID>" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/pdf" \
--data-binary @contract.pdf
Step 3: Confirm the upload
curl -X POST https://api.paperoffice.ai/v1/documents/uploads/<UPLOAD_ID>/complete \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Once confirmed the document is immediately available for OCR and workflows. For further automations continue with Automation & Webhooks.