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"
}
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Yes | — | The text to analyze |
domain | string | No | "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"}
]
}
}
| Field | Type | Description |
|---|---|---|
tokens | string[] | All tokens from the input text |
sensitive_words | string[] | Terms identified as sensitive |
words_in_hull | string[] | Terms detected as domain-specific sensitive content by Guardian Layer |
suggestions | object | Map 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
| Status | Description |
|---|---|
401 | Missing or invalid API key |
403 | Key expired or character limit reached |
422 | Missing or invalid request body |