pii

Preview what the PII layer would do to texts (nothing is stored)

Run the fact-level PII layer on up to 50 texts with a pii lever (inline, from a stored profile, or the deployment default) and return each text anonymised, the masked entities with their offsets in the original, the coverage per language, and the text units the call cost. In block mode a text that carries PII is reported as blocked (an ingestion would drop that fact) and still shown masked. Nothing is stored and no text is logged; the only durable trace is the usage event (operation=pii_preview).

A workspace that is not entitled to the layer gets the floor only (regex, structured types) and a notice saying so.

Limits: 20000 characters in total (413 error), 60 requests per minute per integrator (429 detail, scope: pii_preview), 8 concurrent previews per API process (429 error PII_PREVIEW_CONCURRENCY_LIMIT with Retry-After), and the workspace's monthly token quota (429 detail TOKEN_QUOTA_EXCEEDED): a scan's text units are converted to an approximate token cost, so the layer and the LLM paths share one budget. Only a run on a metered detector is gated — one that runs in-process (regex) makes no external call, costs no tokens and always answers.

Validation errors, including PROFILE_NOT_FOUND and both pii and profile_id, answer 422 detail.

post/pii/preview

Request body

textsstring[] required

Texts to scan (a fact each, typically). At most 50.

profile_idstring uuid nullable

A stored profile of this workspace whose pii lever to apply (422 PROFILE_NOT_FOUND).

languagestring nullable

ISO 639-1 code of the texts, one of the extraction languages (422 otherwise). null = detect (es/en heuristic; else unknown).

include_spansboolean

Return the offsets of every masked entity in the original text.

Response

Per-text results and the run summary; nothing was stored

persistedfalse
noticestring nullable

Set when the request asked for more than the workspace may run: the playground then ran the floor only (regex, structured types) and says so.

Changes

Changed in 2 of the 18 revisions of this API.2