Skip to main content

Text Endpoints

Text endpoints process plain text strings.

Use these endpoints when your application sends text directly to Guardian Layer.

All endpoints on this page require X-API-Key.

Analyze Proprietary Text

Detect sensitive terms and return analysis metadata without changing the input.

POST /api/v1/analyze/text/proprietary

Request

{
"text": "The Meridian account is managed by Dana Reyes.",
"domain": "General",
"level": 2
}

Request Fields

FieldTypeRequiredDescription
textstringYesText to analyze.
domainstringNoGeneral, Medical, Finance, or Custom. Defaults to General.
pca_dimensionintegerNoSupported values are 1, 2, and 3. Defaults to 2.

De-identify Text with Guardian Layer Outputs

Use transform for Custodian Labs' proprietary de-identification algorithm, or use redact for Guardian Layer masking.

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

Request

{
"text": "Please contact Jane Smith at jane.smith@example.com or call (415) 555-0123.",
"domain": "General",
"pca_dimension": 2,
"masking_type": "transform",
"pii_entities": ["ALL"]
}

Request Fields

FieldTypeRequiredDescription
textstringYesText to de-identify.
domainstringNoGeneral, Medical, Finance, or Custom. Defaults to General.
levelintegerNoSupported values are 1, 2, and 3. Defaults to 2.
masking_typestringNotransform or redact. Defaults to transform.
pii_entitiesarrayNoEntity categories to process. Use ["ALL"], an empty list, or omit the field to process all supported entities.

Response

{
"original_text": "Please contact Jane Smith at jane.smith@example.com or call (415) 555-0123.",
"outputs": [
{
"id": 1,
"text": "Please contact Maria Lopez at maria.lopez@example.com or call (415) 555-0187."
},
{
"id": 2,
"text": "Please contact David Kim at david.kim@example.com or call (415) 555-0194."
}
],
"mode": "PROPRIETARY_OUTPUTS",
"meta": {}
}

The exact transformed values may vary.

For details about transform output candidates, see Proprietary Transform Outputs.

General Text De-identification

The API also includes a general text de-identification endpoint:

POST /api/v1/deidentify/text

Request

{
"text": "Dr. John Smith called patient Jane Doe.",
"compliance_mode": "MASKED",
"domain": "General",
"pca_dimension": 2
}

Request Fields

FieldTypeRequiredDescription
textstringYesText to de-identify.
compliance_modestringYesMASKED, GDPR, HIPAA, CUSTOM, or PROPRIETARY.
domainstringNoUsed for proprietary analysis.
levelintegerNoUsed for proprietary analysis.
replacementsobjectNoManual replacement map, used with PROPRIETARY.

For new Guardian Layer integrations, prefer /api/v1/deidentify/text/proprietary/outputs.