---
title: "Redact PII"
method: POST
path: "/v2/pii/redact"
---

# Redact PII

`POST /v2/pii/redact`

Replaces detected PII with placeholders and returns the reverse mapping needed to restore the original text.

## Request body

- RedactRequest
  - `text` string
  - `language` string
  - `threshold` number, double
  - `regions` string[] — Region codes selecting whole regions of coverage, e.g. "nl", "gb". Every entity type those regions cover is included, alongside the base catalog. ["all"] is exclusive. Leaving this and `entities` both empty also runs every region, so selecting nothing is the widest request rather than the narrowest. Empty alongside a non-empty `entities` stays strict. See the capabilities endpoint for the region list. Combines with `entities`: the detector unions the two selections, so a request carrying both covers the regions plus the named types. Note that `entities` only narrows coverage when it travels alone.
  - `entities` string[] — The entity types to cover. A named type fires even when it belongs to a region, so a region's types can be selected individually without naming the region. Alone this is a strict allowlist; alongside `regions` it adds to the region coverage instead of narrowing it.
  - `entity_thresholds` object — Per-entity confidence cutoff overrides. An override REPLACES the global `threshold` for that type and may sit above or below it: the gateway lowers the first-pass floor it sends the detector to the smallest value in the map, and every selected type carries its own cutoff, so a sub-global override detects MORE of that type without widening the rest. This only tunes confidence; it never changes which types are covered. Coverage is decided by `entities` alone, so every key here must also appear in `entities` — a key that does not is rejected, as is any key at all when `entities` is empty. Declarative [0,1] bound mirrors existing constraint on `threshold`.

## Response `200`

OK

- RedactResponse
  - `redacted_text` string
  - `mappings` object — Maps each placeholder (e.g. "<PERSON_1>") to the original value it replaced.

## Changes

> 350 revisions in range; 136 not diffed.

- **2026-09-07** `bcd6172f8655` — 3 info
  - added the new optional request property `entities`
  - added the new optional request property `entity_thresholds`
  - added the new optional request property `regions`
- **2026-09-07** `dcc0afb98a48` — 3 warning
  - removed the request property `entities`
  - removed the request property `entity_thresholds`
  - removed the request property `regions`
- **2026-09-06** `e1a2869bc12f` — 3 info
  - added the new optional request property `entities`
  - added the new optional request property `entity_thresholds`
  - added the new optional request property `regions`
- **2026-09-06** `28c58af69b8c` — 3 warning
  - removed the request property `entities`
  - removed the request property `entity_thresholds`
  - removed the request property `regions`
- **2026-09-04** `3df7b466d7e5` — 3 info
  - added the new optional request property `entities`
  - added the new optional request property `entity_thresholds`
  - added the new optional request property `regions`

[Change history](https://skmtc.dev/orq-ai/apis/orq-ai-api/changes/v2/pii/redact/post.md)

---

[API](https://skmtc.dev/orq-ai/apis/orq-ai-api.md) · [All operations](https://skmtc.dev/orq-ai/apis/orq-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/orq-ai/apis/orq-ai-api/revisions/3c7d859558ee?raw)
