This method automatically identifies and masks personal/sensitive data within specific sentences.
Endpoint and Authentication: #
To use Protecto.ai’s token-based masking, you need to send a PUT request to the following endpoint:
METHOD: PUT
Endpoint: https://portal.protecto.ai/api/vault/mask
For authentication, include the following token in the request headers:
Headers: {“Authorization”: “Bearer <AUTH_TOKEN>”}
Note: To obtain the <auth token>
, please refer to the Step-by-Step Guide to Obtain Your Auth Token.

Request Payload: #
Here’s an example of a request payload to mask sensitive data:
Request Payload:
{ "mask":[{"value": " Sarah Connors, a 34-year-old Caucasian woman residing at 12 Elm Street, Springfield, IL 62704, recently enrolled in TrendyShop’s premium membership program. During her visit to the Springfield location, her vehicle with registration number IL-4598-RM was logged into the parking system. Sarah, who holds a driving license numbered DL-IL-1987-20976, also registered her credit card (4532 7896 4512 3456) to enjoy 10% cashback on purchases. Additionally, her phone number (217-555-2020) and email address (sarah.connors88@example.com) and her company contact is www.xyz.com"}]}
Parameters for the Request Payload:
· value (string): Sensitive data value that needs to be masked.
Response :
Upon successful masking, you will receive a response with the masked data. Here’s an example of a response:
{ "data": [ { "value": " Sarah Connors, a 34-year-old Caucasian woman residing at 12 Elm Street, Springfield, IL 62704, recently enrolled in TrendyShop’s premium membership program. During her visit to the Springfield location, her vehicle with registration number IL-4598-RM was logged into the parking system. Sarah, who holds a driving license numbered DL-IL-1987-20976, also registered her credit card (4532 7896 4512 3456) to enjoy 10% cashback on purchases. Additionally, her phone number (217-555-2020) and email address (sarah.connors88@example.com) and her company contact is www.xyz.com", "token_value": " <PER>6qdEj Cvwk7Jb</PER>, a <DOB>0P57NmVL-0BRm7bG2-0MWyH97K</DOB> <NATIONALITY>XY4RrM66e</NATIONALITY> woman residing at <ADDRESS>1WRq8 o0MIo 73hnlu</ADDRESS>, <ADDRESS>fElmU6x5TP, y7uYI 6Ri3T</ADDRESS>, recently enrolled in <ORG>VbbPUgl3Tc</ORG>’s premium membership program. During her visit to the <ADDRESS>fElmU6x5TP</ADDRESS> location, her vehicle with registration number <VEHICLE_REG_NO>0S0nTV5i-0UxZmZBb-0VWDK2DT</VEHICLE_REG_NO> was logged into the parking system. <PER>6qdEj</PER>, who holds a driving license numbered <DL_NO>0XNJ8N5j-0S0nTV5i-0Xp89So6-0eLB0IxP</DL_NO>, also registered her credit card (<CRD>4501639196</CRD>) to enjoy 10% cashback on purchases. Additionally, her phone number <PHN>(07171-54508-49088</PHN>) and email address (<EMAIL>0gN3SkjL@0ffM3CDS</EMAIL>) and her company contact is www.xyz.com", "toxicity_analysis": { "toxicity": 0.0006348075112327933, "severe_toxicity": 0.00011970159539487213, "obscene": 0.000186424920684658, "threat": 0.00011724177602445707, "insult": 0.00017848866991698742, "identity_attack": 0.00014350650599226356 }, "individual_tokens": [ { "value": "Sarah Connors", "pii_type": "PERSON", "token": "6qdEj Cvwk7Jb", "prefix": "<PER>", "suffix": "</PER>", "start_pos": 1, "end_pos": 14 }, { "value": "34-year-old", "pii_type": "DATE_OF_BIRTH", "token": "0P57NmVL-0BRm7bG2-0MWyH97K", "prefix": "<DOB>", "suffix": "</DOB>", "start_pos": 18, "end_pos": 29 }, { "value": "Caucasian", "pii_type": "NATIONALITY", "token": "XY4RrM66e", "prefix": "<NATIONALITY>", "suffix": "</NATIONALITY>", "start_pos": 30, "end_pos": 39 }, { "value": "12 Elm Street", "pii_type": "ADDRESS", "token": "1WRq8 o0MIo 73hnlu", "prefix": "<ADDRESS>", "suffix": "</ADDRESS>", "start_pos": 58, "end_pos": 71 }, { "value": "Springfield, IL 62704", "pii_type": "ADDRESS", "token": "fElmU6x5TP, y7uYI 6Ri3T", "prefix": "<ADDRESS>", "suffix": "</ADDRESS>", "start_pos": 73, "end_pos": 94 }, { "value": "TrendyShop", "pii_type": "ORG", "token": "VbbPUgl3Tc", "prefix": "<ORG>", "suffix": "</ORG>", "start_pos": 117, "end_pos": 127 }, { "value": "Springfield", "pii_type": "ADDRESS", "token": "fElmU6x5TP", "prefix": "<ADDRESS>", "suffix": "</ADDRESS>", "start_pos": 182, "end_pos": 193 }, { "value": "IL-4598-RM", "pii_type": "VEHICLE_REGISTRATION_NUMBER", "token": "0S0nTV5i-0UxZmZBb-0VWDK2DT", "prefix": "<VEHICLE_REG_NO>", "suffix": "</VEHICLE_REG_NO>", "start_pos": 241, "end_pos": 251 }, { "value": "Sarah", "pii_type": "PERSON", "token": "6qdEj", "prefix": "<PER>", "suffix": "</PER>", "start_pos": 288, "end_pos": 293 }, { "value": "DL-IL-1987-20976", "pii_type": "DRIVING_LICENSE_NUMBER", "token": "0XNJ8N5j-0S0nTV5i-0Xp89So6-0eLB0IxP", "prefix": "<DL_NO>", "suffix": "</DL_NO>", "start_pos": 332, "end_pos": 348 }, { "value": "4532 7896 4512 3456", "pii_type": "CREDIT_CARD", "token": "4501639196", "prefix": "<CRD>", "suffix": "</CRD>", "start_pos": 383, "end_pos": 402 }, { "value": "(217-555-2020", "pii_type": "PHONE_NUMBER", "token": "(07171-54508-49088", "prefix": "<PHN>", "suffix": "</PHN>", "start_pos": 471, "end_pos": 484 }, { "value": "sarah.connors88@example.com", "pii_type": "EMAIL_ADDRESS", "token": "0gN3SkjL@0ffM3CDS", "prefix": "<EMAIL>", "suffix": "</EMAIL>", "start_pos": 505, "end_pos": 532 } ], "excluded_entities": [ { "value": "www.xyz.com", "pii_type": "URL", "start_pos": 561, "end_pos": 572 } ] } ], "success": true, "error": { "message": "" } }
We identify toxic content while masking. Click on ‘Identify Toxic Content‘ to learn more.
Response Parameters:
data
: An array containing the unmasked text along with additional analyses and individual tokens.value
: The original masked text.token_value
: The unmasked text with sensitive information replaced by tokenized values.toxicity_analysis
: Analysis of the toxicity levels in the unmasked text.toxicity
: Overall toxicity score.severe_toxicity
: Score indicating severe toxicity.obscene
: Score indicating obscenity.threat
: Score indicating threats.insult
: Score indicating insults.identity_attack
: Score indicating identity attacks.
individual_tokens
: An array containing individual tokens extracted from the unmasked text, along with their types and positions.value
: The value of the token.pii_type
: The type of personally identifiable information (PII) detected (e.g., PERSON, GPE).token
: The tokenized representation of the value.prefix
: Prefix indicating the start of the token.suffix
: Suffix indicating the end of the token.start_pos
: Starting position of the token in the original text.end_pos
: Ending position of the token in the original text.
success
: Boolean indicating the success of the request.error
: Object containing details of any errors encountered during the request.message
: Error message, if any.
Advantage :
This approach is particularly useful when users may not be aware of all the sensitive data present in a given text or when dealing with large volumes of data where manual identification is impractical. Auto-detect masking offers the following advantages:
- Effortless Sensitive Data Identification: Users do not need to manually identify and specify sensitive data elements within the text. The system automatically detects patterns and formats indicative of sensitive information, such as names, phone numbers, credit card numbers, etc
- Comprehensive Data Protection: Auto-detect masking ensures that all instances of sensitive data within a dataset are masked, providing a comprehensive approach to data security. This is especially valuable for scenarios where users may not be aware of all the potential data types that need protection
- Reduced Human Error: Automated detection reduces the risk of human errors that can occur during manual identification and specification of sensitive data. It enhances accuracy and consistency in data protection processes.
- Time and Resource Savings: Auto-detect masking saves time and effort, particularly when dealing with large amounts of data. Users do not need to spend time identifying each instance of sensitive data, allowing them to focus on other tasks.