Skip to Content
API ReferenceConfiguration

Configuration

Manage custom recognizers, webhooks, and allowlists/blocklists to fine-tune PII detection behavior.


Custom Recognizers

Custom recognizers extend the built-in PII detection with your own patterns. Useful for detecting organization-specific identifiers such as internal employee IDs, account numbers, or proprietary codes.

Recognizer Object

FieldTypeDescription
idstringUnique recognizer identifier
namestringHuman-readable name
typestringregex or phrase_list
entity_typestringEntity type label to assign
patternsstring[]Regex patterns (for regex type)
phrasesstring[]Exact phrases (for phrase_list type)
scorenumberConfidence score to assign (0.0-1.0)
created_atstringISO 8601 timestamp

POST /config/recognizers

Create a custom recognizer.

curl -X POST https://api.pii-redactor.dev/api/v1/config/recognizers \ -H "X-API-Key: pk_live_abc123" \ -H "Content-Type: application/json" \ -d '{ "name": "Employee ID", "type": "regex", "entity_type": "EMPLOYEE_ID", "patterns": ["EMP-\\d{6}"], "score": 0.95 }'
{ "id": "rec_a1b2c3", "name": "Employee ID", "type": "regex", "entity_type": "EMPLOYEE_ID", "patterns": ["EMP-\\d{6}"], "score": 0.95, "created_at": "2026-02-13T10:00:00Z" }

GET /config/recognizers

List all custom recognizers for the current tenant.

curl https://api.pii-redactor.dev/api/v1/config/recognizers \ -H "X-API-Key: pk_live_abc123"

GET /config/recognizers/{id}

Get a specific recognizer.

curl https://api.pii-redactor.dev/api/v1/config/recognizers/rec_a1b2c3 \ -H "X-API-Key: pk_live_abc123"

PUT /config/recognizers/{id}

Update a recognizer. Only provided fields are updated.

curl -X PUT https://api.pii-redactor.dev/api/v1/config/recognizers/rec_a1b2c3 \ -H "X-API-Key: pk_live_abc123" \ -H "Content-Type: application/json" \ -d '{"patterns": ["EMP-\\d{6}", "EMPL-\\d{8}"]}'

DELETE /config/recognizers/{id}

Soft-delete a recognizer. It will no longer be used in detection but remains in audit logs.

curl -X DELETE https://api.pii-redactor.dev/api/v1/config/recognizers/rec_a1b2c3 \ -H "X-API-Key: pk_live_abc123"
{ "detail": "Recognizer deleted" }

Webhooks

Configure webhook endpoints to receive notifications when events occur, such as job completion or failure.

Webhook Object

FieldTypeDescription
idstringUnique webhook identifier
urlstringHTTPS endpoint to receive POST requests
eventsstring[]Events to subscribe to
secretstringSigning secret for payload verification
activebooleanWhether the webhook is active
created_atstringISO 8601 timestamp

Supported Events

EventDescription
job.completedA redaction job finished successfully
job.failedA redaction job failed

POST /config/webhooks

Create a webhook.

curl -X POST https://api.pii-redactor.dev/api/v1/config/webhooks \ -H "X-API-Key: pk_live_abc123" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhooks/pii-redactor", "events": ["job.completed", "job.failed"] }'
{ "id": "wh_d4e5f6", "url": "https://example.com/webhooks/pii-redactor", "events": ["job.completed", "job.failed"], "secret": "whsec_a1b2c3d4e5f6", "active": true, "created_at": "2026-02-13T10:00:00Z" }

The secret is returned only on creation. Use it to verify webhook payloads by computing an HMAC-SHA256 of the request body and comparing it to the X-Webhook-Signature header.

GET /config/webhooks

List all webhooks.

curl https://api.pii-redactor.dev/api/v1/config/webhooks \ -H "X-API-Key: pk_live_abc123"

PUT /config/webhooks/{id}

Update a webhook.

curl -X PUT https://api.pii-redactor.dev/api/v1/config/webhooks/wh_d4e5f6 \ -H "X-API-Key: pk_live_abc123" \ -H "Content-Type: application/json" \ -d '{"events": ["job.completed"]}'

DELETE /config/webhooks/{id}

Soft-delete a webhook. It will stop receiving events.

curl -X DELETE https://api.pii-redactor.dev/api/v1/config/webhooks/wh_d4e5f6 \ -H "X-API-Key: pk_live_abc123"

Allowlist / Blocklist

Control which terms are always allowed (never redacted) or always blocked (always redacted), regardless of detection confidence.

Allowlist/Blocklist Object

FieldTypeDescription
idstringUnique entry identifier
typestringallow or block
valuestringThe term or pattern
entity_typestringApplicable entity type (or * for all)
created_atstringISO 8601 timestamp

POST /config/allowlist

Create an allowlist entry.

curl -X POST https://api.pii-redactor.dev/api/v1/config/allowlist \ -H "X-API-Key: pk_live_abc123" \ -H "Content-Type: application/json" \ -d '{ "value": "Acme Corporation", "entity_type": "ORGANIZATION" }'
{ "id": "al_g7h8i9", "type": "allow", "value": "Acme Corporation", "entity_type": "ORGANIZATION", "created_at": "2026-02-13T10:00:00Z" }

GET /config/allowlist

List all allowlist and blocklist entries.

curl https://api.pii-redactor.dev/api/v1/config/allowlist \ -H "X-API-Key: pk_live_abc123"

PUT /config/allowlist/{id}

Update an entry.

curl -X PUT https://api.pii-redactor.dev/api/v1/config/allowlist/al_g7h8i9 \ -H "X-API-Key: pk_live_abc123" \ -H "Content-Type: application/json" \ -d '{"value": "Acme Corp"}'

DELETE /config/allowlist/{id}

Soft-delete an entry.

curl -X DELETE https://api.pii-redactor.dev/api/v1/config/allowlist/al_g7h8i9 \ -H "X-API-Key: pk_live_abc123"
{ "detail": "Entry deleted" }