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 three 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 appetite.

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

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

2.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!"]
}'
  
  
  

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"]
}'
  
  
  

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

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

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

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.

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"
  }
}'
  
  
  

SAMPLE RESPONSE


[
    "xkKZQ",
    "hTKo"
]

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

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.

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"
  }
}'
  
  
  

SAMPLE RESPONSE


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

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

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.

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"
  }
}'
  
  
  

SAMPLE RESPONSE


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

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

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"]
}'
  
  
  

SAMPLE RESPONSE


[
  "AD12TT",
  "II867"
]

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

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"]
}'
  
  
  

SAMPLE RESPONSE


[
  "00891",
  "67996"
]

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

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"]
}'
  
  
  

SAMPLE RESPONSE


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

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

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"]
}'
  
  
  

SAMPLE RESPONSE


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

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

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
  }
}'
  
  
  

SAMPLE RESPONSE


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

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

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"]
}'
  
  
  

SAMPLE RESPONSE


[
  "CD196371K",
  "OO918451S"
]

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

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"]
}'
  
  
  

SAMPLE RESPONSE


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

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

OPTIONS:

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

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.

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
  }
}'
  
  
  

SAMPLE RESPONSE


[
  "0449999816792240",
  "6683962881463918"
]

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

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"]
}'
  
  
  

SAMPLE RESPONSE


[
  "IN890183422",
  "GFR67102933"
]

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

OPTIONS:

alpha (optional) Set to true to leave the letters 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/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
  }
}'
  
  
  

SAMPLE RESPONSE


[
  "NO0980006979071",
  "QA13QNBA128618782491645358717"
]

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

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"]
}'
  
  
  

SAMPLE RESPONSE


[
  "UkosA",
  "okPPwa"
]

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

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": ["123654", "987654"]
}'
  
  
  

SAMPLE RESPONSE


[
  "034539",
  "101012"
]

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

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"]
}'
  
  
  

SAMPLE RESPONSE


[
  "E616C7B0762E28A32E0FABF4BC403C8D"
]

3.17 - Date of Birth (PII)

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

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
  }
}'
  
  
  

SAMPLE RESPONSE


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

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

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"]
  }
]'
  
  
  

SAMPLE RESPONSE


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

4 - GenAI Security Endpoints (Preview)

Automatic detection & protection of sensitive data

GenAI Security enpoints 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

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

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

OPTIONS:

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.

SAMPLE REQUEST – TEXT

curl --location 'https://api.playground.protegrity.com/v1/ai' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
    "operation": "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!"]
}'
  
  
  

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
    },
    "data": ["Social Security Number,Credit Card Number,IBAN,Phone Number\n589-25-1068,349384370543801,FR43 9255 4858 47BG 3EBG U4OK O18,(483) 9440301\n636-36-3077,4041594844904,AL50 8947 4215 KAEY GAPM NLYC FNZG,(113) 5143119\n748-82-2375,3558175715821800,AT34 4082 9269 0841 5702,(763) 5136237\n516-62-9861,560221027976015000,FR22 0068 7181 11FB UG8H ECEM 306,(726) 6031636\n121-49-9409,374283320982549,DK37 5687 8459 8060 79,(624) 9205200\n838-73-3299,5558216060144900,CR54 8952 8144 6403 4765 0,(356) 9479541\n439-11-5310,5048376143641900,RS76 6213 4824 0184 8983 74,(544) 5623326\n564-06-8466,3543299511845640,EE51 6882 3443 7863 4703,(702) 6093849\n518-54-5443,3543019452249540,IT65 D000 3874 2801 Z15I LNLL OOX,(584) 8618371"]
}'
  
  
  

SAMPLE RESPONSE – CSV


[
    {
        "score": 0.4,
        "classification": "US_SSN",
        "column_name": "0",
        "column_index": 0
    },
    {
        "score": 0.99,
        "classification": "CCN",
        "column_name": "1",
        "column_index": 1
    }
]

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

format (required) Specify the format of the input data. Option text covers unstructured text. Option csv is used for processing comma-separated values. Accepts: [ text | csv ].

operation (required) Type of operation to perform. Choose classify to only detect and classify data. Option protect deidentifies data. Option unprotect restores de-identified data to its original values. Accepts: [ classify | protect | unprotect ]

OPTIONS:

type (optional) Specify the protection mechanism. Option mask replaces all attributes with ‘*****’. Option tokenize applies a tokenization method that matches the classification of the found attribute. Accepts: [ mask | tokenize ]. Defaults to mask.

tags (optional) Specify if to include tags (or mapping information in the case of structured payloads) to mark protected attributes with their assigned classification label. Tags are required for reversing the protection. Accepts: [ true | false ]. Defaults to true.

header_line (optional) Specific to csv content only. Set to true if the data includes a header line in the first row. Set to false in case of the opposite. Accepts: [ true | false ]. Defaults to false.

threshold (optional) Set to the preferred confidence score threshold. Protection will be applied to attributes identified as matching or over the set threshold. Set a to numeric value. If not specified, the threshold is configured to 0.68.

SAMPLE REQUEST – TEXT

curl --location 'https://api.playground.protegrity.com/v1/ai' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
    "operation": "protect",
    "options": {
        "format": "text",
        "type": "mask",
        "tags": false,
        "threshold": 0.7
    },
    "data": ["Hello, this is Peregrine Grey from Air Industries, could you give me a call back to my mobile number 212-456-7890. Have a lovely day!"]
}'
  
  
  

