Create a campaign
curl --request POST \
--url https://api.datalane.com/v1/campaigns/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountIds": [
"9feafba5-78e5-4e19-b577-1455b0d2018c",
"ae46f8b8-4b9d-43ee-96e5-744943f6863a"
]
}
'import requests
url = "https://api.datalane.com/v1/campaigns/create"
payload = { "accountIds": ["9feafba5-78e5-4e19-b577-1455b0d2018c", "ae46f8b8-4b9d-43ee-96e5-744943f6863a"] }
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({
accountIds: ['9feafba5-78e5-4e19-b577-1455b0d2018c', 'ae46f8b8-4b9d-43ee-96e5-744943f6863a']
})
};
fetch('https://api.datalane.com/v1/campaigns/create', 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": "internal_error",
"message": "Internal error."
}
}Campaigns
Create a campaign
POST
/
v1
/
campaigns
/
create
Create a campaign
curl --request POST \
--url https://api.datalane.com/v1/campaigns/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountIds": [
"9feafba5-78e5-4e19-b577-1455b0d2018c",
"ae46f8b8-4b9d-43ee-96e5-744943f6863a"
]
}
'import requests
url = "https://api.datalane.com/v1/campaigns/create"
payload = { "accountIds": ["9feafba5-78e5-4e19-b577-1455b0d2018c", "ae46f8b8-4b9d-43ee-96e5-744943f6863a"] }
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({
accountIds: ['9feafba5-78e5-4e19-b577-1455b0d2018c', 'ae46f8b8-4b9d-43ee-96e5-744943f6863a']
})
};
fetch('https://api.datalane.com/v1/campaigns/create', 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": "internal_error",
"message": "Internal error."
}
}The request accepts between 1 and 5,000 account UUIDs. Duplicate UUIDs are stored once. If
name is omitted, DataLane assigns one.
Set excludeEnrichedWithinDays to a non-negative integer to skip accounts enriched within that lookback window when enrichment launches. Omit it or pass null to disable the recency exclusion. The setting can be changed with the update operation while the campaign is a draft.
Creation does not consume credits or start enrichment. Pass the returned campaign ID to the enrich operation.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Account UUIDs to enrich. Duplicates are stored once.
Required array length:
1 - 5000 elementsPattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Example:
[
"9feafba5-78e5-4e19-b577-1455b0d2018c",
"ae46f8b8-4b9d-43ee-96e5-744943f6863a"
]
Display name. DataLane assigns one if omitted.
Required string length:
1 - 200Example:
"July target accounts"
Skip accounts enriched within this many days when enrichment launches. Omit or pass null to disable the exclusion.
Required range:
0 <= x <= 9007199254740991Example:
30