This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Using the API

What to expect

Protegrity API Playground features functionality derived from the original suite of Protegrity products in a form of API calls. Our API endpoints are easy-to-use and ask for minimal configuration. The Playground divides available endpoint portfolio into the following families:

  • Data Protection endpoints, covering sensitive data protection. Users can decide to transform various data types, from numbers, strings, and dates without any inherent logic tom specific PII attributes like postcodes, or social security numbers.
  • Sensitive Data Discovery endpoints, which allow users to detect and classify sensitive data within payloads.
  • GenAI Security endpoints that combine the capabilities of the above, allowing users to perform automatic discovery and protection of sensitive data and specify their risk tolerance.
  • Private endpoints low-level APIs that are the closest to the actual product experience, allowing for high customization. We suggest using the private endpoints for conducting PoCs in house – with Protegrity’s Professional Services guidance. The endpoints are disabled to all users by default and are available upon request only.

Note: Protegrity does not store any data received from external API requests.

Watch the video below to learn how to use the API Playground:

1 - Usage & Limitations

Limits of the API

To ensure fair use of the API service, we enforce rate limits on API requests.

These limits are:

  • Request Rate: 50 per second
  • Burst: up to 100
  • Quota: 10,000 requests per user
  • Max. Payload Size: 1MB

The same limits do not apply when using the Private endpoints.

Note: Users are removed from the platform after 30 days of inactivity.

2 - Required Headers

Required authentication headers

Every request should carry the following headers:

  • x-api-key (required): Your unique API Key. Received after a successful sign-up.

  • Authorization (required): A JWT token for the session. Obtained by running the Login and Change Password endpoints.

  • Content-Type (required): Set to application/json.

3 - Users and Roles

Built-in users and roles to impersonate

To add additional flavor to your testing activities, you can now leverage any of the preconfigured users to showcase Protegrity’s Role-Based Access Controls. Using a diffierent user will result in distinct views over sensitive data. Some users will only be able to protect data but will not be able to reverse the operation. Some users will only be able to re-identify selected attributes.

To use any of the roles, simply pass your chosen value to the payload in the user attribute during the protect or unprotect operation. If the user is not specified, the request will default to superuser.

Available Roles

The following roles and users have been configured and are available for use:

ADMIN:

admin or devops or jay.banerjee The role can protect all data but cannot unprotect. Upon an unprotection attempt they will be displayed protected values.

FINANCE:

finance or robin.goodwill The role can unprotect all PII and PCI data. The role cannot protect any data. When attempting to unprotect data without authorization, they will be displayed nulls.

MARKETING:

marketing or merlin.ishida The role can unprotect some PII data that is required for analytical research and campaign outreach. When attempting to unprotect data without authorization, they will be displayed nulls. The role cannot protect any data.

HR:

hr or paloma.torres The role can unprotect all PII data but cannot view any PCI data. When attempting to unprotect data without authorization, they will be displayed nulls. The role cannot protect any data.

OTHER:

superuser The role can perform any protect and unprotect operation. The role has been made available for testing only – we strongly advise against creating superuser roles in your environments.

Additionally, you may type in any user name to simulate unauthorized user behavior.

4 - Sensitive Data Discovery Endpoints

Detecting sensitive information

Sensitive data discovery is a cornerstone of any data-centric security initiative: it helps understand whether any sensitive data resides at rest, or it is present within ETL pipelines or elsewhere in-transit. The API Playground exposes REST endpoint that can be used to identify sensitive data within received payloads.

4.1 - Discover

Detect and classify sensitive data

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/discover

DESCRIPTION:

Detect and classify sensitive data in a given input. The endpoint will return a classification and confidence score for every sensitive attribute found, alongside its location – a column name or a start and end index. Confidence score returns values from 0.1 to 1. The higher the confidence score, the more the product is sure of the PII classification it produced. We recommend using the confidence score to prioritize inspection of found sensitive data.

ATTRIBUTES:

data (required) Input data to transform.

OPTIONS:

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 ].

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.

raw (optional) Returns verbose output of the classification job when set to true. Accepts: [ true | false ]. Defaults to false.

SAMPLE REQUEST – TEXT

curl --location 'https://api.playground.protegrity.com/v1/discover' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
    "options": {
        "format": "text",
        "raw": false
    },
    "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!"]
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/discover' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
      "options": {
        "format": "text",
        "raw": "false"
    },
    "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!"]

} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)

  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/discover");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"options\": {\n" + //
                "        \"format\": \"text\",\n" + //
                "        \"raw\": false\n" + //
                "    },\n" + //
                "    \"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!\"]\n" + //
                " }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}

  
fetch('https://api.playground.protegrity.com/v1/discover', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "options": {
          "format": "text",
          "raw": false
      },
      "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!"]
  
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 

  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/discover" 
	data := strings.NewReader(`{ 
		 "options": {
        "format": "text",
        "raw": false
    },
    "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!"]
}`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}

  

SAMPLE RESPONSE – TEXT