SAMPLE RESPONSE – TEXT


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

SAMPLE REQUEST – CSV

curl --location 'https://api.playground.protegrity.com/v1/ai' \
--header 'x-api-key: <API_Key>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <JWT_TOKEN>' \
--data '{
    "operation": "protect",
    "options": {
        "format": "csv",
        "header_line": true,
        "type": "tokenize",
        "tags": true,
        "threshold": 0.7
    },
    "data": ["Social Security Number,Credit Card Number,IBAN,Phone Number\n589-25-1068,349384370543801,FR43 9255 4858 47BG 3EBG U4OK O18,(483) 9440301\n636-36-3077,4041594844904,AL50 8947 4215 KAEY GAPM NLYC FNZG,(113) 5143119\n748-82-2375,3558175715821800,AT34 4082 9269 0841 5702,(763) 5136237\n516-62-9861,560221027976015000,FR22 0068 7181 11FB UG8H ECEM 306,(726) 6031636\n121-49-9409,374283320982549,DK37 5687 8459 8060 79,(624) 9205200\n838-73-3299,5558216060144900,CR54 8952 8144 6403 4765 0,(356) 9479541\n439-11-5310,5048376143641900,RS76 6213 4824 0184 8983 74,(544) 5623326\n564-06-8466,3543299511845640,EE51 6882 3443 7863 4703,(702) 6093849\n518-54-5443,3543019452249540,IT65 D000 3874 2801 Z15I LNLL OOX,(584) 8618371"]
}'
  
  
  

SAMPLE RESPONSE – CSV


{
    "mapping": [
        {
            "classification": "US_SSN",
            "column_index": 0
        },
        {
            "classification": "CREDIT_CARD",
            "column_index": 1
        },
        {
            "classification": "IBAN_CODE",
            "column_index": 2
        },
        {
            "classification": "PHONE_NUMBER",
            "column_index": 3
        }
    ],
    "data": "Social Security Number,Credit Card Number,IBAN,Phone Number\n548-31-3268,602048102797043,FR17 5415 4336 25BG 3EBG U4OK O64,(654) 3308224\n481-70-3857,1230437596808,AL33 1240 7288 KAEY GAPM NLYC FNZG,(271) 2802977\n755-85-3665,8461740972061430,AT25 0533 9808 8046 3404,(335) 2981943\n557-54-6818,116202261366298390,FR34 2630 5071 38FB UG1H ECEM 902,(614) 1716660\n055-91-9942,888966093482491,DK05 9696 6634 8709 30,(888) 2741502\n964-99-0589,1163706741835754,CR80 1243 0722 7573 5790 0,(871) 3397725\n188-07-4113,4107600970907496,RS64 9873 7248 6702 7241 58,(699) 7510692\n296-61-1694,417282980942395,EE32 8302 5118 1829 2990,(651) 3698973\n979-08-3159,8471859640609227,IT99 D202 3280 0140 Z43I LNLL OOX,(902) 9747145\n"
}

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

format (required) Specify the format of the input data. Option text covers unstructured text. Option csv is used for processing comma-separated values. Accepts: [ text | csv ].

operation (required) Type of operation to perform. Choose classify to only detect and classify data. Option protect deidentifies data. Option unprotect restores de-identified data to its original values. Accepts: [ classify | protect | unprotect ]

OPTIONS:

mapping (optional) Required when re-identifying csv payloads. Paste here the mapping received during the protection operation.

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.

SAMPLE REQUEST – TEXT

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

SAMPLE RESPONSE – TEXT


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

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": "unprotect",
    "options": {
        "format": "csv",
        "header_line": true,
        "mapping": [
            {
                "classification": "US_SSN",
                "column_index": 0
            },
            {
                "classification": "CREDIT_CARD",
                "column_index": 1
            },
            {
                "classification": "IBAN_CODE",
                "column_index": 2
            },
            {
                "classification": "PHONE_NUMBER",
                "column_index": 3
            }
        ]
    },
    "data": ["Social Security Number,Credit Card Number,IBAN,Phone Number\n548-31-3268,602048102797043,FR17 5415 4336 25BG 3EBG U4OK O64,(654) 3308224\n481-70-3857,1230437596808,AL33 1240 7288 KAEY GAPM NLYC FNZG,(271) 2802977\n755-85-3665,8461740972061430,AT25 0533 9808 8046 3404,(335) 2981943\n557-54-6818,116202261366298390,FR34 2630 5071 38FB UG1H ECEM 902,(614) 1716660\n055-91-9942,888966093482491,DK05 9696 6634 8709 30,(888) 2741502\n964-99-0589,1163706741835754,CR80 1243 0722 7573 5790 0,(871) 3397725\n188-07-4113,4107600970907496,RS64 9873 7248 6702 7241 58,(699) 7510692\n296-61-1694,417282980942395,EE32 8302 5118 1829 2990,(651) 3698973\n979-08-3159,8471859640609227,IT99 D202 3280 0140 Z43I LNLL OOX,(902) 9747145\n"]
}'
  
  
  

SAMPLE RESPONSE – CSV


{
  "results": "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,162068942413568,EE51 6882 3443 7863 4703,(702) 6093849\n518-54-5443,3543019452249540,IT65 D000 3874 2801 Z15I LNLL OOX,(584) 8618371\n"
}