curl --request POST \
--url https://use.hoop.dev/api/datamasking-rules \
--header 'Content-Type: application/json' \
--data '
{
"name": "mask-email",
"connection_ids": [
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"
],
"custom_entity_types": [
{
"name": "ZIP_CODE",
"score": 0.01,
"deny_list": [
"Mr",
"Mr.",
"Mister"
],
"regex": "\\b\\d{5}(?:-\\d{4})?\\b"
}
],
"description": "Mask email addresses in the data",
"score_threshold": 0.6,
"supported_entity_types": [
{
"entity_types": [
"EMAIL_ADDRESS",
"PERSON",
"PHONE_NUMBER",
"IP_ADDRESS"
],
"name": "PII"
}
]
}
'import requests
url = "https://use.hoop.dev/api/datamasking-rules"
payload = {
"name": "mask-email",
"connection_ids": ["15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7", "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"],
"custom_entity_types": [
{
"name": "ZIP_CODE",
"score": 0.01,
"deny_list": ["Mr", "Mr.", "Mister"],
"regex": "\b\d{5}(?:-\d{4})?\b"
}
],
"description": "Mask email addresses in the data",
"score_threshold": 0.6,
"supported_entity_types": [
{
"entity_types": ["EMAIL_ADDRESS", "PERSON", "PHONE_NUMBER", "IP_ADDRESS"],
"name": "PII"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'mask-email',
connection_ids: ['15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7', '15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8'],
custom_entity_types: [
{
name: 'ZIP_CODE',
score: 0.01,
deny_list: ['Mr', 'Mr.', 'Mister'],
regex: '\b\d{5}(?:-\d{4})?\b'
}
],
description: 'Mask email addresses in the data',
score_threshold: 0.6,
supported_entity_types: [
{
entity_types: ['EMAIL_ADDRESS', 'PERSON', 'PHONE_NUMBER', 'IP_ADDRESS'],
name: 'PII'
}
]
})
};
fetch('https://use.hoop.dev/api/datamasking-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/datamasking-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'mask-email',
'connection_ids' => [
'15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7',
'15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8'
],
'custom_entity_types' => [
[
'name' => 'ZIP_CODE',
'score' => 0.01,
'deny_list' => [
'Mr',
'Mr.',
'Mister'
],
'regex' => '\\b\\d{5}(?:-\\d{4})?\\b'
]
],
'description' => 'Mask email addresses in the data',
'score_threshold' => 0.6,
'supported_entity_types' => [
[
'entity_types' => [
'EMAIL_ADDRESS',
'PERSON',
'PHONE_NUMBER',
'IP_ADDRESS'
],
'name' => 'PII'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/datamasking-rules"
payload := strings.NewReader("{\n \"name\": \"mask-email\",\n \"connection_ids\": [\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7\",\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8\"\n ],\n \"custom_entity_types\": [\n {\n \"name\": \"ZIP_CODE\",\n \"score\": 0.01,\n \"deny_list\": [\n \"Mr\",\n \"Mr.\",\n \"Mister\"\n ],\n \"regex\": \"\\\\b\\\\d{5}(?:-\\\\d{4})?\\\\b\"\n }\n ],\n \"description\": \"Mask email addresses in the data\",\n \"score_threshold\": 0.6,\n \"supported_entity_types\": [\n {\n \"entity_types\": [\n \"EMAIL_ADDRESS\",\n \"PERSON\",\n \"PHONE_NUMBER\",\n \"IP_ADDRESS\"\n ],\n \"name\": \"PII\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/datamasking-rules")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"mask-email\",\n \"connection_ids\": [\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7\",\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8\"\n ],\n \"custom_entity_types\": [\n {\n \"name\": \"ZIP_CODE\",\n \"score\": 0.01,\n \"deny_list\": [\n \"Mr\",\n \"Mr.\",\n \"Mister\"\n ],\n \"regex\": \"\\\\b\\\\d{5}(?:-\\\\d{4})?\\\\b\"\n }\n ],\n \"description\": \"Mask email addresses in the data\",\n \"score_threshold\": 0.6,\n \"supported_entity_types\": [\n {\n \"entity_types\": [\n \"EMAIL_ADDRESS\",\n \"PERSON\",\n \"PHONE_NUMBER\",\n \"IP_ADDRESS\"\n ],\n \"name\": \"PII\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/datamasking-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"mask-email\",\n \"connection_ids\": [\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7\",\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8\"\n ],\n \"custom_entity_types\": [\n {\n \"name\": \"ZIP_CODE\",\n \"score\": 0.01,\n \"deny_list\": [\n \"Mr\",\n \"Mr.\",\n \"Mister\"\n ],\n \"regex\": \"\\\\b\\\\d{5}(?:-\\\\d{4})?\\\\b\"\n }\n ],\n \"description\": \"Mask email addresses in the data\",\n \"score_threshold\": 0.6,\n \"supported_entity_types\": [\n {\n \"entity_types\": [\n \"EMAIL_ADDRESS\",\n \"PERSON\",\n \"PHONE_NUMBER\",\n \"IP_ADDRESS\"\n ],\n \"name\": \"PII\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "mask-email",
"connection_ids": [
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"
],
"custom_entity_types": [
{
"name": "ZIP_CODE",
"score": 0.01,
"deny_list": [
"Mr",
"Mr.",
"Mister"
],
"regex": "\\b\\d{5}(?:-\\d{4})?\\b"
}
],
"description": "Mask email addresses in the data",
"id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"score_threshold": 0.6,
"supported_entity_types": [
{
"entity_types": [
"EMAIL_ADDRESS",
"PERSON",
"PHONE_NUMBER",
"IP_ADDRESS"
],
"name": "PII"
}
],
"updated_at": "2023-08-15T14:30:45Z"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Create Data Masking Rule
Create Data Masking Rule
curl --request POST \
--url https://use.hoop.dev/api/datamasking-rules \
--header 'Content-Type: application/json' \
--data '
{
"name": "mask-email",
"connection_ids": [
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"
],
"custom_entity_types": [
{
"name": "ZIP_CODE",
"score": 0.01,
"deny_list": [
"Mr",
"Mr.",
"Mister"
],
"regex": "\\b\\d{5}(?:-\\d{4})?\\b"
}
],
"description": "Mask email addresses in the data",
"score_threshold": 0.6,
"supported_entity_types": [
{
"entity_types": [
"EMAIL_ADDRESS",
"PERSON",
"PHONE_NUMBER",
"IP_ADDRESS"
],
"name": "PII"
}
]
}
'import requests
url = "https://use.hoop.dev/api/datamasking-rules"
payload = {
"name": "mask-email",
"connection_ids": ["15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7", "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"],
"custom_entity_types": [
{
"name": "ZIP_CODE",
"score": 0.01,
"deny_list": ["Mr", "Mr.", "Mister"],
"regex": "\b\d{5}(?:-\d{4})?\b"
}
],
"description": "Mask email addresses in the data",
"score_threshold": 0.6,
"supported_entity_types": [
{
"entity_types": ["EMAIL_ADDRESS", "PERSON", "PHONE_NUMBER", "IP_ADDRESS"],
"name": "PII"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'mask-email',
connection_ids: ['15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7', '15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8'],
custom_entity_types: [
{
name: 'ZIP_CODE',
score: 0.01,
deny_list: ['Mr', 'Mr.', 'Mister'],
regex: '\b\d{5}(?:-\d{4})?\b'
}
],
description: 'Mask email addresses in the data',
score_threshold: 0.6,
supported_entity_types: [
{
entity_types: ['EMAIL_ADDRESS', 'PERSON', 'PHONE_NUMBER', 'IP_ADDRESS'],
name: 'PII'
}
]
})
};
fetch('https://use.hoop.dev/api/datamasking-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/datamasking-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'mask-email',
'connection_ids' => [
'15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7',
'15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8'
],
'custom_entity_types' => [
[
'name' => 'ZIP_CODE',
'score' => 0.01,
'deny_list' => [
'Mr',
'Mr.',
'Mister'
],
'regex' => '\\b\\d{5}(?:-\\d{4})?\\b'
]
],
'description' => 'Mask email addresses in the data',
'score_threshold' => 0.6,
'supported_entity_types' => [
[
'entity_types' => [
'EMAIL_ADDRESS',
'PERSON',
'PHONE_NUMBER',
'IP_ADDRESS'
],
'name' => 'PII'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/datamasking-rules"
payload := strings.NewReader("{\n \"name\": \"mask-email\",\n \"connection_ids\": [\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7\",\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8\"\n ],\n \"custom_entity_types\": [\n {\n \"name\": \"ZIP_CODE\",\n \"score\": 0.01,\n \"deny_list\": [\n \"Mr\",\n \"Mr.\",\n \"Mister\"\n ],\n \"regex\": \"\\\\b\\\\d{5}(?:-\\\\d{4})?\\\\b\"\n }\n ],\n \"description\": \"Mask email addresses in the data\",\n \"score_threshold\": 0.6,\n \"supported_entity_types\": [\n {\n \"entity_types\": [\n \"EMAIL_ADDRESS\",\n \"PERSON\",\n \"PHONE_NUMBER\",\n \"IP_ADDRESS\"\n ],\n \"name\": \"PII\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/datamasking-rules")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"mask-email\",\n \"connection_ids\": [\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7\",\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8\"\n ],\n \"custom_entity_types\": [\n {\n \"name\": \"ZIP_CODE\",\n \"score\": 0.01,\n \"deny_list\": [\n \"Mr\",\n \"Mr.\",\n \"Mister\"\n ],\n \"regex\": \"\\\\b\\\\d{5}(?:-\\\\d{4})?\\\\b\"\n }\n ],\n \"description\": \"Mask email addresses in the data\",\n \"score_threshold\": 0.6,\n \"supported_entity_types\": [\n {\n \"entity_types\": [\n \"EMAIL_ADDRESS\",\n \"PERSON\",\n \"PHONE_NUMBER\",\n \"IP_ADDRESS\"\n ],\n \"name\": \"PII\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/datamasking-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"mask-email\",\n \"connection_ids\": [\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7\",\n \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8\"\n ],\n \"custom_entity_types\": [\n {\n \"name\": \"ZIP_CODE\",\n \"score\": 0.01,\n \"deny_list\": [\n \"Mr\",\n \"Mr.\",\n \"Mister\"\n ],\n \"regex\": \"\\\\b\\\\d{5}(?:-\\\\d{4})?\\\\b\"\n }\n ],\n \"description\": \"Mask email addresses in the data\",\n \"score_threshold\": 0.6,\n \"supported_entity_types\": [\n {\n \"entity_types\": [\n \"EMAIL_ADDRESS\",\n \"PERSON\",\n \"PHONE_NUMBER\",\n \"IP_ADDRESS\"\n ],\n \"name\": \"PII\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "mask-email",
"connection_ids": [
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"
],
"custom_entity_types": [
{
"name": "ZIP_CODE",
"score": 0.01,
"deny_list": [
"Mr",
"Mr.",
"Mister"
],
"regex": "\\b\\d{5}(?:-\\d{4})?\\b"
}
],
"description": "Mask email addresses in the data",
"id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"score_threshold": 0.6,
"supported_entity_types": [
{
"entity_types": [
"EMAIL_ADDRESS",
"PERSON",
"PHONE_NUMBER",
"IP_ADDRESS"
],
"name": "PII"
}
],
"updated_at": "2023-08-15T14:30:45Z"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Body
The request body resource
The unique name of the data masking rule, it's immutable after creation
"mask-email"
The connections that this rule applies to
[
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"
]
The custom entity types that this rule applies to
Show child attributes
Show child attributes
The description of the data masking rule
"Mask email addresses in the data"
The minimal detection score threshold for the entities to be masked.
0.6
The registered entity types that this rule applies to
Show child attributes
Show child attributes
Response
Created
The unique name of the data masking rule, it's immutable after creation
"mask-email"
The connections that this rule applies to
[
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"
]
The custom entity types that this rule applies to
Show child attributes
Show child attributes
The description of the data masking rule
"Mask email addresses in the data"
The unique identifier of the data masking rule
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"
The minimal detection score threshold for the entities to be masked.
0.6
The registered entity types that this rule applies to
Show child attributes
Show child attributes
The timestamp when the rule was updated
"2023-08-15T14:30:45Z"
Was this page helpful?