Create a PII Recognizer
Add a custom PII pattern for your tenant.
POST
Create a custom PII recognizer
Creates a recognizer. The pattern is compiled through a safe-regex validator at
write time, so a pattern that could backtrack catastrophically is refused here
rather than discovered on the hot path.
Dry-run it first with
Test a recognizer pattern — the
tester compiles through the same validator, so a pattern it accepts can actually
run.
A recognizer that fails to compile at request time is a fail-closed condition
on the data plane: the request is refused with
503 pii_policy_degraded rather
than forwarded with part of the policy silently not running.
Requires the create capability on ai_gateway. See the control-plane overview for authentication, the {data, meta} envelope, pagination and error types.Authorizations
OAuth 2.1 authentication — recommended for new integrations. Access tokens
(kc_ prefix) are minted at the root-host token endpoint
https://api.knoxcall.com/oauth/token and passed as Authorization: Bearer <access_token>.
Public clients must use PKCE with the authorization_code grant; confidential
clients may use client_credentials. The first-party SDKs and the
knoxcall login CLI handle token minting, caching, refresh, and DPoP for you.
Body
application/json
Example:
"employee_id"
Available options:
regex, aho_corasick, presidio_pattern, presidio_ner, presidio_custom Maximum string length:
4096Example:
"EMP-[0-9]{6}"
Required range:
0 <= x <= 1Available options:
redact, tokenize, whitelist, warn