Docs / API Reference / Enrichment
Enrichment
Find and verify email addresses for your extracted leads. Enrichment runs asynchronously — preview the credit cost, start the job, then poll for completion and retrieve results per lead.
Preview Enrichment Cost
/api/v1/enrichment/previewauthCalculate how many credits enriching a set of leads will cost, without starting the job.
Body parameters
queryIdEnrich all leads from this search query. Provide either queryId or leadIds, not both.
leadIdsEnrich specific leads by their IDs. Provide either this or queryId.
Example response
{
"success": true,
"data": {
"totalLeads": 47,
"alreadyEnriched": 12,
"toEnrich": 35,
"estimatedCredits": 35,
"availableCredits": 88
}
}curl -X POST https://leadsapi.postorbit.io/api/v1/enrichment/preview \
-H "Authorization: Bearer $LOCALLEADS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"queryId": "cm9search123"}'Start Enrichment Job
/api/v1/enrichment/startauthStart an enrichment job. Credits are reserved immediately. Returns a job ID to poll.
Body parameters
queryIdEnrich all leads from a query. Provide either this or leadIds.
leadIdsEnrich specific leads by ID.
maxCreditsSafety cap — the job will not exceed this many credits. Defaults to your full available balance.
{
"success": true,
"data": {
"jobId": "enrich_abc123",
"leadsQueued": 35,
"creditsReserved": 35
}
}curl -X POST https://leadsapi.postorbit.io/api/v1/enrichment/start \
-H "Authorization: Bearer $LOCALLEADS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"queryId": "cm9search123", "maxCredits": 50}'Poll Job Status
/api/v1/enrichment/status/:jobIdauthCheck the progress of a running enrichment job. Poll until status is COMPLETED or FAILED.
Path parameters
:jobId*The job ID returned by POST /start.
{
"success": true,
"data": {
"jobId": "enrich_abc123",
"status": "PROCESSING", // PENDING | PROCESSING | COMPLETED | FAILED
"progress": 62, // 0–100
"processedLeads": 22,
"totalLeads": 35,
"foundEmails": 18
}
}async function waitForEnrichment(jobId) {
const url = `https://leadsapi.postorbit.io/api/v1/enrichment/status/${jobId}`;
const headers = { Authorization: `Bearer ${process.env.LOCALLEADS_API_KEY}` };
while (true) {
const { data } = await fetch(url, { headers }).then((r) => r.json());
console.log(`Progress: ${data.progress}%`);
if (data.status === "COMPLETED") return data;
if (data.status === "FAILED") throw new Error("Enrichment failed");
await new Promise((r) => setTimeout(r, 3000));
}
}Get Lead Enrichment Data
/api/v1/enrichment/lead/:leadIdauthRetrieve enrichment data (emails, confidence scores) for a single lead.
Path parameters
:leadId*The lead ID from a search result.
{
"success": true,
"data": {
"leadId": "cm9lead001",
"emails": [
{
"email": "[email protected]",
"confidence": 0.94,
"source": "website"
}
],
"enrichedAt": "2026-05-05T11:23:00.000Z"
}
}List Active Jobs
/api/v1/enrichment/jobsauthList all currently running enrichment (and search) jobs for your organisation.
{
"success": true,
"data": [
{
"jobId": "enrich_abc123",
"progress": 62,
"leadCount": 35,
"type": "enrichment"
},
{
"jobId": "cm9search456",
"progress": 50,
"leadCount": 100,
"type": "search",
"query": "Lawyers"
}
]
}