Enrich a record
Looks up missing information for a record from Lightfield’s enrichment providers and writes it back to it. Accepts contacts and accounts.
Enrichment runs in the background: this returns as soon as the run is created. Poll GET /v1/enrichmentRun/{runId} for its status. A record can only have one enrichment run at a time — if one is already in flight, this returns that run rather than starting a second.
Which fields are enriched, and whether a provider answer overwrites an existing value or is raised as a suggestion, come from the workspace’s enrichment settings. Naming fields explicitly overrides which fields are enriched, but not the write policy.
Required scopes: contacts:update to enrich a contact, accounts:update to enrich an account
Rate limit category: Write
Enrich a record
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const enrichmentRunEnrichResponse = await client.enrichmentRun.enrich('entityId', {
entitySlug: 'contacts',
});
console.log(enrichmentRunEnrichResponse.enrichmentRun);{
"enrichmentRun": {
"id": "id",
"completedAt": "completedAt",
"createdAt": "createdAt",
"entityId": "entityId",
"entityType": "contact",
"startedAt": "startedAt",
"status": "queued",
"targetFields": [
"string"
],
"trigger": "creation",
"updatedAt": "updatedAt"
},
"reason": "no_targets",
"status": "started"
}Returns Examples
{
"enrichmentRun": {
"id": "id",
"completedAt": "completedAt",
"createdAt": "createdAt",
"entityId": "entityId",
"entityType": "contact",
"startedAt": "startedAt",
"status": "queued",
"targetFields": [
"string"
],
"trigger": "creation",
"updatedAt": "updatedAt"
},
"reason": "no_targets",
"status": "started"
}