Export campaign results as CSV
curl --request POST \
--url https://api.datalane.com/v1/campaigns/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>"
}
'import requests
url = "https://api.datalane.com/v1/campaigns/export"
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/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"campaignId": "<string>",
"url": "https://downloads.datalane.com/campaign-results.csv",
"urlExpiresAt": "2026-07-21T15:00:00.000Z",
"rows": {
"accounts": 100,
"contacts": 275
},
"file": {
"format": "csv",
"encoding": "utf-8-bom"
}
},
"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": "not_found",
"message": "<string>",
"details": {
"resource": "<string>",
"id": "<string>"
}
}
}{
"data": null,
"error": {
"code": "results_not_ready",
"message": "<string>"
}
}{
"data": null,
"error": {
"code": "results_expired",
"message": "<string>"
}
}{
"data": null,
"error": {
"code": "no_eligible_accounts",
"message": "<string>",
"details": {
"requested": 4503599627370495
}
}
}{
"data": null,
"error": {
"code": "internal_error",
"message": "Internal error."
}
}Campaigns
Export campaign results as CSV
POST
/
v1
/
campaigns
/
export
Export campaign results as CSV
curl --request POST \
--url https://api.datalane.com/v1/campaigns/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>"
}
'import requests
url = "https://api.datalane.com/v1/campaigns/export"
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/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"campaignId": "<string>",
"url": "https://downloads.datalane.com/campaign-results.csv",
"urlExpiresAt": "2026-07-21T15:00:00.000Z",
"rows": {
"accounts": 100,
"contacts": 275
},
"file": {
"format": "csv",
"encoding": "utf-8-bom"
}
},
"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": "not_found",
"message": "<string>",
"details": {
"resource": "<string>",
"id": "<string>"
}
}
}{
"data": null,
"error": {
"code": "results_not_ready",
"message": "<string>"
}
}{
"data": null,
"error": {
"code": "results_expired",
"message": "<string>"
}
}{
"data": null,
"error": {
"code": "no_eligible_accounts",
"message": "<string>",
"details": {
"requested": 4503599627370495
}
}
}{
"data": null,
"error": {
"code": "internal_error",
"message": "Internal error."
}
}The campaign must be
enriched and its results must not have expired. Each request creates a fresh file and signed URL. Files always contain the standard DataLane column catalog, regardless of how the campaign was created.
Omit maxContactsPerAccount for all contacts, set a positive cap, or use 0 for account-only rows. When hasMobilePhone and hasEmail are both true, the filters use OR semantics.
See Export results for examples and download handling.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}$Contacts per account cap. Omit for all contacts; 0 produces one account-only row per account.
Required range:
0 <= x <= 9007199254740991Examples:
3
0
Include only contacts with a mobile phone. Combines with hasEmail as OR when both are true.
Include only contacts with an email address. Combines with hasMobilePhone as OR when both are true.