[
    {
        "score": 0.85,
        "classification": "PHONE_NUMBER",
        "start_index": 101,
        "end_index": 113
    },
    {
        "score": 0.99,
        "classification": "PERSON",
        "start_index": 15,
        "end_index": 29
    }
]

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": "classify",
    "options": {
        "format": "csv",
        "header_line": true,
        "raw": false
    },
    "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"]
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/discover' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "classify",
    "options": {
        "format": "csv",
        "header_line": "true",
        "raw": "false"
    },
    "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"]

} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)  
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/discover");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"classify\",\n" + //
                "    \"options\": {\n" + //
                "        \"format\": \"csv\",\n" + //
                "        \"header_line\": true,\n" + //
                "        \"raw\": false\n" + //
                "    },\n" + //
                "    \"data\": [\"Social Security Number,Credit Card Number,IBAN,Phone Number\\n" + //
                "589-25-1068,349384370543801,FR43 9255 4858 47BG 3EBG U4OK O18,(483) 9440301\\n" + //
                "636-36-3077,4041594844904,AL50 8947 4215 KAEY GAPM NLYC FNZG,(113) 5143119\\n" + //
                "748-82-2375,3558175715821800,AT34 4082 9269 0841 5702,(763) 5136237\\n" + //
                "516-62-9861,560221027976015000,FR22 0068 7181 11FB UG8H ECEM 306,(726) 6031636\\n" + //
                "121-49-9409,374283320982549,DK37 5687 8459 8060 79,(624) 9205200\\n" + //
                "838-73-3299,5558216060144900,CR54 8952 8144 6403 4765 0,(356) 9479541\\n" + //
                "439-11-5310,5048376143641900,RS76 6213 4824 0184 8983 74,(544) 5623326\\n" + //
                "564-06-8466,3543299511845640,EE51 6882 3443 7863 4703,(702) 6093849\\n" + //
                "518-54-5443,3543019452249540,IT65 D000 3874 2801 Z15I LNLL OOX,(584) 8618371\"]\n" + //
                " }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/discover', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "classify",
        "options": {
            "format": "csv",
            "header_line": true,
            "raw": false
        },
        "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"]

        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/discover" 
	data := strings.NewReader(`{ 
		"operation": "classify",
		"options": {
			"format": "csv",
			"header_line": true,
			"raw": false
		},
		"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"]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
  

SAMPLE RESPONSE – CSV


[
    {
        "score": 0.85,
        "classification": "US_SSN",
        "column_name": "Social Security Number",
        "column_index": 0
    },
    {
        "score": 0.11,
        "classification": "CREDIT_CARD",
        "column_name": "Credit Card Number",
        "column_index": 1
    },
    {
        "score": 0.04,
        "classification": "US_BANK_NUMBER",
        "column_name": "Credit Card Number",
        "column_index": 1
    },
    {
        "score": 0.0,
        "classification": "US_DRIVER_LICENSE",
        "column_name": "Credit Card Number",
        "column_index": 1
    },
    {
        "score": 0.01,
        "classification": "US_DRIVER_LICENSE",
        "column_name": "IBAN",
        "column_index": 2
    },
    {
        "score": 0.01,
        "classification": "US_DRIVER_LICENSE",
        "column_name": "Phone Number",
        "column_index": 3
    },
    {
        "score": 0.79,
        "classification": "IBAN_CODE",
        "column_name": "IBAN",
        "column_index": 2
    },
    {
        "score": 0.09,
        "classification": "DATE_TIME",
        "column_name": "IBAN",
        "column_index": 2
    },
    {
        "score": 0.75,
        "classification": "PHONE_NUMBER",
        "column_name": "Phone Number",
        "column_index": 3
    },
    {
        "score": 0.01,
        "classification": "PERSON",
        "column_name": "Phone Number",
        "column_index": 3
    }
]

5 - Data Protection Endpoints

Protecting names, addresses, and other PII information

Protegrity API Playground exposes a curated selection of endpoints for data protection: you can use them to secure any PII and PCI information. The predefined endpoints include names, addresses, numbers, Credit Card Numbers, Social Security Numbers, and more. Format, length and language preservation are supported.

This collection is a subset of Protegrity functions available in the full version of the product.

5.1 - Name (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/name

DESCRIPTION:

Protect or unprotect a person’s name. The received token is not length-preserving.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

dictionary (optional) Specify the Unicode domain of the input and output values. Option en covers all characters within the Basic Latin block of the Unicode standard (range U+0000..U+007F). Options de and fr extend that coverage to include German and French characters, respectively. Accepts: [ en | de | fr ]. Defaults to en.

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/name' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["Robin", "Wren"],
  "options": {
    "dictionary": "en"
  }
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/name' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["Robin", "Wren"], 
    "options": { 
      "dictionary": "en"
      } 
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)

  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/name");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"Robin\", \"Wren\"], \"options\": { \"dictionary\": \"en\" } }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/name', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["Robin", "Wren"], 
        "options": { "dictionary": "en" } 
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/name" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["Robin", "Wren"],
		"options": {"dictionary": "en"} 
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}

  

SAMPLE RESPONSE


[
    "xkKZQ",
    "hTKo"
]

5.2 - Address (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/address

DESCRIPTION:

Protect or unprotect an address. The received token is not length-preserving.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

dictionary (optional) Specify the Unicode domain of the input and output values. Option en covers all characters within the Basic Latin block of the Unicode standard (range U+0000..U+007F). Options de and fr extend that coverage to include German and French characters, respectively. Accepts: [ en | de | fr ]. Defaults to en.

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/address'
--header 'x-api-key: <API_Key>'
--header 'Content-Type: application/json'
--header 'Authorization: <JWT_TOKEN>'
--data '{
  "operation": "protect",
  "data": ["77 Boulevard Saint-Jacques", "46 avenue de la Grande Armée"],
  "options": {
    "dictionary": "fr"
  }
}' 
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/address' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["77 Boulevard Saint-Jacques", "46 avenue de la Grande Armée"], 
    "options": { 
      "dictionary": "fr"
      } 
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/address");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"77 Boulevard Saint-Jacques\", \"46 avenue de la Grande Armée\"], \"options\": { \"dictionary\": \"fr\" } }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/address', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["77 Boulevard Saint-Jacques", "46 avenue de la Grande Armée"], 
        "options": { "dictionary": "fr" } 
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));   
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/address" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["77 Boulevard Saint-Jacques", "46 avenue de la Grande Armée"],
		"options": {"dictionary": "fr"} 
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
  

SAMPLE RESPONSE


[
  "3u CG5itJTNu KJStq-galulig",
  "Gr AY5iAK k1 n8 LvIx74 ewBék"
]

5.3 - City (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/city

DESCRIPTION:

Protect or unprotect a town or city. The received token is not length-preserving.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

dictionary (optional) Specify the Unicode domain of the input and output values. Option en covers all characters within the Basic Latin block of the Unicode standard (range U+0000..U+007F). Options de and fr extend that coverage to include German and French characters, respectively. Accepts: [ en | de | fr ]. Defaults to en.

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/city' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["Berlin", "München"],
  "options": {
    "dictionary": "de"
  }
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/city' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["Berlin", "München"], 
    "options": { 
      "dictionary": "de"
      } 
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)

  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/city");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"Berlin\", \"München\"], \"options\": { \"dictionary\": \"de\" } }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
  
  
fetch('https://api.playground.protegrity.com/v1/city', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["Berlin", "München"], 
        "options": { "dictionary": "de" } 
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 

 
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/city" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["Berlin", "München"],
		"options": {"dictionary": "de"} 
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}

 

SAMPLE RESPONSE


[
  "hjsöIO",
  "YAßiaoP"
]

5.4 - Postcode (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/postcode

DESCRIPTION:

Protect or unprotect a postal code with digits and chatacters. The received token is case-, length-, and position-preserving but may create invalid postal codes (e.g., restricted letters).

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/postcode' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["WX90GA", "SW700"]
}' 
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/postcode' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["WX90GA", "SW700"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/postcode");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"WX90GA\", \"SW700\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/postcode', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["WX90GA", "SW700"]
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/postcode" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["WX90GA", "SW700"]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
  

SAMPLE RESPONSE


[
  "AD12TT",
  "II867"
]

5.5 - Zipcode (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/zipcode

DESCRIPTION:

Protect or unprotect a postal code with digits only. The received token is length-preserving. The method may produce leading zeroes and invalid zipcodes (e.g., restricted digits).

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/zipcode' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["29017", "28100"]
}' 

  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/zipcode' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["29017", "28100"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/zipcode");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"29017\", \"28100\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/zipcode', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["29017", "28100"]
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/zipcode" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["29017", "28100"]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
  

SAMPLE RESPONSE


[
  "00891",
  "67996"
]

5.6 - Phone (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/phone

DESCRIPTION:

Protect or unprotect a phone number. The received token is length-preserving. May return leading zeroes.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/phone' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["63098109", "120-99-02-10"]
}' 
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/phone' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["63098109", "120-99-02-10"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/phone");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"63098109\", \"120-99-02-10\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
  fetch('https://api.playground.protegrity.com/v1/phone', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["63098109", "120-99-02-10"]
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
  
  package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/phone" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["63098109", "120-99-02-10"]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
  

SAMPLE RESPONSE


[
  "81176289",
  "425-44-65-10"
]

5.7 - Email (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/email

DESCRIPTION:

Protect or unprotect a phone number. The received token is length-preserving. May return leading zeroes.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/email' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["ava.mcconnor@acme.corp", "wren@business.com"]
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/email' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["ava.mcconnor@acme.corp", "wren@business.com"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text) 
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/email");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"ava.mcconnor@acme.corp\", \"wren@business.com\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/email', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["ava.mcconnor@acme.corp", "wren@business.com"]
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));   
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/email" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["ava.mcconnor@acme.corp", "wren@business.com"] 
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}  
  

SAMPLE RESPONSE


[
  "d3E.ui2sOks@acme.corp",
  "6KOe@business.com"
]

5.8 - Date of Birth (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/dob

DESCRIPTION:

Protect or unprotect a phone number. The received token is length-preserving. May return leading zeroes.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

year (optional) Set to true to leave the year in the clear. Must be set to true when unprotecting the string tokenized using this option. Accepts: [ true | false ]. Defaults to false.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/dob' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["1980/12/10", "1965/01/27"],
  "options": {
    "year": true
  }
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/dob' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["1980/12/10", "1965/01/27"],
  "options": {
    "year": "true"
  }
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/dob");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"1980/12/10\", \"1965/01/27\"], \"options\": { \"year\": \"true\" } }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/dob', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["1980/12/10", "1965/01/27"],
        "options": {
          "year": true
        } 
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));   
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/dob" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["1980/12/10", "1965/01/27"],
		"options": {
			"year": true
		}
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}  
  

SAMPLE RESPONSE


[
  "1980/03/24",
  "1965/08/11"
]

5.9 - National Insurance Number (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/nin

DESCRIPTION:

Protect or unprotect a National Insurance Number (UK). The returned NIN is case-, length- and position-preserving, i.e., generated letters and numbers will adhere to their original position. Note that some NIN logic, i.e. restricted letters, is not preserved.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/nin' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["QQ123456A", "KT902281F"]
}' 
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/nin' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["QQ123456A", "KT902281F"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/nin");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"QQ123456A\", \"KT902281F\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/nin', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["QQ123456A", "KT902281F"]
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/nin" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["QQ123456A", "KT902281F"]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}  
  

SAMPLE RESPONSE


[
  "CD196371K",
  "OO918451S"
]

5.10 - Social Security Number (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/ssn

DESCRIPTION:

Protect or unprotect a Social Security Number (US). The returned SSN is length- and format-preserving. Note that some SSN logic, i.e. restricted numbers within digit groups, is not preserved.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/ssn' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["782-01-2930", "291-44-5983"]
}' 
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/ssn' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["782-01-2930", "291-44-5983"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/ssn");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"782-01-2930\", \"291-44-5983\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/ssn', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["782-01-2930", "291-44-5983"] 
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));   
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/ssn" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["782-01-2930", "291-44-5983"] 
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}  
  

SAMPLE RESPONSE


[
  "399-03-3685",
  "389-71-6451"
]

5.11 - Credit Card Number (PCI DSS)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/ccn

DESCRIPTION:

Protect or unprotect a Credit Card Number. The returned CCN is not length-preserving. The endpoint accepts partial CCN protection, i.e. leaving the 8-digit BIN in the clear.

ATTRIBUTES:

data (required) Input data to transform.

user (optional) Choose a user to impersonate from the list of pre-configured roles.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

OPTIONS:

bin (optional) Set to true to leave the 8-digit BIN number in the clear. Must be set to true when unprotecting the string tokenized using this option. Accepts: [ true | false ]. Defaults to false.

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/ccn'
--header 'x-api-key: <API_Key>'
--header 'Content-Type: application/json'
--header 'Authorization: <JWT_TOKEN>'
--data '{ "operation": "protect", "data": ["4321567898765432", "2376876534560987"], "options": { "bin": false } }' 
import requests import json

url = 'https://api.playground.protegrity.com/v1/ccn' 
headers = { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' } 
data = { 
    "operation": "protect", 
    "data": ["4321567898765432", "2376876534560987"], 
    "options": { 
      "bin": false 
      } 
    } 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text) 
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/ccn");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"4321567898765432\", \"2376876534560987\"], \"options\": { \"bin\": false } }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
fetch('https://api.playground.protegrity.com/v1/ccn', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["4321567898765432", "2376876534560987"], 
        "options": { "bin": false } 
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
      
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/ccn" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["4321567898765432", "2376876534560987"],
		"options": {"bin": false} 
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
} 

SAMPLE RESPONSE


[
  "0449999816792240",
  "6683962881463918"
]

5.12 - Passport (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/passport

DESCRIPTION:

Protect or unprotect a passport number. The returned passport number is case-, length- and position-preserving (i.e., generated letters and numbers will adhere to their original position). Note that some passport logic, i.e. restricted letters, is not preserved.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/passport' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["FA039020112", "CBR90110244"]
}' 
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/passport' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["FA039020112", "CBR90110244"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/passport");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"FA039020112\", \"CBR90110244\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
  fetch('https://api.playground.protegrity.com/v1/passport', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["FA039020112", "CBR90110244"]
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/passport" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["FA039020112", "CBR90110244"]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
  

SAMPLE RESPONSE


[
  "IN890183422",
  "GFR67102933"
]

5.13 - IBAN (PII)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/iban

DESCRIPTION:

Protect or unprotect an Internation Banking Account Number. The returned IBAN is case-, length- and position-preserving. Note that some IBAN logic, i.e., producing valid country codes or a checksum validation, is not supported. The endpoint accepts partial IBAN protection, i.e., leaving the letters in the clear.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

alpha (optional) Set to true to leave the original letters in the clear. Must be set to true when unprotecting the string tokenized using this option. Accepts: [ true | false ]. Defaults to false.

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload. Note that this option is only available if alpha is set to true.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/iban' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["NO8330001234567", "QA54QNBA000000000000693123456"],
  "options": {
    "alpha": true
  }
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/iban' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["NO8330001234567", "QA54QNBA000000000000693123456"], 
        "options": {
          "alpha": "true"
        }
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/iban");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"NO8330001234567\", \"QA54QNBA000000000000693123456\"], \"options\": { \"alpha\": \"true\" } }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/iban', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["NO8330001234567", "QA54QNBA000000000000693123456"], 
        "options": {
          "alpha": true
        }
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));   
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/iban" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["NO8330001234567", "QA54QNBA000000000000693123456"], 
        "options": {
          "alpha": true
        }
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}  
  

SAMPLE RESPONSE


[
  "NO0980006979071",
  "QA13QNBA128618782491645358717"
]

5.14 - String

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/string

DESCRIPTION:

Protect or unprotect a string. Maximum length of the string is 128 characters. The returned string is not length-preserving neither case-preserving.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/string' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["hello", "world"]
}' 
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/string' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["hello", "world"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/string");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"Hello\", \"World\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/string', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["hello", "world"]
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));   
  
 package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/string" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["hello", "world"]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
} 
  

SAMPLE RESPONSE


[
  "UkosA",
  "okPPwa"
]

5.15 - Number

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/number

DESCRIPTION:

Protect or unprotect a number. The returned number is length-preserving. The endpoint might generate numbers with leading zeros.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/number' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["123654", "987654"]
}' 
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/number' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["123654", "987654"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/number");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"123654\", \"987654\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/number', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["123654", "987654"]
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/number" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["123654", "987654"]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
  

SAMPLE RESPONSE


[
  "034539",
  "101012"
]

5.16 - Text (Encryption)

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/text

DESCRIPTION:

Protect or unprotect sample text using encryption. Received text must be hex encoded. The returned value is hex encoded. There is no limitation on the text’s length however payload limits apply.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/text' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["48656c6c6f20576f726c640a"]
}' 
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/text' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["48656c6c6f20576f726c640a"]
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/text");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"48656c6c6f20576f726c640a\"] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/text', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["48656c6c6f20576f726c640a"] 
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));   
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/text" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["48656c6c6f20576f726c640a"]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}  
  

SAMPLE RESPONSE


[
  "E616C7B0762E28A32E0FABF4BC403C8D"
]

5.17 - Datetime

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/datetime

DESCRIPTION:

Protect or unprotect a datetime string The endpoint accepts partial timestamp protection, i.e., leaving the year value in the clear. Supported formats: YYYY/MM/DD and YYYY/MM/DD HH:MM:SS. Supported delimiters: /, -, .; space or T are supported between date and time.

ATTRIBUTES:

data (required) Input data to transform.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

year (optional) Set to true to leave the year in the clear. Must be set to true when unprotecting the string tokenized using this option. Accepts: [ true | false ]. Defaults to false.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/datetime' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
  "operation": "protect",
  "data": ["1980/12/10 14:12:01", "1965/01/27"],
  "options": {
    "year": true
  }
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/datetime' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
    "operation": "protect", 
    "data": ["1980/12/10 14:12:01", "1965/01/27"],
  "options": {
    "year": true
  }
} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/datetime");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\"1980/12/10 14:12:01\", \"1965/01/27\"], \"options\": { \"year\": \"true\" } }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/datetime', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": ["1980/12/10 14:12:01", "1965/01/27"],
        "options": {
          "year": true
        }
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));   
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/datetime" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": ["1980/12/10 14:12:01", "1965/01/27"],
    "options": {
      "year": true
      }
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}  

SAMPLE RESPONSE


[
  "1980/03/24 03:19:45",
  "1965/08/11"
]

5.18 - Multitype

Data protection endpoint

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/multi

DESCRIPTION:

Protect or unprotect various attributes within a payload. Please refer to the specific payload type descriptions to see available options.

ATTRIBUTES:

data (required) Input data to transform.

type (required) Type of data provided. It should match one of available Data Protection endpoints, e.g. name, address, ccn.

operation (required) Specify if to protect or unprotect data. Accepts: [ protect | unprotect ].

id (required) A numeric id for tracking separete elements.

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

options (optional) Options as available for each endpoint type.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/multi' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '[
  {
    "id": 1,
    "type": "address",
    "operation": "protect",
    "data": ["Place 8 Rue Nicolau", "46 avenue de la Grande Armée"],
    "options":{
      "dictionary": "fr"
    }
  },
  {
    "id": 2,
    "type": "city",
    "operation": "protect",
    "data": ["Paris"]
  }
]'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/multi' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = [
  {
    "id": 1,
    "type": "address",
    "operation": "protect",
    "data": ["Place 8 Rue Nicolau", "46 avenue de la Grande Armée"],
    "options":{
      "dictionary": "fr"
    }
  },
  {
    "id": 2,
    "type": "city",
    "operation": "protect",
    "data": ["Paris"]
  }
]

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)


  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/mutli");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\", \"data\": [\n" + //
                "  {\n" + //
                "    \"id\": 1,\n" + //
                "    \"type\": \"address\",\n" + //
                "    \"operation\": \"protect\",\n" + //
                "    \"data\": [\"Place 8 Rue Nicolau\", \"46 avenue de la Grande Armée\"],\n" + //
                "    \"options\":{\n" + //
                "      \"dictionary\": \"fr\"\n" + //
                "    }\n" + //
                "  },\n" + //
                "  {\n" + //
                "    \"id\": 2,\n" + //
                "    \"type\": \"city\",\n" + //
                "    \"operation\": \"protect\",\n" + //
                "    \"data\": [\"Paris\"]\n" + //
                "  }\n" + //
                "] }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}

  
fetch('https://api.playground.protegrity.com/v1/multi', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "operation": "protect", 
        "data": [
          {
            "id": 1,
            "type": "address",
            "operation": "protect",
            "data": ["Place 8 Rue Nicolau", "46 avenue de la Grande Armée"],
            "options":{
              "dictionary": "fr"
            }
          },
          {
            "id": 2,
            "type": "city",
            "operation": "protect",
            "data": ["Paris"]
          }
        ]
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));   

  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/multi" 
	data := strings.NewReader(`{ 
		"operation": "protect", 
		"data": [
			{
				"id": 1,
				"type": "address",
				"operation": "protect",
				"data": ["Place 8 Rue Nicolau", "46 avenue de la Grande Armée"],
				"options":{
				"dictionary": "fr"
				}
			},
			{
				"id": 2,
				"type": "city",
				"operation": "protect",
				"data": ["Paris"]
			}
		]
	  }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}

  

