Skip to main content

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​

FieldTypeRequiredDescription
textstringYesThe text to de-identify.
masking_typestringNotransform (used if you don't set one) for realistic stand-ins, redact for *****, or placeholder for labels such as [NAME].
pii_entitiesstring[]NoCategories 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" }
}
FieldDescription
original_textThe input text.
outputsTwo candidates. Use outputs[0] by default, or show both to a reviewer. With redact and placeholder, both are the same.
modeAlways PROPRIETARY_OUTPUTS.
metaDetection detail, including the spans that were found.

SDK equivalents: deidentify_text_outputs() in Python, deidentifyTextOutputs() in TypeScript.