Hash email address for privacy
curl --request POST \
--url https://api.datalegion.ai/utility/hash/email \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "Jane.Doe+tag@gmail.com"
}
'import requests
url = "https://api.datalegion.ai/utility/hash/email"
payload = { "email": "Jane.Doe+tag@gmail.com" }
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'Jane.Doe+tag@gmail.com'})
};
fetch('https://api.datalegion.ai/utility/hash/email', 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://api.datalegion.ai/utility/hash/email",
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([
'email' => 'Jane.Doe+tag@gmail.com'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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://api.datalegion.ai/utility/hash/email"
payload := strings.NewReader("{\n \"email\": \"Jane.Doe+tag@gmail.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
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://api.datalegion.ai/utility/hash/email")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"Jane.Doe+tag@gmail.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalegion.ai/utility/hash/email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"Jane.Doe+tag@gmail.com\"\n}"
response = http.request(request)
puts response.read_body{
"email": "Jane.Doe+tag@gmail.com",
"normalized_email": "janedoe@gmail.com",
"hashes": {
"sha256": "d6117306485ed0e50afab3ac871e98f81699151f30281527d63ff5f233656c69",
"sha1": "3e12c6d13e5c00d46fee94de65239ce9c5e7bc25",
"md5": "a9601f3839e5d5da764c1861a5e1daf6"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Utilities
Email Hashing
Hash email addresses using SHA-256, SHA-1, and MD5 for privacy-safe enrichment via the email_hash parameter.
POST
/
utility
/
hash
/
email
Hash email address for privacy
curl --request POST \
--url https://api.datalegion.ai/utility/hash/email \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "Jane.Doe+tag@gmail.com"
}
'import requests
url = "https://api.datalegion.ai/utility/hash/email"
payload = { "email": "Jane.Doe+tag@gmail.com" }
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'Jane.Doe+tag@gmail.com'})
};
fetch('https://api.datalegion.ai/utility/hash/email', 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://api.datalegion.ai/utility/hash/email",
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([
'email' => 'Jane.Doe+tag@gmail.com'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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://api.datalegion.ai/utility/hash/email"
payload := strings.NewReader("{\n \"email\": \"Jane.Doe+tag@gmail.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
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://api.datalegion.ai/utility/hash/email")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"Jane.Doe+tag@gmail.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalegion.ai/utility/hash/email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"Jane.Doe+tag@gmail.com\"\n}"
response = http.request(request)
puts response.read_body{
"email": "Jane.Doe+tag@gmail.com",
"normalized_email": "janedoe@gmail.com",
"hashes": {
"sha256": "d6117306485ed0e50afab3ac871e98f81699151f30281527d63ff5f233656c69",
"sha1": "3e12c6d13e5c00d46fee94de65239ce9c5e7bc25",
"md5": "a9601f3839e5d5da764c1861a5e1daf6"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}How It Works
Pass an email address and receive SHA-256, SHA-1, and MD5 hashes of the normalized email. The email is cleaned (lowercased, Gmail dots removed, plus tags stripped) before hashing. Use the returned hash with theemail_hash field in Person Enrichment for privacy-safe lookups — you never need to send the raw email address.
Workflow
- Hash the email using this endpoint
- Store or transmit only the hash
- Use the hash with
email_hashin person enrichment
Authorizations
Body
application/json
Request model for email hashing.
Email address to hash
Was this page helpful?