{"uid":"cap_y4AaDJ6nVklP8gQLw62fO","slug":"pii-detect-transform-redact-mask-hash-tokenize-90e02939","name":"PII Detect & Transform (Redact / Mask / Hash / Tokenize)","description":"Detect and transform structured PII in a text blob. Returns the sanitized text plus a findings report. Modes: redact, mask, hash, or reversible tokenize (the token map is returned in the response — nothing is stored). Optional per-type mode overrides and an allow-list. Structured PII indicators, not legal advice.","url":"https://api.agentstools.dev/pii/redact","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"mode":{"enum":["redact","mask","hash","tokenize"],"type":"string","description":"Default transform applied to every entity"},"salt":{"type":"string","description":"Optional salt mixed into hash mode"},"text":{"type":"string","description":"The text to sanitize"},"entities":{"type":"array","items":{"type":"string"},"description":"Optional allow-list of entity types to act on (default: all). See GET /pii/recognizers."},"mode_overrides":{"type":"object","description":"Optional per-entity-type transform, keyed by type"},"include_positions":{"type":"boolean","description":"Include character start/end offsets per finding"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lkVlaSzV0gbJ9fGoN5X-2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Detects structured PII entities in a text blob and returns the sanitized text plus a findings report, with configurable transform modes per entity type.","exampleAgentPrompt":"Scan this support ticket text and redact all PII — names, emails, phone numbers, and any credit card numbers — using hash mode for emails and mask mode for everything else, and give me the sanitized text plus a report of what was found: 'Hi, my name is John Smith, email john.smith@example.com, card 4111-1111-1111-1111, please help me reset my account.'","exampleUseCases":[{"title":"Anonymize customer support logs","prompt":"Take this batch of customer messages and redact all personally identifiable info — names, phone numbers, emails, and addresses — before we store them in our analytics database. Use mask mode so the structure is still visible but nothing is identifiable."},{"title":"Reversible tokenization for data pipeline","prompt":"I need to pass this user record text through a third-party API but strip out all PII first. Use tokenize mode so I can reverse it later — give me the sanitized text and the token map: 'Customer: Alice Brown, DOB: 1985-03-12, SSN: 123-45-6789, Account: 9876543210.'"},{"title":"Compliance audit PII detection report","prompt":"Scan this legal document text for any PII and just give me a findings report with character positions for each hit — don't transform anything, just tell me what types of sensitive data are present and where: 'The claimant Jane Doe (SSN 987-65-4321) residing at 42 Maple Street, Boston MA...'"}],"resultDescription":"Returns the sanitized/transformed version of the input text (with PII replaced according to the chosen mode), a findings report listing each detected PII entity (type, original value or placeholder, and optionally character start/end offsets), and — when tokenize mode is used — a reversible token map keyed by replacement token. Nothing is stored server-side.","failureModes":["Missing required 'text' field returns a 400 validation error","Invalid mode enum value (not redact/mask/hash/tokenize) returns a 400 error","Text too large may time out or return a payload-too-large error","Salt provided with non-hash mode may be silently ignored or flagged","Unknown entity types in allow-list or mode_overrides may be ignored or return an error","Payment failure (x402) returns a 402 before processing begins"],"whenToPreferThis":"Choose this endpoint when you need to sanitize free-form text of structured PII before storing, transmitting, or processing it through third-party systems — especially when you need multiple transform strategies (redact, mask, hash, or reversible tokenize) in a single call with per-entity-type control. Prefer it over regex-based DIY solutions when entity coverage across types (names, emails, phone numbers, SSNs, credit cards, addresses) matters. The reversible tokenize mode with returned token map is particularly useful for pipelines that need to restore original values later without any server-side storage.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:02:44.582Z","isFirstParty":false}