
Selective PII redaction with a self-check
Redacts personal data from text at the level you choose and proves the output is clean by scanning it again. Pick a level: 1 government identifiers (SSN, ITIN, EIN, UK NINO, Canadian SIN, driver's license, passport), 2 adds dates of birth, 3 adds street addresses and phone numbers, 4 adds person names and email addresses. Then switch single categories on or off with include and exclude, or name the exact set with categories; extras are credit cards, IBANs, routing and account numbers, IP addresses, URLs, every date, and organizations. minDigitRun redacts any run of that many digits, terms redacts words you list (business names, project names), and keep protects strings such as your own email address. Detectors use checksums and structure rules (Luhn, ABA, mod-97, SSN and EIN rules) so ordinary numbers are not swallowed, and every later mention of a redacted value is redacted too. Replacements are labels like [REDACTED:SSN], one generic marker, numbered tokens like [PERSON_2] that stay consistent, or labels that keep the last four characters. The response lists category, position and confidence for each redaction and never repeats the original values. The engine rescans its own output and returns an error (payment released) rather than a result that still contains a detected value. Names and organizations are heuristic; set useModel to add a model pass for names, organizations and addresses, which sends the text to the configured language-model provider. Text only, up to 1,000,000 characters (the request body may be up to 4 MB of UTF-8); nothing is stored and no digest of the input is returned.
What you get
Sending a contract, medical note or support log to a model, a vendor or a court filing without scrubbing it is a breach waiting to happen. This returns the scrubbed text, a count of what was removed by type, and a check that nothing detectable remains.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/redact-text. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/redact-text \
-H 'content-type: application/json' \
-d '{"text":"Patient: Maria Gonzalez, DOB 04/12/1980, SSN 123-45-6789. Reach her at maria.gonzalez@example.org or (555) 010-0199. Maria Gonzalez was seen at Acme Clinic, Inc.","level":4,"include":["organization"],"style":"label"}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
text | string; length 1..1000000 | yes | The document text to redact (plain text, Markdown, CSV, JSON or HTML source). |
level | integer; 1..4 | no | Cumulative preset, default 1. 1: government identifiers (SSN, ITIN, EIN, UK NINO, Canadian SIN, driver's license, passport); 2: level 1 plus dates of birth; 3: level 2 plus street addresses and phone numbers; 4: level 3 plus person names and email addresses. |
categories | array<string; one of "ssn", "itin", "ein", "nino", "sin", "drivers_license", "passport", "date_of_birth", "address", "phone", "person_name", "email", "credit_card", "iban", "routing_number", "account_number", "ip_address", "url", "date", "organization">; max 20 items | no | Exact set of categories to redact; replaces the level preset when given. |
include | array<string; one of "ssn", "itin", "ein", "nino", "sin", "drivers_license", "passport", "date_of_birth", "address", "phone", "person_name", "email", "credit_card", "iban", "routing_number", "account_number", "ip_address", "url", "date", "organization">; max 20 items | no | Categories to add to the level preset. |
exclude | array<string; one of "ssn", "itin", "ein", "nino", "sin", "drivers_license", "passport", "date_of_birth", "address", "phone", "person_name", "email", "credit_card", "iban", "routing_number", "account_number", "ip_address", "url", "date", "organization">; max 20 items | no | Categories to remove from the level preset. |
minDigitRun | integer; 4..40 | no | Also redact every run of at least this many digits (spaces, dots and hyphens between digits count as part of the run). This is the number of digits, not the numeric value. |
terms | array<string; length 1..200>; max 200 items | no | Words or phrases to redact wherever they appear (business names, project names, people you already know). Case-insensitive. |
keep | array<string; length 1..200>; max 200 items | no | Strings that must never be redacted, such as your own email address or company name. Case-insensitive, whole match. |
style | string; one of "label", "generic", "numbered", "last4" | no | label (default): [REDACTED:SSN]. generic: [REDACTED]. numbered: [PERSON_1], same value same number. last4: [REDACTED:SSN:*6789] for numeric identifiers; this discloses the last four characters. |
useModel | boolean | no | Add a language-model pass for names, organizations and addresses (when those categories are on). Sends the text, up to 60000 characters, to the configured model provider. Default false. |
Example request body
{
"text": "Patient: Maria Gonzalez, DOB 04/12/1980, SSN 123-45-6789. Reach her at maria.gonzalez@example.org or (555) 010-0199. Maria Gonzalez was seen at Acme Clinic, Inc.",
"level": 4,
"include": [
"organization"
],
"style": "label"
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
redactedText | string | no | |
status | string; one of "complete" | no | |
summary | object | no | total redactions, byCategory counts and charactersRemoved. |
redactions | array<object> | no | |
verification | object | no | passed, residualDetections (rescan of the output), leakedValues (redacted values found again), distinctValues and outputSha256. No digest of the input is returned or signed, because a digest of guessable text would let a recipient recover what was redacted. |
config | object | no | The level, final category list, minDigitRun, style and useModel actually applied. |
coverage | array<object> | no | |
limits | array<string> | no | |
deterministic | boolean | no | True when no model was used. |
Pay and connect
Available through: x402 (USDC on Base), MCP, RapidAPI, Apify.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent