Skip to main content
All examples assume a configured client:

End-to-End Redaction

Upload a document, detect sensitive data, review, then redact:
A run moves through queuedanalyzinganalyzed, and only reaches completed after you call redact. This review step is deliberate — nothing is modified until you approve it.

Downloading the Redacted File

Reporting Live Progress

Each event’s data is a RunStatusEvent{ runId, status } — so the same stream can drive a progress indicator:
The stream closes on its own once the run settles, so the loop terminates without a timeout. If the connection drops early, re-read the run with getRun — the run row is the source of truth.

Batch Uploads

uploadFiles accepts an array and returns metadata for each file:

Paginating Results

List endpoints are cursor-based. Follow nextCursor until it is absent:

Creating a Policy and Pipeline

A policy defines what counts as sensitive; a pipeline defines how documents are processed. Inspect the catalog to see what is available:
Refer to the API Reference for the exact CreatePolicy and CreatePipeline shapes — they are generated from the OpenAPI specification and stay in sync with the server.

Exporting an Audit Trail

Runs expose their audit in JSON and CSV for long-term archiving:

Error Handling

Wrap only reads or idempotency-keyed writes in an automatic retry. A POST that uploads a file or applies redactions may have already succeeded when the response failed, so retrying it blindly can duplicate work.

Managing API Tokens