Masking APIsMask with Attributes

Mask with Attributes

Attach custom metadata key-value pairs to masked values for downstream tracking, auditing, or contextual reference.

{
  "mask": [
    {
      "value": "https://platform.openai.com/playground/chat",
      "format": "URL",
      "token_name": "Text Token",
      "attributes": {
        "page_number": "1"
      }
    }
  ]
}
{
  "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": ""
  }
}

Attributes allow you to attach custom metadata to masked values. This is useful for associating contextual information — such as a page number, record ID, or source system — with each masked value.

Endpoint

MethodRouteHeaders
PUT/api/vault/mask{"Authorization": "Bearer <AUTH_TOKEN>"}

To get the Authkey please contact help@protecto.ai

Request body

body
maskarray
Required

List of values to mask.

body
mask[].valuestring
Required

The raw sensitive value to mask.

body
mask[].formatstring

The format to apply for structure-preserving masking.

body
mask[].token_namestring

The token type to use.

body
mask[].attributesobject

Arbitrary key-value metadata to attach to the masked value.

Notes

  • attributes is an object with string keys and string values.

  • Attributes are stored alongside the token and can be used for downstream reference or auditing.

  • Attributes do not affect the masking output — they are metadata only.