End-to-End Redaction
Upload a document, detect sensitive data, review, then redact:A detection moves through
pending → executing → complete or failed.
Redaction is a separate step that leaves that status alone — nothing is
modified until you call createRedaction, and each call produces a new
redaction.Redacting With Reviewer Edits
Omitedits to redact with the policy decisions exactly as detected, or supply
an EditSet to layer a reviewer’s corrections over the analysis first —
suppress a false positive, retag a finding, or add one the analysis missed.
An EditSet holds one list per modality — text, tabular, image, and
audio — and every entry is tagged with an op:
Downloading the Redacted Document
A redaction’soutputDocumentId points at a normal workspace document, so it
downloads through the documents service:
Ad-Hoc Detection Without a Pipeline
Name the policies directly when you do not want a saved pipeline:Reporting Live Progress
Each event is aDetectionStatusEvent — { detectionId, status } — so the same
stream can drive a progress indicator. Break out of the loop to close it early:
The stream closes on its own once the detection settles, so the loop
terminates without a timeout. If the connection drops early, re-read the
detection with
getDetection — the detection row is the source of truth.text/event-stream body, events returns the raw
Response instead:
Batch Uploads
uploadDocuments accepts an array and returns metadata for each document:
Skipping Duplicate Uploads
Documents carry a SHA-256 of their plaintext content, and the list query can filter on it — so you can check whether identical content is already in the workspace before uploading it again:Bulk Deletion
deleteDocuments is idempotent and reports what it could not remove:
An id lands in
skipped when it is unknown, already deleted, in another
workspace, or held by an in-progress detection that still needs the document.Paginating Results
List endpoints are cursor-based. FollownextCursor 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 deployment’s capabilities to see what is available:Exporting an Audit Trail
A detection’s audit downloads as a file,csv by default or json on request:
The
csv export is a zip of entities.csv, provenance.csv, and
reviews.csv. The json export is a single pretty-printed file.Running a Human Review
Open a review on a document, assign a reviewer, discuss, then verify it:Workspace Analytics
Receiving Webhooks
Create a webhook, store its secret, and verify each delivery:Error Handling
Managing API Tokens
Escaping to the Raw Client
client.api is the underlying typed openapi-fetch client, for anything the
service classes do not wrap — extra headers on a single call, for instance:
Repeating a detection request with the same
Idempotency-Key returns the
existing detection rather than starting a second one. Generate one key per
logical detection and reuse it across every retry of that detection —
generating a fresh key inside the retry loop defeats the purpose.