Skip to main content

POST /api/v1/analyze/text/proprietary

Runs Guardian Layer detection on a text string and returns the identified sensitive terms with metadata and replacement suggestions. The input text is not modified.

Use this endpoint when you need to inspect what will be detected before de-identifying, or when building a review UI. For one-step de-identification, use /deidentify/text instead.


Request

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

Body

{
"text": "Dr. Emily Chen reviewed trial NX-4401 on March 3rd.",
"domain": "Medical"
}
FieldTypeRequiredDefaultDescription
textstringYesThe text to analyze
domainstringNo"General"General, Medical, Finance, or Custom

Response 200 OK

{
"tokens": ["Dr.", "Emily", "Chen", "reviewed", "trial", "NX-4401", "on", "March", "3rd"],
"sensitive_words": ["Emily Chen", "NX-4401"],
"words_in_hull": ["NX-4401", "trial"],
"suggestions": {
"Emily Chen": [
{"rank": 1, "replacement": "Sarah Park"},
{"rank": 2, "replacement": "Laura Kim"}
],
"NX-4401": [
{"rank": 1, "replacement": "BX-2209"},
{"rank": 2, "replacement": "MX-5512"}
]
}
}
FieldTypeDescription
tokensstring[]All tokens from the input text
sensitive_wordsstring[]Terms identified as sensitive
words_in_hullstring[]Terms detected as domain-specific sensitive content by Guardian Layer
suggestionsobjectMap of sensitive term → ranked replacement suggestions

Example

import requests

response = requests.post(
"https://api.custodianai.com/api/v1/analyze/text/proprietary",
headers={"X-API-Key": "cai_your_key_here"},
json={
"text": "Dr. Emily Chen reviewed trial NX-4401 on March 3rd.",
"domain": "Medical",
},
).json()

print(response["sensitive_words"])
# ["Emily Chen", "NX-4401"]

Error responses

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