Mask with Format
Mask sensitive values while preserving the structure of the original — such as phone number punctuation or email domain format.
{
"mask": [
{
"value": "(408)- 426 - 9989",
"format": "Phone Number",
"token_name": "Numeric Token"
},
{
"value": "kumar@fss.com",
"format": "Email Address",
"token_name": "Text Token"
}
]
}
curl -X PUT https://protecto-trial.protecto.ai/api/vault/mask \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mask": [
{
"value": "(408)- 426 - 9989",
"format": "Phone Number",
"token_name": "Numeric Token"
},
{
"value": "kumar@fss.com",
"format": "Email Address",
"token_name": "Text Token"
}
]
}'
import requests
response = requests.put(
"https://protecto-trial.protecto.ai/api/vault/mask",
headers={
"Authorization": "Bearer YOUR_AUTH_TOKEN",
"Content-Type": "application/json"
},
json={
"mask": [
{"value": "(408)- 426 - 9989", "format": "Phone Number", "token_name": "Numeric Token"},
{"value": "kumar@fss.com", "format": "Email Address", "token_name": "Text Token"}
]
}
)
{
"data": [
{
"value": "(408)- 426 - 9989",
"format": "Phone Number",
"token_name": "Numeric Token",
"token_value": "(07432)- 29915 - 56713"
},
{
"value": "kumar@fss.com",
"format": "Email Address",
"token_name": "Text Token",
"token_value": "LEFQS@WJoZudg"
}
],
"success": true,
"error": { "message": "" }
}
Use this when the structure of the value must be preserved, such as punctuation in phone numbers or domains in email addresses. The masked output will look like a valid value of the same type.
Endpoint
| Method | Route | Headers |
|---|---|---|
| PUT | /api/vault/mask | {"Authorization": "Bearer <AUTH_TOKEN>"} |
To get the Authkey please contact help@protecto.ai
Request body
List of values to mask with format preservation.
The raw sensitive value to mask.
The format to apply. Must be a supported format name (e.g., Phone Number, Email Address, URL). See Supported Formats for the full list.
The token type to use alongside the format.
Notes
-
Format names are case- and spelling-sensitive. An invalid name returns a
format name not definederror. -
Format-masked output preserves the structure (length, character pattern, separators) but not the content.
-
See Supported Formats for all valid format names.
-
See Errors & Limits for the full list of error responses.
Last updated 1 day ago
Built with Documentation.AI