Skip to main content

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_QUOTAUNPROCESSEDPROCESSINGCOMPLETED (then download). Quota failures exit early as QUOTA_EXCEEDED or QUOTA_ERROR; processing failures end as ERROR.

Status reference

StatusAPI relevanceMeaning
COMPUTING_QUOTAIn progressInitial state after upload. Credit/quota usage is being calculated before anonymization starts.
UNPROCESSEDIn progressQueued for processing (quota check passed). Usually brief.
PROCESSINGIn progressDocument is being anonymized.
COMPLETEDSuccess (terminal)Processing finished. Download via GET .../result.
ERRORFailure (terminal)Anonymization failed. Result is not available.
QUOTA_EXCEEDEDFailure (terminal)Not enough credits to process the document.
QUOTA_ERRORFailure (terminal)Quota calculation failed. Document was not processed.
COMPILINGIn 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_ERROREdge casePreview/compile generation failed; the document may still be processable. Download may trigger a re-compile.
FINALIZEDUI / list APIDocument locked after review in the UI. Download is still allowed. Not part of the standard upload→poll→download flow.
ARCHIVEDUI / list APIDocument 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 result
  • ERROR, 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: processingStatus on 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.