Unmasking APIsUnmask with Policy

Unmask with Policy

Apply a named policy during unmasking to control re-identification behavior and enforce governance rules.

{
  "policy_name": "Anonymization-policy-1",
  "unmask": [
    {
      "token_value": "<PER>hSw8kAEB10 ITItAd8FsN</PER> lives in <ADDRESS>748785848000</ADDRESS>"
    }
  ]
}
{
  "data": [
    {
      "token_value": "<PER>hSw8kAEB10 ITItAd8FsN</PER> lives in <ADDRESS>748785848000</ADDRESS>",
      "value": "George Williams lives in Washington",
      "toxicity_analysis": {
        "toxicity": 0.00088834815,
        "severe_toxicity": 0.000104515464,
        "obscene": 0.00018257574,
        "threat": 0.0001108902,
        "insult": 0.00017547917,
        "identity_attack": 0.00013806517
      }
    }
  ],
  "success": true,
  "error": {
    "message": ""
  }
}

Include policy_name in the unmask request to apply a specific policy's metadata during unmasking. This is used in governance-controlled workflows where re-identification must follow defined rules.

Endpoint details

METHOD: PUT

MethodRouteHeaders
PUT/api/vault/unmaskAuthorization: Bearer YOUR_AUTH_TOKEN

To get the Authkey please contact help@protecto.ai

Request body

body
policy_namestring

The name of the policy to apply during unmasking. If omitted, the default namespace policy applies.

body
unmaskarray
Required

List of tokenized values to unmask.

body
unmask[].token_valuestring
Required

The tokenized text to unmask.

Notes

  • policy_name is optional. If provided, unmasking uses that policy's metadata and permission rules. If omitted, the default namespace policy applies.

  • The policy must exist in your namespace. A missing policy name results in an authorization error.

  • See Policies for a conceptual overview of how policies govern unmasking behavior.