curl --request POST \
--url https://api.datalegion.ai/person/enrich/bulk \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"email": "jane.doe@example.com",
"metadata": {
"row": "1"
}
},
{
"phone": "+15551234567",
"metadata": {
"row": "2"
}
},
{
"first_name": "John",
"last_name": "Doe",
"company": "Acme Corp",
"metadata": {
"row": "3"
}
}
]
}
'import requests
url = "https://api.datalegion.ai/person/enrich/bulk"
payload = { "items": [
{
"email": "jane.doe@example.com",
"metadata": { "row": "1" }
},
{
"phone": "+15551234567",
"metadata": { "row": "2" }
},
{
"first_name": "John",
"last_name": "Doe",
"company": "Acme Corp",
"metadata": { "row": "3" }
}
] }
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({
items: [
{email: 'jane.doe@example.com', metadata: {row: '1'}},
{phone: '+15551234567', metadata: {row: '2'}},
{
first_name: 'John',
last_name: 'Doe',
company: 'Acme Corp',
metadata: {row: '3'}
}
]
})
};
fetch('https://api.datalegion.ai/person/enrich/bulk', 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/person/enrich/bulk",
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([
'items' => [
[
'email' => 'jane.doe@example.com',
'metadata' => [
'row' => '1'
]
],
[
'phone' => '+15551234567',
'metadata' => [
'row' => '2'
]
],
[
'first_name' => 'John',
'last_name' => 'Doe',
'company' => 'Acme Corp',
'metadata' => [
'row' => '3'
]
]
]
]),
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/person/enrich/bulk"
payload := strings.NewReader("{\n \"items\": [\n {\n \"email\": \"jane.doe@example.com\",\n \"metadata\": {\n \"row\": \"1\"\n }\n },\n {\n \"phone\": \"+15551234567\",\n \"metadata\": {\n \"row\": \"2\"\n }\n },\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"row\": \"3\"\n }\n }\n ]\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/person/enrich/bulk")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"email\": \"jane.doe@example.com\",\n \"metadata\": {\n \"row\": \"1\"\n }\n },\n {\n \"phone\": \"+15551234567\",\n \"metadata\": {\n \"row\": \"2\"\n }\n },\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"row\": \"3\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalegion.ai/person/enrich/bulk")
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 \"items\": [\n {\n \"email\": \"jane.doe@example.com\",\n \"metadata\": {\n \"row\": \"1\"\n }\n },\n {\n \"phone\": \"+15551234567\",\n \"metadata\": {\n \"row\": \"2\"\n }\n },\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"row\": \"3\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"matches": [
{
"person": {
"legion_id": "fdd85569-f0f0-53a9-bc60-089507193c28",
"full_name": "jane marie doe",
"work_email": "jane.doe@techcompany.com"
},
"match_metadata": {
"matched_on": [
"email"
],
"match_type": "exact",
"match_confidence": "high"
}
}
],
"metadata": {
"row": "1"
}
},
{
"error": "No person found matching the provided parameters.",
"metadata": {
"row": "2"
}
}
]
}{
"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": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Person Bulk Enrichment API
Person Bulk Enrichment API endpoint: match and enrich up to 50 people in a single request, each item billed independently and returned in input order.
curl --request POST \
--url https://api.datalegion.ai/person/enrich/bulk \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"email": "jane.doe@example.com",
"metadata": {
"row": "1"
}
},
{
"phone": "+15551234567",
"metadata": {
"row": "2"
}
},
{
"first_name": "John",
"last_name": "Doe",
"company": "Acme Corp",
"metadata": {
"row": "3"
}
}
]
}
'import requests
url = "https://api.datalegion.ai/person/enrich/bulk"
payload = { "items": [
{
"email": "jane.doe@example.com",
"metadata": { "row": "1" }
},
{
"phone": "+15551234567",
"metadata": { "row": "2" }
},
{
"first_name": "John",
"last_name": "Doe",
"company": "Acme Corp",
"metadata": { "row": "3" }
}
] }
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({
items: [
{email: 'jane.doe@example.com', metadata: {row: '1'}},
{phone: '+15551234567', metadata: {row: '2'}},
{
first_name: 'John',
last_name: 'Doe',
company: 'Acme Corp',
metadata: {row: '3'}
}
]
})
};
fetch('https://api.datalegion.ai/person/enrich/bulk', 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/person/enrich/bulk",
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([
'items' => [
[
'email' => 'jane.doe@example.com',
'metadata' => [
'row' => '1'
]
],
[
'phone' => '+15551234567',
'metadata' => [
'row' => '2'
]
],
[
'first_name' => 'John',
'last_name' => 'Doe',
'company' => 'Acme Corp',
'metadata' => [
'row' => '3'
]
]
]
]),
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/person/enrich/bulk"
payload := strings.NewReader("{\n \"items\": [\n {\n \"email\": \"jane.doe@example.com\",\n \"metadata\": {\n \"row\": \"1\"\n }\n },\n {\n \"phone\": \"+15551234567\",\n \"metadata\": {\n \"row\": \"2\"\n }\n },\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"row\": \"3\"\n }\n }\n ]\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/person/enrich/bulk")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"email\": \"jane.doe@example.com\",\n \"metadata\": {\n \"row\": \"1\"\n }\n },\n {\n \"phone\": \"+15551234567\",\n \"metadata\": {\n \"row\": \"2\"\n }\n },\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"row\": \"3\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalegion.ai/person/enrich/bulk")
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 \"items\": [\n {\n \"email\": \"jane.doe@example.com\",\n \"metadata\": {\n \"row\": \"1\"\n }\n },\n {\n \"phone\": \"+15551234567\",\n \"metadata\": {\n \"row\": \"2\"\n }\n },\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"company\": \"Acme Corp\",\n \"metadata\": {\n \"row\": \"3\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"matches": [
{
"person": {
"legion_id": "fdd85569-f0f0-53a9-bc60-089507193c28",
"full_name": "jane marie doe",
"work_email": "jane.doe@techcompany.com"
},
"match_metadata": {
"matched_on": [
"email"
],
"match_type": "exact",
"match_confidence": "high"
}
}
],
"metadata": {
"row": "1"
}
},
{
"error": "No person found matching the provided parameters.",
"metadata": {
"row": "2"
}
}
]
}{
"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": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}/person/enrich call. Bulk is a throughput tool, not a discount or a latency shortcut.
How it works
- Per item: send the identifiers you already have for each record. Every item accepts the full set of
/person/enrichidentifiers and options (see Person Enrichment for the minimum-requirement rules). - Defaults vs. overrides: top-level flags (
min_confidence,titlecase,required_fields,include_fields,exclude_fields) apply to every item. Set the same flag on an individual item to override the default for that item. - Order preserved:
resultsare returned in the same order asitems. Each slot independently reports itsmatches, or anerrorif that item didn’t match. A per-item failure never fails the whole batch. - Synchronous: all results come back in one response. There is no job ID or polling. If a batch runs past its time budget, the request returns
408and nothing is billed; retry with fewer items.
Billing
Each item is billed exactly like a standalone/person/enrich call, following your account’s existing billing model. An upfront check verifies the maximum possible cost of the batch before processing.
Identifiers and metadata
Each item carries the same identifiers as single enrichment, plus an optionalmetadata object (up to 10 keys) that is echoed back unchanged on that item’s result so you can map results to your own records. Values must be primitive: string, number, or boolean. Nested objects and arrays are rejected.
{
"items": [
{ "email": "jane.doe@example.com", "metadata": { "row": "1" } },
{ "phone": "+15551234567", "metadata": { "row": "2" } },
{ "first_name": "John", "last_name": "Doe", "company": "Acme Corp", "metadata": { "row": "3" } }
]
}
Limits and rate limits
| Limit | Value |
|---|---|
| Max items per request | 50 |
| Default rate limit | 10 requests/min (each up to 50 records) |
| Max payload size | 1 MB |
Batch size guidance
- Real-time (interactive SLA): keep batches small (10–20 items).
- Asynchronous backfill: use full 50-item batches and fan out multiple requests concurrently.
Body
Bulk person enrichment request. Top-level flags act as defaults applied to every item; per-item flags override them.
Default for all items. Fields a match must have, else it is filtered out (and not billed). Supports top-level fields ('work_email'), a non-empty list subfield ('emails.type'), or a subfield equal to a value ('emails.type:personal', 'phones.type:mobile', 'socials.network:linkedin'). Combine them with AND, OR and parentheses: '(work_email OR mobile_phone) AND job_title'. Put a value holding the word "and" or "or", a comma or a parenthesis in double quotes: 'company_industry:"oil and energy"'.
1000