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

datastring required

Input text containing potential PII

sourceContainerstring

Source identifier (e.g., database table name)

sourceElementstring

Element identifier (e.g., column name)

scoreThresholdnumber double

PII detection confidence threshold. Lower values detect more entities but may produce false positives.

languagestring

Language code for PII detection

continuationIdstring

Optional correlation ID to group related encoding operations

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

successboolean
encodedDatastring

Text with PII replaced by Privacy Twins

continuationIdstring

Unique ID for decoding this data later

messagestring

Example response

{
  "transformations": [
    {
      "components": [
        {
          "original": "John",
          "twin": "Maria",
          "type": "FIRST_NAME"
        }
      ]
    }
  ]
}

Changes