SAMPLE RESPONSE


[
    {
        "id": "1",
        "results": [
            "è6HmO s 0Cq okÎHWmxÛR",
            "sC ÈÂÉÉut éj Âî C1io3V 7xIoZSV"
        ]
    },
    {
        "id": "2",
        "results": [
            "ôdnÂefp"
        ]
    }
]

6 - GenAI Security Endpoints (Preview)

Automatic detection & protection of sensitive data

GenAI Security endpoints focus on automated sensitive data discovery and protection. You can detect sensitive data and choose to automatically protect the findings. Protegrity’s context-aware models are leveraged to identify sensitive data within provided input. Currently the classification can only be generated for texts in English.

This collection includes pre-release functionality and is subject to change in the future releases of the platform. We are actively iterating over this offering and welcome industry insight to help shape up the platform.

UPCOMING ENHANCEMENTS:

  • Improved PII detection in sentences without punctuation
  • Improved detection of emails and zipcodes provided without context
  • Improved detection of account numbers in large payloads

6.1 - Classify (Preview)

Detect and classify sensitive data

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/ai

DESCRIPTION:

Detect and classify sensitive data in a given input. The endpoint will return a classification and confidence score for every sensitive attribute found, alongside its location – a column name or a start and end index. Confidence score returns values from 0.1 to 1. The higher the confidence score, the more the product is sure of the PII classification it produced. We recommend using the confidence score to prioritize inspection of found sensitive data.

