Masking APIsMask with Token

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" }
  ]
}
{
  "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:

MethodRouteHeaders
PUT/api/vault/maskAuthorization: Bearer YOUR_AUTH_TOKEN

To get the Authkey please contact help@protecto.ai

Request body

body
maskarray
Required

List of values to mask. Each item must include value and token_name.

body
mask[].valuestring
Required

The raw sensitive value to mask.

body
mask[].token_namestring
Required

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 defined error.

  • See Errors & Limits for the full list of error responses.