Get Campaign Sender Exclusions
curl --request GET \
--url https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions', 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}/dynamic-sender-exclusions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
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}/dynamic-sender-exclusions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"campaignId": "cam_hNtZRPpyNP6HRp4PV",
"senderStrategy": "contactOwner",
"source": "campaign",
"senders": [
{
"userId": "usr_T2wWj3GOt0hXms721",
"channels": [
{
"type": "email",
"id": "usm_oZOkr8H1oFjgvDI6J"
},
{
"type": "linkedin"
}
]
},
{
"userId": "usr_ll2LqAVvLk75ER9fv"
}
]
}
}{
"error": "Wrong param campaign id",
"code": "WRONG_PARAM_CAMPAIGN_ID"
}The authentication you supplied is incorrectroute is available starting emailPro plan{
"error": "Campaign not found",
"code": "CAMPAIGN_DYNAMIC_SENDER_CAMPAIGN_NOT_FOUND"
}{
"error": "Route bad method",
"code": "ROUTE_BAD_METHOD"
}Senders
Get Campaign Sender Exclusions
Returns the senders that the leads of a campaign cannot select.
GET
/
campaigns
/
{campaignId}
/
dynamic-sender-exclusions
Get Campaign Sender Exclusions
curl --request GET \
--url https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions', 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}/dynamic-sender-exclusions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
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}/dynamic-sender-exclusions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"campaignId": "cam_hNtZRPpyNP6HRp4PV",
"senderStrategy": "contactOwner",
"source": "campaign",
"senders": [
{
"userId": "usr_T2wWj3GOt0hXms721",
"channels": [
{
"type": "email",
"id": "usm_oZOkr8H1oFjgvDI6J"
},
{
"type": "linkedin"
}
]
},
{
"userId": "usr_ll2LqAVvLk75ER9fv"
}
]
}
}{
"error": "Wrong param campaign id",
"code": "WRONG_PARAM_CAMPAIGN_ID"
}The authentication you supplied is incorrectroute is available starting emailPro plan{
"error": "Campaign not found",
"code": "CAMPAIGN_DYNAMIC_SENDER_CAMPAIGN_NOT_FOUND"
}{
"error": "Route bad method",
"code": "ROUTE_BAD_METHOD"
}This endpoint requires at least the Email Pro plan.
source: "campaign": the campaign has its own list, which replaces the team list. An empty list excludes nobody on this campaign.source: "team": the campaign uses the team list.
senderStrategy is dynamic: contactOwner,
leadImporter or customField:<fieldName>. On a random campaign, the
sender pool applies.
A campaign hidden from the user of the API key answers 404.
These endpoints need an API key linked to a user. A key not linked to a user
gets a
401.Authorizations
Was this page helpful?