Add ABM Campaign Leads
curl --request POST \
--url https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"leadIds": [
"123456789",
"987654321"
]
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads"
payload = { "leadIds": ["123456789", "987654321"] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({leadIds: ['123456789', '987654321']})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"leadIds\": [\n \"123456789\",\n \"987654321\"\n ]\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'leadIds' => [
'123456789',
'987654321'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"addedCount": 1,
"alreadyInCampaignCount": 0,
"skipped": [
{
"leadId": "987654321",
"code": "ABS_CONTACT_SOURCING_CONTACT_ON_ANOTHER_COMPANY"
}
]
}
}{
"error": "Too many leads selected",
"code": "ABS_ENGAGE_TOO_MANY_LEADS"
}{
"error": "Beta is not enabled",
"code": "BETA_NOT_ENABLED"
}{
"error": "This campaign is not an ABM campaign",
"code": "ABS_ENGAGE_CAMPAIGN_NOT_ABM"
}Campaigns
Add ABM Campaign Leads
Adds People Database people to an ABM campaign.
POST
/
campaigns
/
{campaignId}
/
abm-leads
Add ABM Campaign Leads
curl --request POST \
--url https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"leadIds": [
"123456789",
"987654321"
]
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads"
payload = { "leadIds": ["123456789", "987654321"] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({leadIds: ['123456789', '987654321']})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"leadIds\": [\n \"123456789\",\n \"987654321\"\n ]\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/campaigns/{campaignId}/abm-leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'leadIds' => [
'123456789',
'987654321'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"addedCount": 1,
"alreadyInCampaignCount": 0,
"skipped": [
{
"leadId": "987654321",
"code": "ABS_CONTACT_SOURCING_CONTACT_ON_ANOTHER_COMPANY"
}
]
}
}{
"error": "Too many leads selected",
"code": "ABS_ENGAGE_TOO_MANY_LEADS"
}{
"error": "Beta is not enabled",
"code": "BETA_NOT_ENABLED"
}{
"error": "This campaign is not an ABM campaign",
"code": "ABS_ENGAGE_CAMPAIGN_NOT_ABM"
}Beta: this endpoint requires the ABM beta on your team. Without it, the call
answers
403 with BETA_NOT_ENABLED.contacts[].leadId, and adds each person to the campaign as a lead.
Filed under the campaign’s company
Each new contact is filed under the company the ABM campaign engages, whatever the person’s profile lists as their current employer. That keeps every lead of an ABM campaign on its account. Someone your workspace already has as a contact of another company is skipped and left where they are: the response lists them inskipped.
| Code | Meaning |
|---|---|
200 | Done. addedCount leads added, alreadyInCampaignCount already there, skipped people not added. |
400 | leadIds is missing, empty or too long, or campaignId is malformed. |
403 | The ABM beta is not enabled, or the API key’s user cannot create contacts. Nothing is written. |
404 | The campaign is not an ABM campaign of your team, or its company no longer exists. |
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The ABM campaign, opened with Engage on a company
Body
application/json
People Database ids, from People Database search results or a contact-sourcing run's contacts[].leadId.
Required array length:
1 - 199 elementsResponse
What the call did. A skipped person is a normal outcome, not an error.
Was this page helpful?