Mask with Token
Mask known sensitive values by explicitly specifying the token type. Use when you already know the data type and don't need structure preservation.
{
"mask": [
{ "value": "John", "token_name": "Text Token" },
{ "value": "Australia", "token_name": "Numeric Token" },
{ "value": "john.doe@example.com", "token_name": "Special Token" }
]
}
curl -X PUT "{baseurl}/api/vault/mask" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mask": [
{ "value": "John", "token_name": "Text Token" },
{ "value": "Australia", "token_name": "Numeric Token" },
{ "value": "john.doe@example.com", "token_name": "Special Token" }
]
}'
import requests
response = requests.put(
"{baseurl}/api/vault/mask",
headers={
"Authorization": "Bearer YOUR_AUTH_TOKEN",
"Content-Type": "application/json"
},
json={
"mask": [
{"value": "John", "token_name": "Text Token"},
{"value": "Australia", "token_name": "Numeric Token"},
{"value": "john.doe@example.com", "token_name": "Special Token"}
]
}
)
print(response.json())
{
"data": [
{ "value": "John", "token_name": "Text Token", "token_value": "t9Eyj" },
{ "value": "Australia", "token_name": "Numeric Token", "token_value": "874890078" },
{ "value": "john.doe@example.com", "token_name": "Special Token", "token_value": "fuot3" }
],
"success": true,
"error": { "message": "" }
}
Use this endpoint when the data type is already known and you want to explicitly choose the token type.
Endpoint
Endpoint and Authentication:
To use this API, you need to send a PUT request to the following endpoint:
| Method | Route | Headers |
|---|---|---|
| PUT | /api/vault/mask | Authorization: Bearer YOUR_AUTH_TOKEN |
To get the Authkey please contact help@protecto.ai
Request body
List of values to mask. Each item must include value and token_name.
The raw sensitive value to mask.
The token type to apply. Must be a supported token name (e.g., Text Token, Numeric Token, Special Token). See Token Types for the full list.
Example
Notes
-
Masking is deterministic — the same value with the same token type always produces the same token.
-
Token names are case- and spelling-sensitive. An invalid name returns a
token_name not definederror. -
See Errors & Limits for the full list of error responses.
Last updated 6 days ago
Built with Documentation.AI