AimableDocs
DocsAPI Reference
POST/v1/pii/detect

Detect Pii Endpoint

Detect and redact PII in text for manual review workflow. Returns normalized pii_mapping (one placeholder per distinct value, lowest number). If thread_id and space_id are provided, the thread's accumulated pii_mapping is merged with existing_mapping so placeholders stay consistent across the conversation.

Headers

NameTypeRequiredDescription
X-API-KeystringOptional

Request Body

application/jsonRequired
textstringRequired
include_business_dataobject
enhanced_modeobject
include_oiiobject
existing_mappingobject
thread_idobject
space_idobject

Request

curl -X POST '/api-proxy/v1/pii/detect' \
  -H 'Authorization: Bearer <YOUR_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "string",
  "include_business_data": true,
  "enhanced_mode": true,
  "include_oii": {},
  "existing_mapping": {},
  "thread_id": {},
  "space_id": {}
}'

Response

200(generated)
{
  "pii_mapping": {
    "<EMAIL_1>": "pieter@example.com",
    "<PERSON_1>": "pieter bovenkamp"
  },
  "redacted_text": "Contact <PERSON_1> at <EMAIL_1>."
}

Error Responses