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>"
}
]
}
curl -X PUT https://protecto-trial.protecto.ai/api/vault/unmask \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"policy_name": "Anonymization-policy-1",
"unmask": [
{
"token_value": "<PER>hSw8kAEB10 ITItAd8FsN</PER> lives in <ADDRESS>748785848000</ADDRESS>"
}
]
}'
import requests
response = requests.put(
"https://protecto-trial.protecto.ai/api/vault/unmask",
headers={
"Authorization": "Bearer YOUR_AUTH_TOKEN",
"Content-Type": "application/json"
},
json={
"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
| Method | Route | Headers |
|---|---|---|
| PUT | /api/vault/unmask | Authorization: Bearer YOUR_AUTH_TOKEN |
To get the Authkey please contact help@protecto.ai
Request body
The name of the policy to apply during unmasking. If omitted, the default namespace policy applies.
List of tokenized values to unmask.
The tokenized text to unmask.
Notes
-
policy_nameis 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.
Last updated 1 day ago
Built with Documentation.AI