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@example.com",
"phone": "+15551234567",
"first_name": "John",
"last_name": "Doe",
"domain": "google.com",
"company": "Google LLC"
}
'import requests
url = "https://api.datalegion.ai/utility/validate"
payload = {
"email": "john.doe@example.com",
"phone": "+15551234567",
"first_name": "John",
"last_name": "Doe",
"domain": "google.com",
"company": "Google LLC"
}
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@example.com',
phone: '+15551234567',
first_name: 'John',
last_name: 'Doe',
domain: 'google.com',
company: 'Google LLC'
})
};
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@example.com',
'phone' => '+15551234567',
'first_name' => 'John',
'last_name' => 'Doe',
'domain' => 'google.com',
'company' => 'Google LLC'
]),
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@example.com\",\n \"phone\": \"+15551234567\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"domain\": \"google.com\",\n \"company\": \"Google LLC\"\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@example.com\",\n \"phone\": \"+15551234567\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"domain\": \"google.com\",\n \"company\": \"Google LLC\"\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@example.com\",\n \"phone\": \"+15551234567\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"domain\": \"google.com\",\n \"company\": \"Google LLC\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [],
"warnings": [
{
"field": "phone",
"value": "+15551234567",
"warning": "Phone number uses reserved 555 prefix",
"suggestion": null
}
],
"suggestions": [
{
"field": "company",
"cleaned": {
"name": "google",
"type": "name"
}
}
]
}{
"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
Data Validation
Validate person and company data format and get suggestions before sending to search or enrich 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@example.com",
"phone": "+15551234567",
"first_name": "John",
"last_name": "Doe",
"domain": "google.com",
"company": "Google LLC"
}
'import requests
url = "https://api.datalegion.ai/utility/validate"
payload = {
"email": "john.doe@example.com",
"phone": "+15551234567",
"first_name": "John",
"last_name": "Doe",
"domain": "google.com",
"company": "Google LLC"
}
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@example.com',
phone: '+15551234567',
first_name: 'John',
last_name: 'Doe',
domain: 'google.com',
company: 'Google LLC'
})
};
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@example.com',
'phone' => '+15551234567',
'first_name' => 'John',
'last_name' => 'Doe',
'domain' => 'google.com',
'company' => 'Google LLC'
]),
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@example.com\",\n \"phone\": \"+15551234567\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"domain\": \"google.com\",\n \"company\": \"Google LLC\"\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@example.com\",\n \"phone\": \"+15551234567\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"domain\": \"google.com\",\n \"company\": \"Google LLC\"\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@example.com\",\n \"phone\": \"+15551234567\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"domain\": \"google.com\",\n \"company\": \"Google LLC\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"errors": [],
"warnings": [
{
"field": "phone",
"value": "+15551234567",
"warning": "Phone number uses reserved 555 prefix",
"suggestion": null
}
],
"suggestions": [
{
"field": "company",
"cleaned": {
"name": "google",
"type": "name"
}
}
]
}{
"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 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 three 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 |
Authorizations
Body
application/json
Request model for data validation.
Response
Success - validation completed
Response model for data validation.
Whether all data is valid
List of validation errors
Show child attributes
Show child attributes
List of validation warnings
Show child attributes
Show child attributes
List of cleaning suggestions
Show child attributes
Show child attributes
Was this page helpful?