ATTRIBUTES:

data (required) Input data to transform.

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:

format (required) Specify the format of the input data. Currently the API only supports the option text for unstructured text. Accepts: [ text ].

SAMPLE REQUEST

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": "classify",
    "options": {
        "format": "text"
    },
    "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!"]
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/ai' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = { 
      "options": {
        "format": "text",
        "raw": "false"
    },
    "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!"]

} 

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)

  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/ai");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"options\": {\n" + //
                "        \"format\": \"text\",\n" + //
                "        \"raw\": false\n" + //
                "    },\n" + //
                "    \"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!\"]\n" + //
                " }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}

  
fetch('https://api.playground.protegrity.com/v1/ai', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "options": {
          "format": "text",
          "raw": false
      },
      "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!"]
  
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 

  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/ai" 
	data := strings.NewReader(`{ 
		 "options": {
        "format": "text",
        "raw": false
    },
    "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!"]
}`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}

  

SAMPLE RESPONSE


[
    {
        "score": 0.85,
        "classification": "PHONE_NUMBER",
        "start_index": 101,
        "end_index": 113
    },
    {
        "score": 0.99,
        "classification": "PERSON",
        "start_index": 15,
        "end_index": 29
    }
]

6.2 - Protect (Preview)

Detect, classify, and protect sensitive data

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.

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 ]

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS:

