Validate person or company data
curl --request POST \
--url https://api.datalegion.ai/utility/validate \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "John.Doe@gmial.com",
"phone": "(650) 253-0000",
"first_name": "John",
"last_name": "Doe",
"company": "Google LLC",
"domain": "google.com"
}
'import requests
url = "https://api.datalegion.ai/utility/validate"
payload = {
"email": "John.Doe@gmial.com",
"phone": "(650) 253-0000",
"first_name": "John",
"last_name": "Doe",
"company": "Google LLC",
"domain": "google.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: 'John.Doe@gmial.com',
phone: '(650) 253-0000',
first_name: 'John',
last_name: 'Doe',
company: 'Google LLC',
domain: 'google.com'
})
};
fetch('https://api.datalegion.ai/utility/validate', 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/validate",
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' => 'John.Doe@gmial.com',
'phone' => '(650) 253-0000',
'first_name' => 'John',
'last_name' => 'Doe',
'company' => 'Google LLC',
'domain' => 'google.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/validate"
payload := strings.NewReader("{\n \"email\": \"John.Doe@gmial.com\",\n \"phone\": \"(650) 253-0000\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Google LLC\",\n \"domain\": \"google.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/validate")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"John.Doe@gmial.com\",\n \"phone\": \"(650) 253-0000\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Google LLC\",\n \"domain\": \"google.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalegion.ai/utility/validate")
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\": \"John.Doe@gmial.com\",\n \"phone\": \"(650) 253-0000\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Google LLC\",\n \"domain\": \"google.com\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [],
"warnings": [
{
"field": "email",
"value": "John.Doe@gmial.com",
"warning": "Email contains formatting that will be normalized",
"suggestion": "Consider using normalized form: john.doe@gmial.com"
},
{
"field": "email",
"value": "John.Doe@gmial.com",
"warning": "gmial.com looks like a typo of gmail.com",
"suggestion": "Did you mean john.doe@gmail.com?"
},
{
"field": "phone",
"value": "(650) 253-0000",
"warning": "Phone number will be normalized to E.164 format",
"suggestion": "Consider using normalized form: +16502530000"
}
],
"suggestions": [
{
"field": "email",
"cleaned": "john.doe@gmial.com"
},
{
"field": "phone",
"cleaned": "+16502530000"
},
{
"field": "first_name",
"cleaned": "john"
},
{
"field": "last_name",
"cleaned": "doe"
},
{
"field": "company",
"cleaned": "google"
}
],
"email_check": {
"domain": "gmial.com",
"mail": "implicit",
"mail_servers": [],
"disposable": false,
"free": false,
"relay": false,
"intended_domain": "gmail.com"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Utilities
Data Validation API
Validate person and company data format and get suggestions before sending to the Search or Enrichment endpoints.
POST
/
utility
/
validate
Validate person or company data
curl --request POST \
--url https://api.datalegion.ai/utility/validate \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "John.Doe@gmial.com",
"phone": "(650) 253-0000",
"first_name": "John",
"last_name": "Doe",
"company": "Google LLC",
"domain": "google.com"
}
'import requests
url = "https://api.datalegion.ai/utility/validate"
payload = {
"email": "John.Doe@gmial.com",
"phone": "(650) 253-0000",
"first_name": "John",
"last_name": "Doe",
"company": "Google LLC",
"domain": "google.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: 'John.Doe@gmial.com',
phone: '(650) 253-0000',
first_name: 'John',
last_name: 'Doe',
company: 'Google LLC',
domain: 'google.com'
})
};
fetch('https://api.datalegion.ai/utility/validate', 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/validate",
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' => 'John.Doe@gmial.com',
'phone' => '(650) 253-0000',
'first_name' => 'John',
'last_name' => 'Doe',
'company' => 'Google LLC',
'domain' => 'google.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/validate"
payload := strings.NewReader("{\n \"email\": \"John.Doe@gmial.com\",\n \"phone\": \"(650) 253-0000\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Google LLC\",\n \"domain\": \"google.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/validate")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"John.Doe@gmial.com\",\n \"phone\": \"(650) 253-0000\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Google LLC\",\n \"domain\": \"google.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalegion.ai/utility/validate")
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\": \"John.Doe@gmial.com\",\n \"phone\": \"(650) 253-0000\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Google LLC\",\n \"domain\": \"google.com\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [],
"warnings": [
{
"field": "email",
"value": "John.Doe@gmial.com",
"warning": "Email contains formatting that will be normalized",
"suggestion": "Consider using normalized form: john.doe@gmial.com"
},
{
"field": "email",
"value": "John.Doe@gmial.com",
"warning": "gmial.com looks like a typo of gmail.com",
"suggestion": "Did you mean john.doe@gmail.com?"
},
{
"field": "phone",
"value": "(650) 253-0000",
"warning": "Phone number will be normalized to E.164 format",
"suggestion": "Consider using normalized form: +16502530000"
}
],
"suggestions": [
{
"field": "email",
"cleaned": "john.doe@gmial.com"
},
{
"field": "phone",
"cleaned": "+16502530000"
},
{
"field": "first_name",
"cleaned": "john"
},
{
"field": "last_name",
"cleaned": "doe"
},
{
"field": "company",
"cleaned": "google"
}
],
"email_check": {
"domain": "gmial.com",
"mail": "implicit",
"mail_servers": [],
"disposable": false,
"free": false,
"relay": false,
"intended_domain": "gmail.com"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}How It Works
Pass any combination of person or company fields and receive errors, warnings, and cleaning suggestions. Use this before enrichment or search to catch formatting issues and improve match rates.Supported Fields
Person Fields
email, phone, first_name, last_name, full_name, birth_date, social_url, school, address, state, country
Company Fields
company, domain, ticker_symbol, linkedin_company_url
Response
The response includes these sections:| Section | Description |
|---|---|
errors | Fields with invalid format that will likely fail matching |
warnings | Fields with potential issues that may reduce match quality |
suggestions | Cleaned versions of fields that could improve matching |
email_check | What the email’s domain says about the address (see Email Check) |
Email Check
When you send a well-formedemail, email_check reports on its domain:
| Field | Description |
|---|---|
domain | The domain checked, in ASCII (punycode) form |
mail | mx (publishes mail servers), implicit (no mail servers, but an address mail falls back to), null_mx (says it takes no mail), none (the domain does not exist or has no record mail can use) or unknown (DNS timed out or failed) |
mail_servers | The domain’s mail servers, best first |
disposable | A throwaway inbox service, such as mailinator.com |
free | A free personal mailbox provider, such as gmail.com |
relay | An alias or relay service that forwards to a hidden inbox, such as Firefox Relay |
intended_domain | The webmail domain this one looks like a typo of (gmial.com gives gmail.com), or null |
none or null_mx) or looks like a webmail typo also adds a warning. Neither makes the email invalid: an address at a domain that is gone still identifies the person who used it, so enrich can still match it.
A state or country we don’t recognize adds a warning too (“Not a US state we recognize”, “Not a country we recognize”). That includes some short or informal names, such as UAE or England: send the country’s full English name or its two-letter code instead. The value stays valid, and enrich matches it as written.
The check reads the domain only. It does not contact the mail server, so it cannot tell you whether the mailbox itself exists.Body
application/json
Request model for data validation.
Response
Success - validation completed
Response model for data validation.