Use this flow instead of POST /v1/documents/submit when:
  • Files exceed 50 MB
  • You need resumable uploads that survive network interruptions
  • You want to track per-file progress during upload

Step 1: Start a session

POST /v1/documents/upload/start
Content-Type: application/json
X-API-Key: your-company-api-key

{
  "files": [
    { "fileName": "large-report.pdf", "fileSize": 157286400 }
  ],
  "complianceReviewId": "01REV..."
}
Response gives you sessionId and per-file fileId, chunkSizeBytes, totalChunks:
{
  "sessionId": "01SES...",
  "expiresAt": "2025-01-21T14:30:00Z",
  "files": [
    {
      "fileId": "01FIL...",
      "fileName": "large-report.pdf",
      "chunkSizeBytes": 5242880,
      "totalChunks": 30
    }
  ]
}

Step 2: Upload chunks

Send each chunk as raw binary. Chunks are zero-indexed — send them in order.
PUT /v1/documents/upload/{sessionId}/files/{fileId}/chunks/{chunkIndex}
Content-Type: application/octet-stream
X-API-Key: your-company-api-key

<binary data>
Each response shows progress: { "receivedChunks": 1, "totalChunks": 30, "isComplete": false } The last chunk automatically commits the upload and triggers compliance processing:
{
  "receivedChunks": 30,
  "totalChunks": 30,
  "isComplete": true,
  "documentId": "01DOC...",
  "complianceReviewId": "01REV...",
  "status": "Pending"
}

Step 3: Poll for results (same as regular submit)

GET /v1/documents/{documentId}/status
GET /v1/documents/{documentId}/result
Session expiry: Sessions expire after 24 hours. Expired sessions return 410 Gone on chunk upload.