Skip to main content

POST /api/v1/deidentify/text/proprietary/outputs

Runs Guardian Layer and returns two independently de-identified versions of the input text. Useful for review workflows or generating synthetic training data from sensitive documents.


Request

POST /api/v1/deidentify/text/proprietary/outputs
X-API-Key: cai_your_key_here
Content-Type: application/json

Body

{
"text": "The Meridian account is managed by Dana Reyes.",
"domain": "General",
"masking_type": "transform",
"pii_entities": null
}
FieldTypeRequiredDefaultDescription
textstringYesThe text to de-identify
domainstringNo"General"General, Medical, Finance, or Custom
masking_typestringNo"transform"redact replaces with *****; transform replaces with a plausible alternative
pii_entitiesstring[]NoallEntity types to target. Pass null or ["ALL"] for everything. See Supported Entities

Response 200 OK

{
"original_text": "The Meridian account is managed by Dana Reyes.",
"outputs": [
{"id": 1, "text": "The Pinnacle account is managed by Lisa Torres."},
{"id": 2, "text": "The Nexus account is managed by Kim Patel."}
],
"mode": "PROPRIETARY_OUTPUTS",
"meta": {
"plan_name": "professional"
}
}
FieldTypeDescription
original_textstringThe unmodified input text
outputsarrayTwo de-identified alternatives, each with id and text
modestringAlways "PROPRIETARY_OUTPUTS"
metaobjectRequest metadata

Example

import requests

response = requests.post(
"https://api.custodianai.com/api/v1/deidentify/text/proprietary/outputs",
headers={"X-API-Key": "cai_your_key_here"},
json={
"text": "The Meridian account is managed by Dana Reyes.",
"domain": "General",
"masking_type": "transform",
},
).json()

print(response["outputs"][0]["text"]) # first alternative
print(response["outputs"][1]["text"]) # second alternative

Error responses

StatusDescription
401Missing or invalid API key
403Key expired or character limit reached
422Missing or invalid request body