Document Processing Status
All statuses are defined in the ProcessingStatus enum and serialized as uppercase strings (e.g. "COMPLETED").
Typical API lifecycle
After upload, poll GET /external/v1/documents/{documentId}/status (or the project-scoped variant) every 5–10 seconds until you hit a terminal status.
Typical path: upload → COMPUTING_QUOTA → UNPROCESSED → PROCESSING → COMPLETED (then download). Quota failures exit early as QUOTA_EXCEEDED or QUOTA_ERROR; processing failures end as ERROR.
Status reference
| Status | API relevance | Meaning |
|---|---|---|
| COMPUTING_QUOTA | In progress | Initial state after upload. Credit/quota usage is being calculated before anonymization starts. |
| UNPROCESSED | In progress | Queued for processing (quota check passed). Usually brief. |
| PROCESSING | In progress | Document is being anonymized. |
| COMPLETED | Success (terminal) | Processing finished. Download via GET .../result. |
| ERROR | Failure (terminal) | Anonymization failed. Result is not available. |
| QUOTA_EXCEEDED | Failure (terminal) | Not enough credits to process the document. |
| QUOTA_ERROR | Failure (terminal) | Quota calculation failed. Document was not processed. |
| COMPILING | In progress (edge case) | Anonymized output file is being generated. API clients may see this if a compile is triggered on download (e.g. after PII edits in the UI). Poll until COMPLETED. |
| PREVIEW_ERROR | Edge case | Preview/compile generation failed; the document may still be processable. Download may trigger a re-compile. |
| FINALIZED | UI / list API | Document locked after review in the UI. Download is still allowed. Not part of the standard upload→poll→download flow. |
| ARCHIVED | UI / list API | Document archived in the UI. Not relevant for external upload workflows. |
What API clients should do
Poll until terminal. Stop when status is one of:
COMPLETED→ download the resultERROR,QUOTA_EXCEEDED,QUOTA_ERROR→ handle the failure (no result to download)
Download only when COMPLETED. Calling download too early returns an error; COMPILING returns HTTP 409 (compile pending).
Response shape depends on endpoint:
- Upload / status:
{ "documentId": 42, "status": "PROCESSING" } - Document list:
processingStatuson each overview item, filterable via?status=COMPLETED
Upload-time vs async quota failures: Upload can return HTTP 403 (CREDIT_LIMIT_EXCEEDED) if credits are already exhausted. QUOTA_EXCEEDED / QUOTA_ERROR are set asynchronously during quota calculation after a successful upload.
Statuses you can mostly ignore
FINALIZED and ARCHIVED are primarily UI workflow states. They appear when listing project documents but are not part of the standard external anonymization pipeline.