Skip to main content
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

Authorization
string
header
required

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
name
string
required
Example:

"employee_id"

kind
enum<string>
required
Available options:
regex,
aho_corasick,
presidio_pattern,
presidio_ner,
presidio_custom
pattern
string
required
Maximum string length: 4096
Example:

"EMP-[0-9]{6}"

context_words
string[]
confidence
number<float>
default:0.85
Required range: 0 <= x <= 1
action
enum<string>
default:redact
Available options:
redact,
tokenize,
whitelist,
warn
format
string | null
enabled
boolean
default:true

Response

The created recognizer.

data
object

One tenant-defined PII detector.

meta
object

Metadata included with every API response.