Skip to main content
Personal information ends up in places it shouldn’t: support tickets, chat logs, prompts sent to an LLM, and datasets shared with a vendor. The Redact PII endpoint returns your text with that information replaced or removed, so you can pass the clean version on. Redaction runs on ZeroDrift’s own PII detector. Your text is not sent to a third-party model API.
Redaction is best-effort, not a guarantee of complete anonymization. Read the known gaps before you rely on it in a regulated workflow.

What it removes

The detector supplements model findings with checksum or format checks for supported account-number types. Some valid card numbers can still be missed; see the known gaps.

Health information (PHI)

In health records, redaction removes the identifiers that tie a record to a patient: names, dates such as birth and admission, addresses, phone and fax numbers, email addresses, and ID numbers such as medical record numbers and health plan member IDs. Clinical content, such as diagnoses and medications, stays in the text. Redaction is one step in a de-identification process, not a HIPAA de-identification on its own.

Prerequisites

  • An API key (Quickstart, Step 1). Full-access and read-only keys both work.

The pattern

Use mode: "sync" for content up to 20,000 characters to get the redacted text back in the same response. Larger content, or a request that reaches the detector while it is starting up, comes back as 202 with a job_id to poll. Always handle both. See Sync and async.

Choose a style

Code

Try these four test cases

Each example uses made-up data and covers a different kind of personal information. Send them with style: "label" and compare your output with the one shown.

1. Client email

Names and contact details in everyday correspondence.
Input
Output
The firm name stays. Organization names are not redacted reliably; see the known gaps.

2. Wire instructions

Bank account details, with checksum or format checks for each identifier.
Input
Output
summary.validated_identifiers reports iban, us_routing_number and bic. Routing numbers and SWIFT/BIC codes are confirmed only when a word naming them, such as “routing” or “SWIFT”, comes just before the number.

3. Tax and payment details

Government ID and card numbers in a form or support ticket.
Input
Output
summary.validated_identifiers reports us_ssn, us_ein and card.

4. Patient intake note (PHI)

A health record, to see what is removed and what stays.
Input
Output
The identifiers are gone, but the symptom and medication stay. That is expected: redaction removes who the record is about, not the clinical content. See Health information (PHI).

Pricing

Redaction is billed at $0.01 per message of up to 2,000 input tokens. Each of the test cases above is one message. See Pricing.

Next

Redact PII API reference

Every field, response property and error code.

Handle errors

Retries and fallbacks for production traffic.