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
package main
import (
"context"
"fmt"
"github.com/Lightfld/lightfield-go"
"github.com/Lightfld/lightfield-go/option"
)
func main() {
client := githubcomlightfldlightfieldgo.NewClient(
option.WithAPIKey("My API Key"),
)
enrichmentRunEnrichResponse, err := client.EnrichmentRun.Enrich(
context.TODO(),
"entityId",
githubcomlightfldlightfieldgo.EnrichmentRunEnrichParams{
EntitySlug: githubcomlightfldlightfieldgo.EnrichmentRunEnrichParamsEntitySlugContacts,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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"
}