{"id":"redact-text","title":"Selective PII redaction with a self-check","description":"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.","roi":"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.","audience":"business","channels":["x402","mcp","rapidapi","apify"],"endpoint":{"method":"POST","url":"https://agents.writerslogic.com/api/v1/redact-text","path":"/api/v1/redact-text","contentType":"application/json"},"price":{"amount":"0.05","currency":"USDC","network":"base","perCall":true,"failedCallsCharged":false},"inputSchema":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":1000000,"description":"The document text to redact (plain text, Markdown, CSV, JSON or HTML source)."},"level":{"type":"integer","minimum":1,"maximum":4,"description":"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":{"type":"array","maxItems":20,"items":{"type":"string","enum":["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"]},"description":"Exact set of categories to redact; replaces the level preset when given."},"include":{"type":"array","maxItems":20,"items":{"type":"string","enum":["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"]},"description":"Categories to add to the level preset."},"exclude":{"type":"array","maxItems":20,"items":{"type":"string","enum":["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"]},"description":"Categories to remove from the level preset."},"minDigitRun":{"type":"integer","minimum":4,"maximum":40,"description":"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":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":200},"description":"Words or phrases to redact wherever they appear (business names, project names, people you already know). Case-insensitive."},"keep":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":200},"description":"Strings that must never be redacted, such as your own email address or company name. Case-insensitive, whole match."},"style":{"type":"string","enum":["label","generic","numbered","last4"],"description":"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":{"type":"boolean","description":"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."}}},"resultSchema":{"type":"object","properties":{"redactedText":{"type":"string"},"status":{"type":"string","enum":["complete"]},"summary":{"type":"object","description":"total redactions, byCategory counts and charactersRemoved."},"redactions":{"type":"array","items":{"type":"object","description":"category, start and end offsets into the ORIGINAL text, length, the replacement written, confidence (validated, pattern, context, heuristic, model) and the rule. The original value is never included."}},"verification":{"type":"object","description":"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":{"type":"object","description":"The level, final category list, minDigitRun, style and useModel actually applied."},"coverage":{"type":"array","items":{"type":"object","description":"For each enabled category: count redacted, method and what it can and cannot find."}},"limits":{"type":"array","items":{"type":"string"}},"deterministic":{"type":"boolean","description":"True when no model was used."}}},"outputSchema":{"type":"object","properties":{"data":{"type":"object","properties":{"redactedText":{"type":"string"},"status":{"type":"string","enum":["complete"]},"summary":{"type":"object","description":"total redactions, byCategory counts and charactersRemoved."},"redactions":{"type":"array","items":{"type":"object","description":"category, start and end offsets into the ORIGINAL text, length, the replacement written, confidence (validated, pattern, context, heuristic, model) and the rule. The original value is never included."}},"verification":{"type":"object","description":"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":{"type":"object","description":"The level, final category list, minDigitRun, style and useModel actually applied."},"coverage":{"type":"array","items":{"type":"object","description":"For each enabled category: count redacted, method and what it can and cannot find."}},"limits":{"type":"array","items":{"type":"string"}},"deterministic":{"type":"boolean","description":"True when no model was used."}}},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]},"example":{"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"},"openapiOperation":{"operationId":"redact_text","summary":"Selective PII redaction with a self-check","description":"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.\n\nPrice: 0.05 USDC on Base (x402).","x-x402-price-usdc":"0.05","x-x402-amount":"50000","x-audience":"business","x-sample-url":"https://agents.writerslogic.com/api/v1/samples/redact-text","security":[{"x402":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":1000000,"description":"The document text to redact (plain text, Markdown, CSV, JSON or HTML source)."},"level":{"type":"integer","minimum":1,"maximum":4,"description":"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":{"type":"array","maxItems":20,"items":{"type":"string","enum":["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"]},"description":"Exact set of categories to redact; replaces the level preset when given."},"include":{"type":"array","maxItems":20,"items":{"type":"string","enum":["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"]},"description":"Categories to add to the level preset."},"exclude":{"type":"array","maxItems":20,"items":{"type":"string","enum":["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"]},"description":"Categories to remove from the level preset."},"minDigitRun":{"type":"integer","minimum":4,"maximum":40,"description":"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":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":200},"description":"Words or phrases to redact wherever they appear (business names, project names, people you already know). Case-insensitive."},"keep":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":200},"description":"Strings that must never be redacted, such as your own email address or company name. Case-insensitive, whole match."},"style":{"type":"string","enum":["label","generic","numbered","last4"],"description":"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":{"type":"boolean","description":"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":{"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"}}}},"responses":{"200":{"description":"Paid result with provenance","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"redactedText":{"type":"string"},"status":{"type":"string","enum":["complete"]},"summary":{"type":"object","description":"total redactions, byCategory counts and charactersRemoved."},"redactions":{"type":"array","items":{"type":"object","description":"category, start and end offsets into the ORIGINAL text, length, the replacement written, confidence (validated, pattern, context, heuristic, model) and the rule. The original value is never included."}},"verification":{"type":"object","description":"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":{"type":"object","description":"The level, final category list, minDigitRun, style and useModel actually applied."},"coverage":{"type":"array","items":{"type":"object","description":"For each enabled category: count redacted, method and what it can and cannot find."}},"limits":{"type":"array","items":{"type":"string"}},"deterministic":{"type":"boolean","description":"True when no model was used."}}},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]}}}},"400":{"description":"Invalid request (no payment consumed)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Invalid X-API-KEY","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"402":{"description":"Payment required or invalid","content":{"application/json":{"schema":{"type":"object","description":"x402 v2 PaymentRequired (also base64 in the PAYMENT-REQUIRED header)","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"code":{"type":"string"},"resource":{"type":"object"},"accepts":{"type":"array","items":{"type":"object"}},"extensions":{"type":"object"}}}}}},"502":{"description":"Upstream failure; the payment is released or not settled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}}}},"links":{"docs":"https://writerslogic.com/agents/redact-text/","docsJson":"https://writerslogic.com/agents/redact-text.json","sample":"https://agents.writerslogic.com/api/v1/samples/redact-text","openapi":"https://agents.writerslogic.com/openapi.json","catalog":"https://agents.writerslogic.com/api/v1/catalog","verifyProvenance":"https://agents.writerslogic.com/api/v1/verify-provenance","index":"https://writerslogic.com/agents/index.json"}}