> For the complete documentation index, see [llms.txt](https://help.protecto.ai/getting-started/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.protecto.ai/getting-started/protecto-overview/introduction/protecto-vault/tokenization-apis/masking/mask-with-token.md).

# Mask with token

With this approach, data is masked according to user-defined token types (e.g., Text token, Alphanumeric, Numeric Token, 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%2FPrGMxSijKEDvIG7Cj5jn%2Fimage.png?alt=media&amp;token=5f698bf6-fd24-44f0-bc65-ce9cfbb3ead5" alt=""><figcaption></figcaption></figure>

**`Endpoint:`**

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

**`Request Method: PUT`**

**`Request Payload:`**

<pre class="language-python"><code class="lang-python">
<strong>{"mask": [{ "value": “George Williams","token_name": "Numeric Token"}]}
</strong></code></pre>

**`Parameters:`**

·       value (string): Sensitive data value to be masked.

·       token\_name (string): Token to be used for masking the sensitive data.

**`Response:`**

```
{"data": [{"value": " George Williams “, "token_value”": “2333",” token_name": "Numeric Token “}]}
```

**`Response Parameters:`**

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

**`Advantage:`**

Token-based masking is a data protection technique that allows users to customize the masking of sensitive data according to their preferences.

1. **`Token Type`:** Users can choose the type of tokens to be used for masking, such as text-based tokens, alphanumeric tokens, or a combination of both.
2. **`Token Length`:** Users can define the desired length of the tokens. For example, tokens can be set to a specific number of characters or digits.
3. **`Case Sensitivity`:** Users may opt for case-sensitive or case-insensitive masking.
