Skip to main content
POST
Redact PII
Send text and get the same text back with personal information replaced or removed: names, email addresses, phone numbers, street addresses, URLs, dates and account numbers such as cards, IBANs and US Social Security numbers. Redaction runs on ZeroDrift’s own PII detector. Your text is not sent to a third-party model API. For a walkthrough with four test cases you can run, including a patient record, see Remove PII and PHI.
Detection is best-effort. A redacted result is not a guarantee of complete anonymization. Review the known gaps before you rely on it for a regulated workflow.

Request Body

string
default:"Email Maria Gonzalez at maria@example.com"
required
Text to redact, up to 100,000 characters. Empty or whitespace-only text is valid and returns no findings.
string
default:"label"
How each finding is replaced:Any other value returns 422 invalid_style.
string
default:"async"
sync returns the redacted text in the response for content up to 20,000 characters. async (the default) returns 202 with a job_id to poll via Get Verdict. See Sync and async.
string
Which detector queue the request joins: realtime work is served first, standard waits behind it. Defaults to realtime for sync and standard for async. Use standard for bulk jobs so they don’t slow down interactive callers.
object
Optional free-form object stored on the job, for example your own message ID. At most 8,192 bytes as JSON.

Response

A completed redaction returns 200 with the result nested under result. Polling an async job returns the same envelope.
string
Always v3.
string
Unique identifier for the redaction job.
string
Always redact.
string
queued, processing, completed or failed.
string
Mode the request was actually processed in. A sync request that fell back reports async.
string
The detector queue the request joined: realtime or standard.
string
Time the job was submitted (ISO 8601).
object
Where to poll for the result (async only): method is GET, url is /api/v3/jobs/{job_id}.
string
Present when status is failed.
object
Present when status is completed.

Sync and async

Always handle a 202, even when you send mode: "sync". A redaction job can be read only with the API key that submitted it.
There is no fallback engine. If the detector is unavailable, a sync request returns 503 detector_unavailable and an async job ends failed. ZeroDrift never returns unredacted text in place of a result.

Errors

No error response echoes your content. Both full-access and read-only API keys can call this endpoint. Refused requests and failed jobs are not billed.

Pricing

Redaction is billed at $0.01 per message, where a message is up to 2,000 input tokens of your text, rounded up. Each completed job reports its charge in result.units and result.cost. See Pricing.

Known gaps

The detector combines a language model with checksum and pattern rules. These are the cases it is known to miss or handle weakly:
  • Organization names are not reliably detected. A customer name that is a company may be left in place.
  • Routing numbers, EINs and SWIFT/BIC codes are confirmed only when a word naming them comes just before the number, such as routing, EIN, tax ID or SWIFT. Without one, they are left to the model and may be missed.
  • Cards: Maestro and UnionPay numbers, and card numbers inside a longer run of digits, may be missed.
  • Addresses are matched by rule only when they include a street-type word such as Street or Avenue. A PO box, a building name or a bare city and ZIP code is left to the model.
  • Not covered by the rules: internal reference IDs, CVVs, PINs and lowercase first names in chat. These depend on the model alone.
  • Languages: only English and Dutch have been measured.

Example

200 Response