Encoding
Encode Text
Detect PII in text and replace it with Privacy Twins. Returns the encoded text, a continuation ID for later decoding, and details of each transformation applied.
Supported entity types: PERSON, EMAIL_ADDRESS, PHONE_NUMBER, US_SSN, DATE_TIME, LOCATION, CREDIT_CARD, IP_ADDRESS, IBAN_CODE, US_PASSPORT, US_DRIVER_LICENSE, NRP, MEDICAL_LICENSE, URL
Detection profiles: detection policy is resolved server-side from the authenticated account. Enterprise accounts use the standard profile. Accounts on the Family plane automatically use the family profile, which additionally protects SCHOOL names and city-level geography. There is no request parameter for the profile; client-supplied values are ignored by design.
SDK Usage:
const result = await client.encode({
data: 'John Doe, SSN: 123-45-6789, email: john@company.com',
sourceContainer: 'customer_db.users',
scoreThreshold: 0.35
});
post/api/scanner/encode
Request body
Example request
{
"data": "John Doe, SSN: 123-45-6789, email: john@company.com",
"sourceContainer": "customer_db.users",
"sourceElement": "personal_info",
"metadata": {
"rowId": "1001",
"source": "crm_system"
},
"scoreThreshold": 0.35,
"language": "en"
}Response
Text encoded successfully
Example response
{
"transformations": [
{
"components": [
{
"original": "John",
"twin": "Maria",
"type": "FIRST_NAME"
}
]
}
]
}