New Feature: Users can now send custom attributes in the Mask and UnMask APIs. This feature allows users to tag specific details (such as page numbers) for better tracking when dealing with data that appears across multiple pages.
For example, if the same data exists on multiple pages and users want to track which page is being masked or unmasked, they can add attributes like page numbers in the API request.
Note: Support for "attributes" and "attribute" has been added to the Mask and Unmask API calls. This is an optional key in the JSON payload and does not impact existing functionality.
Endpoint and Authentication: #
To use Protecto.ai’s token-based masking, you need to send a PUT request to the following endpoint:
Method : PUT
Route: api/vault/mask
For authentication, include the following token in the request headers:
Headers: {“Authorization”: “Bearer <AUTH_TOKEN>”}

Mask Request Payload: #
{
"mask": [
{
"value": "https://platform.openai.com/playground/chat?models=gpt-4o",
"format": "URL",
"attributes": {"page_number": "1"},
"token_name": "Text token"
}
]
}
Mask Response: #
{
"data": [
{
"value": "https://platform.openai.com/playground/chat?models=gpt-4o",
"format": "Url",
"attributes": {
"page_number": "1"
},
"token_name": "Text Token",
"token_value": "ooYxG://yFm3aGfq.AqfYIp.akT2Q/NBEjXBhtqL/HKdhW?Ke2LhD=vfXs1z"
}
],
"success": true,
"error": {
"message": ""
}
}
UnMask Request Payload: #
Method : PUT
Route: api/vault/unmask
{
"unmask": [
{
"token_value": "ooYxG://yFm3aGfq.AqfYIp.akT2Q/NBEjXBhtqL/HKdhW?Ke2LhD=vfXs1z",
"attributes": {
"page_number": 1
}
}
]
}
UnMask Response : #
{
"data": [
{
"value": "https://platform.openai.com/playground/chat?models=gpt-4o",
"token_value": "ooYxG://yFm3aGfq.AqfYIp.akT2Q/NBEjXBhtqL/HKdhW?Ke2LhD=vfXs1z",
"toxicity_analysis": {
"toxicity": 0.0007702143,
"severe_toxicity": 0.00010940536,
"obscene": 0.00018111269,
"threat": 0.00010984681,
"insult": 0.00017638586,
"identity_attack": 0.00013660998
},
"attributes": {
"page_number": 1
}
}
],
"success": true,
"error": {
"message": ""
}
}