Enrich a campaign
curl --request POST \
--url https://api.datalane.com/v1/campaigns/enrich \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>"
}
'import requests
url = "https://api.datalane.com/v1/campaigns/enrich"
payload = { "campaignId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaignId: '<string>'})
};
fetch('https://api.datalane.com/v1/campaigns/enrich', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "<string>",
"status": "draft",
"createdVia": "api",
"name": "July target accounts",
"accounts": {
"requested": 100,
"eligible": 82,
"excluded": {
"total": 18,
"invalid": 5,
"recentlyEnriched": 13,
"crmExcluded": 0
}
},
"credits": {
"charged": 2,
"remaining": 998
},
"excludeEnrichedWithinDays": 30,
"lastEnrichment": {
"status": "failed",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"refunded": true
},
"createdAt": "2026-07-21T14:00:00.000Z",
"completedAt": "2023-11-07T05:31:56Z",
"resultsExpireAt": "2023-11-07T05:31:56Z",
"results": {
"totalAccounts": 100,
"totalContactsFound": 275,
"pctAccountsWithContact": 0.8,
"pctAccountsWithMobile": 0.6
}
},
"error": null
}{
"data": null,
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"issues": [
"<string>"
]
}
}
}{
"data": null,
"error": {
"code": "invalid_api_key",
"message": "<string>"
}
}{
"data": null,
"error": {
"code": "insufficient_credits",
"message": "<string>",
"details": {
"available": 4503599627370495,
"required": 4503599627370495,
"shortfall": 4503599627370495
}
}
}{
"data": null,
"error": {
"code": "not_found",
"message": "<string>",
"details": {
"resource": "<string>",
"id": "<string>"
}
}
}{
"data": null,
"error": {
"code": "campaign_not_enrichable",
"message": "<string>",
"details": {
"status": "draft"
}
}
}{
"data": null,
"error": {
"code": "no_eligible_accounts",
"message": "<string>",
"details": {
"requested": 4503599627370495
}
}
}{
"data": null,
"error": {
"code": "concurrency_limit_exceeded",
"message": "<string>",
"details": {
"limit": 4503599627370495,
"inFlight": 4503599627370495,
"requested": 4503599627370495
}
}
}{
"data": null,
"error": {
"code": "internal_error",
"message": "Internal error."
}
}Campaigns
Enrich a campaign
POST
/
v1
/
campaigns
/
enrich
Enrich a campaign
curl --request POST \
--url https://api.datalane.com/v1/campaigns/enrich \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>"
}
'import requests
url = "https://api.datalane.com/v1/campaigns/enrich"
payload = { "campaignId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaignId: '<string>'})
};
fetch('https://api.datalane.com/v1/campaigns/enrich', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "<string>",
"status": "draft",
"createdVia": "api",
"name": "July target accounts",
"accounts": {
"requested": 100,
"eligible": 82,
"excluded": {
"total": 18,
"invalid": 5,
"recentlyEnriched": 13,
"crmExcluded": 0
}
},
"credits": {
"charged": 2,
"remaining": 998
},
"excludeEnrichedWithinDays": 30,
"lastEnrichment": {
"status": "failed",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"refunded": true
},
"createdAt": "2026-07-21T14:00:00.000Z",
"completedAt": "2023-11-07T05:31:56Z",
"resultsExpireAt": "2023-11-07T05:31:56Z",
"results": {
"totalAccounts": 100,
"totalContactsFound": 275,
"pctAccountsWithContact": 0.8,
"pctAccountsWithMobile": 0.6
}
},
"error": null
}{
"data": null,
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"issues": [
"<string>"
]
}
}
}{
"data": null,
"error": {
"code": "invalid_api_key",
"message": "<string>"
}
}{
"data": null,
"error": {
"code": "insufficient_credits",
"message": "<string>",
"details": {
"available": 4503599627370495,
"required": 4503599627370495,
"shortfall": 4503599627370495
}
}
}{
"data": null,
"error": {
"code": "not_found",
"message": "<string>",
"details": {
"resource": "<string>",
"id": "<string>"
}
}
}{
"data": null,
"error": {
"code": "campaign_not_enrichable",
"message": "<string>",
"details": {
"status": "draft"
}
}
}{
"data": null,
"error": {
"code": "no_eligible_accounts",
"message": "<string>",
"details": {
"requested": 4503599627370495
}
}
}{
"data": null,
"error": {
"code": "concurrency_limit_exceeded",
"message": "<string>",
"details": {
"limit": 4503599627370495,
"inFlight": 4503599627370495,
"requested": 4503599627370495
}
}
}{
"data": null,
"error": {
"code": "internal_error",
"message": "Internal error."
}
}Only API-created campaigns in
draft can start enrichment. Calling this operation again while the campaign is already enriching returns its current state, which makes launch retries safe.
The launch validates the account list before charging credits: IDs not found in DataLane’s warehouse and accounts not eligible for enrichment (closed or inactive) are skipped and counted under accounts.excluded.invalid. It also applies the campaign’s excludeEnrichedWithinDays setting: accounts enriched within that lookback window are skipped. Set it at creation or change it with the update operation while the campaign is still a draft.
Once the launch evaluation lands, accounts.eligible reports the eligible count and accounts.excluded reports the exclusion breakdown. The enrich response can briefly predate that evaluation — poll the get operation to read the resolved counts.
See Campaign lifecycle for polling and credit behavior.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Pattern:
^camp_[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21}$