# PII Detect & Transform (Redact / Mask / Hash / Tokenize)

> PII Detect & Transform (Redact / Mask / Hash / Tokenize) is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Detects structured PII entities in a text blob and returns the sanitized text plus a findings report, with configurable transform modes per entity type.

## Facts

- Endpoint: POST https://api.agentstools.dev/pii/redact
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pii-detect-transform-redact-mask-hash-tokenize-90e02939
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_y4AaDJ6nVklP8gQLw62fO

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability pii-detect-transform-redact-mask-hash-tokenize-90e02939 -d '<json body>'
```

Example prompt: 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.'

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pii-detect-transform-redact-mask-hash-tokenize-90e02939/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
