Email Compliance
curl --request POST \
--url https://developer.encrata.com/api/lookup/email/compliance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>"
}
'import requests
url = "https://developer.encrata.com/api/lookup/email/compliance"
payload = { "email": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>'})
};
fetch('https://developer.encrata.com/api/lookup/email/compliance', 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://developer.encrata.com/api/lookup/email/compliance",
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' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://developer.encrata.com/api/lookup/email/compliance"
payload := strings.NewReader("{\n \"email\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://developer.encrata.com/api/lookup/email/compliance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/lookup/email/compliance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"email": "priya.sharma@example.in",
"country": "India",
"country_code": "IN",
"email_type": "business",
"recommendation_code": "allowed_by_policy",
"recommendation": "Cold emailing is allowed.",
"main_laws": ["Digital Personal Data Protection Act 2023"],
"law_reference_urls": ["https://www.meity.gov.in/"],
"main_restrictions": ["Provide an opt-out in every message"],
"applicability": "National scope. Sector rules may add requirements.",
"confidence": "confident",
"jurisdictions_applicable": ["IN"],
"possible_travel": [],
"pending": false,
"credits": 1
},
"message": "Cold emailing this address is allowed under India's rules."
}
{
"success": true,
"result": {
"email": "anon@protonmail.com",
"country": "",
"email_type": "consumer",
"recommendation_code": "consent_required",
"recommendation": "Treat as consent-required. No jurisdiction could be established.",
"confidence": "unknown",
"jurisdictions_applicable": [],
"possible_travel": [],
"pending": false,
"credits": 1
},
"message": "We couldn't establish a jurisdiction for this address. Treat it as consent-required."
}
{ "success": false, "result": { "code": "insufficient_credits" },
"message": "You don't have enough credits for this lookup. Top up to continue." }
Email
Email Compliance
Resolve which country’s cold-email law applies to an address, and get that jurisdiction’s recommendation. 1 credit, with free repeats.
POST
/
api
/
lookup
/
email
/
compliance
Email Compliance
curl --request POST \
--url https://developer.encrata.com/api/lookup/email/compliance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>"
}
'import requests
url = "https://developer.encrata.com/api/lookup/email/compliance"
payload = { "email": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>'})
};
fetch('https://developer.encrata.com/api/lookup/email/compliance', 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://developer.encrata.com/api/lookup/email/compliance",
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' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://developer.encrata.com/api/lookup/email/compliance"
payload := strings.NewReader("{\n \"email\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://developer.encrata.com/api/lookup/email/compliance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/lookup/email/compliance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"email": "priya.sharma@example.in",
"country": "India",
"country_code": "IN",
"email_type": "business",
"recommendation_code": "allowed_by_policy",
"recommendation": "Cold emailing is allowed.",
"main_laws": ["Digital Personal Data Protection Act 2023"],
"law_reference_urls": ["https://www.meity.gov.in/"],
"main_restrictions": ["Provide an opt-out in every message"],
"applicability": "National scope. Sector rules may add requirements.",
"confidence": "confident",
"jurisdictions_applicable": ["IN"],
"possible_travel": [],
"pending": false,
"credits": 1
},
"message": "Cold emailing this address is allowed under India's rules."
}
{
"success": true,
"result": {
"email": "anon@protonmail.com",
"country": "",
"email_type": "consumer",
"recommendation_code": "consent_required",
"recommendation": "Treat as consent-required. No jurisdiction could be established.",
"confidence": "unknown",
"jurisdictions_applicable": [],
"possible_travel": [],
"pending": false,
"credits": 1
},
"message": "We couldn't establish a jurisdiction for this address. Treat it as consent-required."
}
{ "success": false, "result": { "code": "insufficient_credits" },
"message": "You don't have enough credits for this lookup. Top up to continue." }
Overview
Email Compliance answers one question: may I cold-email this address, and under whose law? It resolves an email to the most likely jurisdiction, returns that jurisdiction’s rule and recommendation, and tells you how much to trust the attribution. The verdict can arrive in two phases. Most checks resolve inside the request; a deeper attribution check may still be running when the first response returns. In that case the response carriespending and a provisional verdict, and the
result is finalised shortly after - subscribe to realtime events to
be notified when it settles.
Authentication
Requires an API key in theAuthorization header.
Authorization: Bearer YOUR_API_KEY
Request
string
required
The email address to place under a jurisdiction.
Example request
curl -X POST "https://developer.encrata.com/api/lookup/email/compliance" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "priya.sharma@example.in"}'
import requests
resp = requests.post(
"https://developer.encrata.com/api/lookup/email/compliance",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"email": "priya.sharma@example.in"},
)
print(resp.json())
const resp = await fetch("https://developer.encrata.com/api/lookup/email/compliance", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ email: "priya.sharma@example.in" }),
});
const data = await resp.json();
Response
Unlike the older email endpoints, this route always returns the{success, result, message} envelope - including on validation and method
errors. The HTTP status is real; a 200 never carries success: false.
boolean
Whether the lookup succeeded.
string
A sentence written for your end user. It already reflects whether the verdict
is provisional, confident, or unknown - render it as-is rather than composing
your own from the fields.
object
The applicable jurisdiction and its cold-email rule.
Show result
Show result
string
The address that was placed.
string
Resolved country name. Empty when
confidence is unknown.string
ISO alpha-2 code. Absent when
confidence is unknown. When
confidence is medium, this is the strictest of
jurisdictions_applicable, not simply the most likely.string
consumer or business.string
One of
prohibited, consent_required, allowed_with_conditions,
allowed_by_policy.string
The plain-language recommendation for this jurisdiction.
string[]
The governing laws (e.g.
["Digital Personal Data Protection Act 2023"]).string[]
Reference URLs for the cited laws.
string[]
The key restrictions that apply.
string
Scope note (e.g. national scope, sector rules may add requirements).
string
confident, medium, or unknown. Drives the whole presentation - see
the table below.string[]
Every country still in contention. More than one entry means the strictest
was applied.
string[]
Countries whose only evidence was a lone one-off signup - reported as
travel, never counted as applicable law.
boolean
true while the deeper attribution check is still running. When true the
verdict is provisional and is finalised shortly after.number
Credits billed:
1 on a fresh charge, or 0 inside the free-repeat window.boolean
Present and
true when served from a previous lookup.confidence drives the presentation
confidence | Means | Suggested handling |
|---|---|---|
confident | A clear jurisdiction with corroborating evidence | Show the country and its rule plainly |
medium | A likely jurisdiction, thinner corroboration. country_code is the strictest of jurisdictions_applicable | Show the rule; say it is the strictest of several candidates |
unknown | Nothing established. country/country_code are empty and the restrictive default is returned | Do not print a country; show recommendation/main_restrictions as generic guidance |
unknown is a deliberate answer, not a failure - the response is still 200
with a usable restrictive recommendation. Treating it as an error is the most
common way to get this integration wrong.
Errors
Every response - including errors - uses the envelope, with a stable code inresult.code.
| Status | result.code | Cause |
|---|---|---|
400 | bad_request | Unreadable body, or email is not a valid address |
401 | unauthorized | Missing or unusable credentials |
402 | insufficient_credits | Not enough credits and not a free repeat |
405 | method_not_allowed | Wrong HTTP method - POST only |
413 | payload_too_large | Body exceeded the size limit |
500 | internal_error | Unexpected server error |
503 | upstream_unavailable | Temporarily unavailable; retry later |
Credits
Each lookup costs 1 credit, with free repeats inside the billing window. A repeat that finalises a previously provisional verdict is not charged again. See Credits.{
"success": true,
"result": {
"email": "priya.sharma@example.in",
"country": "India",
"country_code": "IN",
"email_type": "business",
"recommendation_code": "allowed_by_policy",
"recommendation": "Cold emailing is allowed.",
"main_laws": ["Digital Personal Data Protection Act 2023"],
"law_reference_urls": ["https://www.meity.gov.in/"],
"main_restrictions": ["Provide an opt-out in every message"],
"applicability": "National scope. Sector rules may add requirements.",
"confidence": "confident",
"jurisdictions_applicable": ["IN"],
"possible_travel": [],
"pending": false,
"credits": 1
},
"message": "Cold emailing this address is allowed under India's rules."
}
{
"success": true,
"result": {
"email": "anon@protonmail.com",
"country": "",
"email_type": "consumer",
"recommendation_code": "consent_required",
"recommendation": "Treat as consent-required. No jurisdiction could be established.",
"confidence": "unknown",
"jurisdictions_applicable": [],
"possible_travel": [],
"pending": false,
"credits": 1
},
"message": "We couldn't establish a jurisdiction for this address. Treat it as consent-required."
}
{ "success": false, "result": { "code": "insufficient_credits" },
"message": "You don't have enough credits for this lookup. Top up to continue." }
Was this page helpful?