> 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="/files/kD3KPPewOrRQRSRn3wEo" 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
