Protect (Preview)
METHOD: POST
ENDPOINT: https://api.playground.protegrity.com/v1/ai
DESCRIPTION:
Detect, classify, and protect sensitive data in a given input. The endpoint will protect the attributes classified as sensitive with a confidence score of 0.68 or more.
ATTRIBUTES:
data
(required) Input data to transform.
format
(required) Specify the format of the input data. Option text
covers unstructured text. Option csv
is used for processing comma-separated values. Accepts: [ text | csv ]
.
operation
(required) Type of operation to perform. Choose classify
to only detect and classify data. Option protect
deidentifies data. Option unprotect
restores de-identified data to its original values. Accepts: [ classify | protect | unprotect ]
OPTIONS:
type
(optional) Specify the protection mechanism. Option mask
replaces all attributes with ‘*****’. Option tokenize
applies a tokenization method that matches the classification of the found attribute. Accepts: [ mask | tokenize ]
. Defaults to mask
.
tags
(optional) Specify if to include tags (or mapping information in the case of structured payloads) to mark protected attributes with their assigned classification label. Tags are required for reversing the protection. Accepts: [ true | false ]
. Defaults to true
.
header_line
(optional) Specific to csv content only. Set to true
if the data includes a header line in the first row. Set to false
in case of the opposite. Accepts: [ true | false ]
. Defaults to false
.
threshold
(optional) Set to the preferred confidence score threshold. Protection will be applied to attributes identified as matching or over the set threshold. Set a to numeric value. If not specified, the threshold is configured to 0.68.
SAMPLE REQUEST – TEXT
curl --location 'https://api.playground.protegrity.com/v1/ai' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
"operation": "protect",
"options": {
"format": "text",
"type": "mask",
"tags": false,
"threshold": 0.7
},
"data": ["Hello, this is Peregrine Grey from Air Industries, could you give me a call back to my mobile number 212-456-7890. Have a lovely day!"]
}'
SAMPLE RESPONSE – TEXT
{
"results": "Hello, this is ############## from Air Industries. Could you give me a call back to my mobile number ############. Have a lovely day!"
}
SAMPLE REQUEST – CSV
curl --location 'https://api.playground.protegrity.com/v1/ai' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
"operation": "protect",
"options": {
"format": "csv",
"header_line": true,
"type": "tokenize",
"tags": true,
"threshold": 0.7
},
"data": ["Social Security Number,Credit Card Number,IBAN,Phone Number\n589-25-1068,349384370543801,FR43 9255 4858 47BG 3EBG U4OK O18,(483) 9440301\n636-36-3077,4041594844904,AL50 8947 4215 KAEY GAPM NLYC FNZG,(113) 5143119\n748-82-2375,3558175715821800,AT34 4082 9269 0841 5702,(763) 5136237\n516-62-9861,560221027976015000,FR22 0068 7181 11FB UG8H ECEM 306,(726) 6031636\n121-49-9409,374283320982549,DK37 5687 8459 8060 79,(624) 9205200\n838-73-3299,5558216060144900,CR54 8952 8144 6403 4765 0,(356) 9479541\n439-11-5310,5048376143641900,RS76 6213 4824 0184 8983 74,(544) 5623326\n564-06-8466,3543299511845640,EE51 6882 3443 7863 4703,(702) 6093849\n518-54-5443,3543019452249540,IT65 D000 3874 2801 Z15I LNLL OOX,(584) 8618371"]
}'
SAMPLE RESPONSE – CSV
{
"mapping": [
{
"classification": "US_SSN",
"column_index": 0
},
{
"classification": "CREDIT_CARD",
"column_index": 1
},
{
"classification": "IBAN_CODE",
"column_index": 2
},
{
"classification": "PHONE_NUMBER",
"column_index": 3
}
],
"data": "Social Security Number,Credit Card Number,IBAN,Phone Number\n548-31-3268,602048102797043,FR17 5415 4336 25BG 3EBG U4OK O64,(654) 3308224\n481-70-3857,1230437596808,AL33 1240 7288 KAEY GAPM NLYC FNZG,(271) 2802977\n755-85-3665,8461740972061430,AT25 0533 9808 8046 3404,(335) 2981943\n557-54-6818,116202261366298390,FR34 2630 5071 38FB UG1H ECEM 902,(614) 1716660\n055-91-9942,888966093482491,DK05 9696 6634 8709 30,(888) 2741502\n964-99-0589,1163706741835754,CR80 1243 0722 7573 5790 0,(871) 3397725\n188-07-4113,4107600970907496,RS64 9873 7248 6702 7241 58,(699) 7510692\n296-61-1694,417282980942395,EE32 8302 5118 1829 2990,(651) 3698973\n979-08-3159,8471859640609227,IT99 D202 3280 0140 Z43I LNLL OOX,(902) 9747145\n"
}
Last modified January 15, 2025