# Step 1: Start upload
curl -X POST https://api.copera.ai/public/v1/drive/files/upload/multipart/start \
-H "Authorization: Bearer YOUR_PAT" \
-H "Content-Type: application/json" \
-d '{"fileName": "report.pdf", "fileSize": 10485760, "mimeType": "application/pdf"}'
# Step 2: Get presigned URLs (e.g., 2 parts for a 10MB file)
curl -X POST https://api.copera.ai/public/v1/drive/files/upload/multipart/presigned-urls \
-H "Authorization: Bearer YOUR_PAT" \
-H "Content-Type: application/json" \
-d '{"uploadId": "abc123", "fileKey": "files/xyz", "parts": 2}'
# Step 3: Upload each part to S3 (using URLs from Step 2)
curl -X PUT "SIGNED_URL_1" --data-binary @part1.bin
curl -X PUT "SIGNED_URL_2" --data-binary @part2.bin
# Step 4: Finalize
curl -X POST https://api.copera.ai/public/v1/drive/files/upload/multipart/finalize \
-H "Authorization: Bearer YOUR_PAT" \
-H "Content-Type: application/json" \
-d '{
"uploadId": "abc123",
"fileKey": "files/xyz",
"parts": [
{"partNumber": 1, "eTag": "\"etag-from-s3-1\""},
{"partNumber": 2, "eTag": "\"etag-from-s3-2\""}
]
}'