format (required) Specify the format of the input data. Currently the API only supports the option text for unstructured text. Accepts: [ text ].

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 to mark protected attributes with their assigned classification label. Tags are required for reversing the protection. Accepts: [ true | false ]. Defaults to true.

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.

eiv (optional) Provide your custom initialization vector to introduce additional variance in the output. The input may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the eiv has to be provided in the payload.

SAMPLE REQUEST

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!"]
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/ai' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', '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!"]
}

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>";
    String API_Key = "<API_Key>";
    URI uri = new URI("https://api.playground.protegrity.com/v1/ai");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"protect\",\n" + //
                "       \"options\": {\n" + //
                "        \"format\": \"text\",\n" + //
                "        \"type\": \"mask\",\n" + //
                "        \"tags\": \"false\",\n" + //
                "        \"threshold\": \"0.7\",\n" + //
                "    },\n" + //
                "    \"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!\"]\n" + //
                " }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}  
  
fetch('https://api.playground.protegrity.com/v1/ai', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({
        "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!"]
    }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/ai" 
	data := strings.NewReader(`{
    "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!"]
}`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
  

SAMPLE RESPONSE


{
    "results": "Hello, this is ############## from Air Industries. Could you give me a call back to my mobile number ############. Have a lovely day!"
}

6.3 - Unprotect (Preview)

Re-identify protected data

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/ai

DESCRIPTION:

Unprotect sensitive data in a given input, i.e. revert previously tokenized values to their original contents. Provided text must include tags to enable this transformation.

ATTRIBUTES:

data (required) Input data to transform.

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 ]

user (optional) Choose a user to impersonate from the list of pre-configured roles.

OPTIONS: format (required) Specify the format of the input data. Currently the API only supports the option text for unstructured text. Accepts: [ text ].

SAMPLE REQUEST

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": "unprotect",
  "format": "text",
  "user": "paloma.torres",
  "data": ["Hello, this is [PERSON]SQnnLOQMw TEwP[/PERSON] from Air Industries. Could you give me a call back to my mobile number [PHONE_NUMBER]025-016-8606[/PHONE_NUMBER]. Have a lovely day!"]
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<API_Key>"
url = 'https://api.playground.protegrity.com/v1/ai' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = {
  "operation": "unprotect",
  "format": "text",
  "user": "paloma.torres",
  "data": ["Hello, this is [PERSON]SQnnLOQMw TEwP[/PERSON] from Air Industries. Could you give me a call back to my mobile number [PHONE_NUMBER]025-016-8606[/PHONE_NUMBER]. Have a lovely day!"]
}

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)
  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>";
    String API_Key = "<API_Key>";
    URI uri = new URI("https://api.playground.protegrity.com/v1/ai");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"operation\": \"unprotect\",\n" + //
                "       \"options\": {\n" + //
                "        \"format\": \"text\",\n" + //
                "        \"user\": \"paloma.torres\",\n" + //
                "    },\n" + //
                "    \"data\": [\"Hello, this is [PERSON]SQnnLOQMw TEwP[/PERSON] from Air Industries. Could you give me a call back to my mobile number [PHONE_NUMBER]025-016-8606[/PHONE_NUMBER]. Have a lovely day!\"]\n" + //
                " }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/ai', 
    { method: 'POST', 
      headers: { 'x-api-key': '<API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({
        "operation": "unprotect",
        "format": "text",
        "user": "paloma.torres",
        "data": ["Hello, this is [PERSON]SQnnLOQMw TEwP[/PERSON] from Air Industries. Could you give me a call back to my mobile number [PHONE_NUMBER]025-016-8606[/PHONE_NUMBER]. Have a lovely day!"]
      }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<API_Key>"
	url := "https://api.playground.protegrity.com/v1/ai" 
	data := strings.NewReader(`{
  "operation": "unprotect",
  "format": "text",
  "user": "paloma.torres",
  "data": ["Hello, this is [PERSON]SQnnLOQMw TEwP[/PERSON] from Air Industries. Could you give me a call back to my mobile number [PHONE_NUMBER]025-016-8606[/PHONE_NUMBER]. Have a lovely day!"]
}`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
  

SAMPLE RESPONSE


{
  "results": "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!"
}

7 - Private Endpoints

Endpoints dedicated to running PoCs

This section documents private endpoints made available on the Protegrity API Playground. The private endpoints are the low-level APIs that closely resemble the product’s functionality. The endpoints allow for more flexibility and customization than the rest of the set. There are no performance limitations imposed (other than the network lag).

Access the endpoints can be requested through your Protegrity contact (Sales Engineer, Field Engineer, or Customer Success Manager). Running the endpoints requires an additional authentication key that will be set up specifically for your organization and project.

7.1 - Data Protection Endpoint

De-identify sensitive data

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/private/protect

DESCRIPTION:

Protect any data. Specify the data element and user name to apply during the transformation.

ATTRIBUTES:

data (required) Input data to transform.

data_element (required) Data element to apply when transforming data. Consult the Policy Definition section for the list of supported data elements and their characteristics.

user (required) Choose a user to impersonate from the list of pre-configured roles.

encoding (optional) Type of encoding used for input (and output) data. Note that all encodings are supported for all data elements with the exception of utf8 that cannot be used with encryption data elements. Accepts: [ hex | base64 | utf8 ]. Defaults to utf8.

external_iv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the external_iv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/private/protect' \
--header 'x-api-key: <Group_API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
    "encoding": "utf8",
    "data_element": "city",
    "user": "admin",
    "data": ["Phoenix"],
    "external_iv": "eiv1"
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<Group_API_Key>"
url = 'https://api.playground.protegrity.com/v1/private/protect' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = {
  "encoding": "utf8",
  "data_element": "city",
  "user": "admin",
  "data": [
    "Phoenix"
  ],
  "external_iv": "eiv1"
}

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)

  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<Group_API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/private/protect");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"encoding\": \"utf8\",\"data_element\": \"city\",\"user\": \"admin\",\"data\": [\"Phoenix\"],\"external_iv\": \"eiv1\" }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/private/protect', 
    { method: 'POST', 
      headers: { 'x-api-key': '<Group_API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "encoding": "utf8",
        "data_element": "city",
        "user": "admin",
        "data": [
          "Phoenix"
        ],
        "external_iv": "eiv1" 
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 

 
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<Group_API_Key>"
	url := "https://api.playground.protegrity.com/v1/private/protect" 
	data := strings.NewReader(`{ 
      "encoding": "utf8",
      "data_element": "city",
      "user": "admin",
      "data": ["Phoenix"],
      "external_iv": "eiv1"
    }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}

 

SAMPLE RESPONSE


{
  "encoding": "utf8",
  "results": [
    "oULqaPc"
  ],
  "success": true
}

7.2 - Data Unprotection Endpoint

Re-identify previously protected data

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/private/unprotect

DESCRIPTION:

Unprotect previously de-identified data, i.e. reverse it to its original state and clear any transformations. Specify the data element and user name to apply during the transformation.

ATTRIBUTES:

data (required) Input data to transform.

data_element (required) Data element to apply when transforming data. Consult the Policy Definition section for the list of supported data elements and their characteristics.

user (required) Choose a user to impersonate from the list of pre-configured roles.

encoding (optional) Type of encoding used for input (and output) data. Note that all encodings are supported for all data elements with the exception of utf8 that cannot be used with encryption data elements. Accepts: [ hex | base64 | utf8 ]. Defaults to utf8.

external_iv (optional) Provide the custom initialization vector used to protect the data. Learn more about the IVs in the Key Concepts section.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/private/unprotect' \
--header 'x-api-key: <Group_API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
    "encoding": "utf8",
    "data_element": "city",
    "user": "admin",
    "data": ["oULqaPc"],
    "external_iv": "eiv1"
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<Group_API_Key>"
url = 'https://api.playground.protegrity.com/v1/private/unprotect' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = {
  "encoding": "utf8",
  "data_element": "city",
  "user": "admin",
  "data": [
    "oULqaPc"
  ],
  "external_iv": "eiv1"
}

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)

  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<Group_API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/private/unprotect");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"encoding\": \"utf8\",\"data_element\": \"city\",\"user\": \"admin\",\"data\": [\"oULqaPc\"],\"external_iv\": \"eiv1\" }";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/private/unprotect', 
    { method: 'POST', 
      headers: { 'x-api-key': '<Group_API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({ 
        "encoding": "utf8",
        "data_element": "city",
        "user": "admin",
        "data": [
          "oULqaPc"
        ],
        "external_iv": "eiv1" 
        }) 
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 

 
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<Group_API_Key>"
	url := "https://api.playground.protegrity.com/v1/private/unprotect" 
	data := strings.NewReader(`{ 
      "encoding": "utf8",
      "data_element": "city",
      "user": "admin",
      "data": ["oULqaPc"],
      "external_iv": "eiv1"
    }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}

 

SAMPLE RESPONSE


{
  "encoding": "utf8",
  "results": [
    "Phoenix"
  ],
  "success": true
}

7.3 - Data Classification Endpoint

Classify sensitive data

METHOD: POST

ENDPOINT: https://api.playground.protegrity.com/v1/private/classify

DESCRIPTION:

Detect and classify sensitive data in a given input. The endpoint will return a classification and confidence score for every sensitive attribute found, alongside its location – a column name or a start and end index. Confidence score returns values from 0.1 to 1. The higher the confidence score, the more the product is sure of the PII classification it produced. We recommend using the confidence score to prioritize inspection of found sensitive data.

The endpoint does not take any attributes and accepts plain text as payload.

HEADERS:

Content-Type (required) Format of data sent in the payload. Set to text/plain for processing unstructured text. Accepts: [ text/plain ].

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/private/classify' \
--header 'x-api-key: <Group_API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--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!'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<Group_API_Key>"
url = 'https://api.playground.protegrity.com/v1/private/classify' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
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!"
}

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)

  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<Group_API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/private/classify");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "{ \"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!\"}";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/private/classify', 
    { method: 'POST', 
      headers: { 'x-api-key': '<Group_API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: "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!"
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 

 
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<Group_API_Key>"
	url := "https://api.playground.protegrity.com/v1/private/classify" 
	data := strings.NewReader(`{ 
      "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!"
    }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}

 

SAMPLE RESPONSE


[
    {
        "classifications": {
            "PHONE_NUMBER": [
                {
                    "score": 0.7633000016212463,
                    "location": {
                        "start_index": 102,
                        "end_index": 114
                    },
                    "classifiers": [
                        {
                            "provider_index": 0,
                            "name": "PhoneRecognizer",
                            "score": 0.75,
                            "details": {}
                        },
                        {
                            "provider_index": 1,
                            "name": "roberta",
                            "score": 0.7766000032424927,
                            "details": {}
                        }
                    ]
                }
            ],
            "IN_PAN": [
                {
                    "score": 0.05,
                    "location": {
                        "start_index": 40,
                        "end_index": 50
                    },
                    "classifiers": [
                        {
                            "provider_index": 0,
                            "name": "InPanRecognizer",
                            "score": 0.05,
                            "details": {}
                        }
                    ]
                }
            ],
            "PERSON": [
                {
                    "score": 0.9955000281333923,
                    "location": {
                        "start_index": 16,
                        "end_index": 30
                    },
                    "classifiers": [
                        {
                            "provider_index": 1,
                            "name": "roberta",
                            "score": 0.9955000281333923,
                            "details": {}
                        }
                    ]
                }
            ]
        }
    }
]

7.4 - Nesting Requests

Adding structure to your requests

You can pass multiple payloads within your request to the protect and unprotect endpoints, mixing together data formats and transformation types. In order to do that, your requests need to be structured in the following manner:

TOP LEVEL ATTRIBUTES

user (required) Choose a user to impersonate from the list of pre-configured roles.

arguments (optional) A nesting element used for passing multiple protection requests as an array.

NESTED ATTRIBUTES

The following attributes have to be provided for every payload sent:

id (optional) ID or label of a single for logging purposes. It will be appended to the query_id field.

data (required) Input data to transform.

data_element (required) Data element to apply when transforming data. Consult the Policy Definition section for the list of supported data elements and their characteristics.

encoding (optional) Type of encoding used for input (and output) data. Note that all encodings are supported for all data elements with the exception of utf8 that cannot be used with encryption data elements. Accepts: [ hex | base64 | utf8 ]. Defaults to utf8.

external_iv (optional) Provide your custom initialization vector to introduce additional variance in the output. The IV may be a number, letter, special character, or a combination of those. Learn more about the IVs in the Key Concepts section. Note that to unprotect the data back to its original value, the external_iv has to be provided in the payload.

SAMPLE REQUEST

curl --location 'https://api.playground.protegrity.com/v1/private/protect' \
--header 'x-api-key: <Group_API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
    "user": "admin",
    "arguments": [
        {
            "id": "id1",
            "data_element": "city",
            "data": [
                "Phoenix"
            ]
        },
        {
            "external_iv": "LOB_1",
            "data_element": "name",
            "data": [
                "Ava O’Connor",
                "Peregrine Wojcik"
            ]
        }
    ]
}'
  
import requests
import json

JWT_Token = "<JWT_TOKEN>"
API_Key = "<Group_API_Key>"
url = 'https://api.playground.protegrity.com/v1/private/protect' 
headers = { 'x-api-key': API_Key, 'Content-Type': 'application/json', 'Authorization': JWT_Token } 
data = {
  "user": "admin",
  "arguments": [
    {
      "id": "id1",
      "data_element": "city",
      "data": [
        "Phoenix"
      ]
    },
    {
      "external_iv": "LOB_1",
      "data_element": "name",
      "data": [
        "Ava O’Connor",
        "Peregrine Wojcik"
      ]
    }
  ]
}

response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.text)

  
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL; 
import java.io.OutputStream; 
import java.io.InputStreamReader; 
import java.io.BufferedReader;

public class APIRequest { public static void main(String[] args) { 
  try { 
    String JWT_Token = "<JWT_TOKEN>"
    String API_Key = "<Group_API_Key>"
    URI uri = new URI("https://api.playground.protegrity.com/v1/private/protect");
    URL url = uri.toURL(); 
    HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("x-api-key", API_Key); 
    conn.setRequestProperty("Content-Type", "application/json"); 
    conn.setRequestProperty("Authorization", JWT_Token); conn.setDoOutput(true);

    String jsonInputString = "\"user\": \"admin\",\"arguments\": {\"id\": \"id1\",\"data_element\": \"city\",\"data\": [    \"Phoenix\"]},{\"external_iv\": \"LOB_1\",\"data_element\": \"name\",\"data\": [\"Ava O’Connor\",\"Peregrine Wojcik\"]}";
    
    try (OutputStream os = conn.getOutputStream()) {
        byte[] input = jsonInputString.getBytes("utf-8");
        os.write(input, 0, input.length);
    }

    try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
        StringBuilder response = new StringBuilder();
        String responseLine = null;
        while ((responseLine = br.readLine()) != null) {
            response.append(responseLine.trim());
        }
        System.out.println(response.toString());
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
  
fetch('https://api.playground.protegrity.com/v1/private/protect', 
    { method: 'POST', 
      headers: { 'x-api-key': '<Group_API_Key>', 'Content-Type': 'application/json', 'Authorization': '<JWT_TOKEN>' }, 
      body: JSON.stringify({
        "user": "admin",
        "arguments": [
          {
            "id": "id1",
            "data_element": "city",
            "data": [
              "Phoenix"
            ]
          },
          {
            "external_iv": "LOB_1",
            "data_element": "name",
            "data": [
              "Ava O’Connor",
              "Peregrine Wojcik"
            ]
          }
        ]
      })
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error)); 

 
package main

import ( 
	"io" 
	"fmt"
	"strings" 
	"net/http" 
  )
  
func main() { 
	JWT_Token := "<JWT_TOKEN>"
	API_Key := "<Group_API_Key>"
	url := "https://api.playground.protegrity.com/v1/private/protect" 
	data := strings.NewReader(`{ 
      "user": "admin",
      "arguments": [
          {
              "id": "id1",
              "data_element": "city",
              "data": [
                  "Phoenix"
              ]
          },
          {
              "external_iv": "LOB_1",
              "data_element": "name",
              "data": [
                  "Ava O’Connor",
                  "Peregrine Wojcik"
              ]
          }
      ]
    }`) 
  
	req, err := http.NewRequest("POST", url, data)
	if err != nil {
		fmt.Println(err)
		return
	}
  
	req.Header.Set("x-api-key", API_Key)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", JWT_Token)
  
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()
  

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}

 

SAMPLE RESPONSE


{
    "results": [
        {
            "encoding": "utf8",
            "id": "id1",
            "results": [
                "pGPtJxg"
            ],
            "success": true
        },
        {
            "encoding": "utf8",
            "results": [
                "otO D’vawbCO",
                "JKWTkOMDK zPAgFlO"
            ],
            "success": true
        }
    ],
    "success": true
}

7.5 - Data Security Policy

Data Security Policy configuration

This section describes the Policy configuration used by the API Playground. All listed data elements can be used when calling the private endpoints.

Policy Definition

Generic Data Elements

Data Element Method Use Case UTF Set LP PP eIV Role
Admin Finance Marketing HR
P U P U P U P U
datetime Tokenization A date or datetime string. Formats accepted: YYYY/MM/DD HH:MM:SS and YYYY/MM/DD. Delimiters accepted: /, - (required). N/A N/A N/A No
datetime_yc Tokenization A date or datetime string. Formats accepted: YYYY/MM/DD HH:MM:SS and YYYY/MM/DD. Delimiters accepted: /, - (required). Leaves the year in the clear. N/A N/A N/A No
int Tokenization An integer string (4 bytes). Numeric No No Yes
number Tokenization A numeric string. May produce leading zeroes. Numeric No No Yes
string Tokenization An alphanumeric string. Latin + Numeric No No Yes
long_text Encryption A long string (e.g., a comment field) using any character set. Use hex or base64 encoding to utilize. All No No Yes

PCI DSS Data Elements

Data Element Method Use Case UTF Set LP PP eIV Role
Admin Finance Marketing HR
P U P U P U P U
ccn Tokenization Credit card numbers. Numeric No No Yes X
ccn_bin Tokenization Credit card numbers. Leaves 8-digit BIN in the clear. Numeric No No Yes X
iban Tokenization IBAN numbers. Preserves the length, case, and position of the input characters but may create invalid IBAN codes. Latin + Numeric Yes Yes No X
iban_cc Tokenization IBAN numbers. Leaves letters in the clear. Latin + Numeric Yes Yes Yes X

PII Data Elements

Data Element Method Use Case UTF Set LP PP eIV Role
Admin Finance Marketing HR
P U P U P U P U
address Tokenization Street names Latin + Numeric No No Yes
city Tokenization Town or city name Latin No No Yes
dob Tokenization A date string. Formats accepted: YYYY/MM/DD and YYYY/MM/DD. Delimiters accepted: /, - (required). N/A N/A No No
dob_yc Tokenization A date string. Formats accepted: YYYY/MM/DD and YYYY/MM/DD. Delimiters accepted: /, - (required). Leaves the year in the clear. N/A N/A No No
email Tokenization Email address. Leaves the domain in the clear. Latin + Numeric No No Yes
nin Tokenization National Insurance Number. Preserves the length, case, and position of the input characters but may create invalid NIN codes. Latin + Numeric Yes Yes No
name Tokenization Person's name Latin No No Yes
passport Tokenization Passport codes. Preserves the length, case, and position of the input characters but may create invalid passport numbers. Latin + Numeric Yes Yes No
phone Tokenization Phone number. May produce leading zeroes. Latin + Numeric Yes No Yes
postcode Tokenization Postal codes with digits and characters. Preserves the length, case, and position of the input characters but may create invalid post codes. Latin + numeric Yes Yes No
ssn Tokenization Social Security Number (US) Latin + Numeric Yes No Yes
zipcode Tokenization Zip codes with digits only. May produce leading zeroes. Numeric Yes No Yes

PII Data Elements

Data Element Method Use Case UTF Set LP PP eIV Role
Admin Finance Marketing HR
P U P U P U P U
address_de Tokenization Street names (German) Latin + German + Numeric No No Yes
address_fr Tokenization Street names (French) Latin + French + Numeric No No Yes
city_de Tokenization Town or city name (German) Latin + German No No Yes
city_fr Tokenization Town or city name (French) Latin + French No No Yes
name_de Tokenization Person's name (German) Latin + German No No Yes
name_fr Tokenization Person's name (French) Latin + French No No Yes

LEGEND

  • eIV External IV
  • LP Length Preservation
  • PP Position Preservation
  • P User group can protect data
  • U User group can unprotect data