De-identify text
POST https://privacy.custodianlabs.io/api/v1/deidentify/text/proprietary/outputs
Returns two de-identified versions of the input text.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to de-identify. |
masking_type | string | No | transform (used if you don't set one) for realistic stand-ins, redact for *****, or placeholder for labels such as [NAME]. |
pii_entities | string[] | No | Categories to process, such as ["PERSON", "EMAIL_ADDRESS"]. Omit, send [] or ["ALL"] for everything. See Supported entities. |
curl -X POST "https://privacy.custodianlabs.io/api/v1/deidentify/text/proprietary/outputs" \
-H "X-API-Key: $CUSTODIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Dr. Emily Chen called Alex at 555-0100 about the appointment in Auckland.",
"masking_type": "transform",
"pii_entities": ["PERSON", "PHONE_NUMBER", "LOCATION"]
}'
Response
{
"original_text": "Dr. Emily Chen called Alex at 555-0100 about the appointment in Auckland.",
"outputs": [
{ "id": 1, "text": "Dr. Sarah Miller called Jordan at 555-0188 about the appointment in Wellington." },
{ "id": 2, "text": "Dr. Laura Adams called Casey at 555-0142 about the appointment in Christchurch." }
],
"mode": "PROPRIETARY_OUTPUTS",
"meta": { "...": "detection detail" }
}
| Field | Description |
|---|---|
original_text | The input text. |
outputs | Two candidates. Use outputs[0] by default, or show both to a reviewer. With redact and placeholder, both are the same. |
mode | Always PROPRIETARY_OUTPUTS. |
meta | Detection detail, including the spans that were found. |
SDK equivalents: deidentify_text_outputs() in Python, deidentifyTextOutputs() in
TypeScript.