# Mask with format and token

This technique masks data based on user-specified token types (e.g., Text token, Alphanumeric, Numeric Token etc.) as well as predefined formats (e.g., Phone, Email etc.).

***Note:*** To send a request with the authentication token, include the following in headers:&#x20;

Headers: {"Authorization": "Bearer \<AUTH\_TOKEN>"}

<figure><img src="https://323347149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw6GKvSvsZfGhtiQWrONh%2Fuploads%2FuDmIkNLQh54JL2kQDSHs%2Fimage.png?alt=media&#x26;token=27997f35-4c8d-435f-aa53-898979b9128f" alt=""><figcaption></figcaption></figure>

**`Endpoint:`**

```
https://protecto.ai/api/vault/mask
```

**`Request Method: PUT`**

**`Request Payload:`**

```
{"mask": [{ "value": “George Williams”,”token_name": "Numeric Token","format": "Person Name" }]}


```

**`Response:`**

```
{"data": [{"value": " George Williams “, "token_value”": “243 3466",” token_name": "Numeric Token “,"format": "Person Name" }]}
```

**`Response Parameters:`**

·       value (string): Original sensitive data value.

·       token\_value (string): Generated token replacing the sensitive data.

·       format (string): Predefined format of the sensitive data.

**`Advantage:`**

This approach involves replacing sensitive information with tokens while adhering to specific formats that are relevant to the type of data.

1. **`Context Preservation:`** By retaining certain parts of the format, users can still recognize the type of data (e.g. email address) even after masking.
2. **`User Identification:`** Users can quickly identify the masked data (e.g. email address) due to the retained format elements.
3. **`Data Security:`** Sensitive information, such as domain and top-level domain, is masked while allowing users to understand the context of the data.
4. **`Usability:`** Masked data remains usable for identification and analysis purposes, even though specific sensitive details are protected.
5. **`Regulatory Compliance:`** The approach helps organizations comply with data protection regulations while ensuring that users can identify the type of masked data.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.protecto.ai/getting-started/protecto-overview/introduction/protecto-vault/tokenization-apis/masking/mask-with-format-and-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
