Replace Campaign Sender Exclusions
curl --request PUT \
--url https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"senders": [
{
"userId": "usr_T2wWj3GOt0hXms721",
"channels": [
{
"type": "email",
"id": "usm_oZOkr8H1oFjgvDI6J"
},
{
"type": "linkedin"
}
]
},
{
"userId": "usr_ll2LqAVvLk75ER9fv"
}
]
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions"
payload = { "senders": [{
"userId": "usr_T2wWj3GOt0hXms721",
"channels": [{
"type": "email",
"id": "usm_oZOkr8H1oFjgvDI6J"
}, { "type": "linkedin" }]
}, { "userId": "usr_ll2LqAVvLk75ER9fv" }] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
senders: [
{
userId: 'usr_T2wWj3GOt0hXms721',
channels: [{type: 'email', id: 'usm_oZOkr8H1oFjgvDI6J'}, {type: 'linkedin'}]
},
{userId: 'usr_ll2LqAVvLk75ER9fv'}
]
})
};
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::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"senders\": [\n {\n \"userId\": \"usr_T2wWj3GOt0hXms721\",\n \"channels\": [\n {\n \"type\": \"email\",\n \"id\": \"usm_oZOkr8H1oFjgvDI6J\"\n },\n {\n \"type\": \"linkedin\"\n }\n ]\n },\n {\n \"userId\": \"usr_ll2LqAVvLk75ER9fv\"\n }\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}/dynamic-sender-exclusions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'senders' => [
[
'userId' => 'usr_T2wWj3GOt0hXms721',
'channels' => [
[
'type' => 'email',
'id' => 'usm_oZOkr8H1oFjgvDI6J'
],
[
'type' => 'linkedin'
]
]
],
[
'userId' => 'usr_ll2LqAVvLk75ER9fv'
]
]
]),
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": {
"campaignId": "cam_hNtZRPpyNP6HRp4PV",
"senderStrategy": "contactOwner",
"source": "campaign",
"senders": [
{
"userId": "usr_T2wWj3GOt0hXms721",
"channels": [
{
"type": "email",
"id": "usm_oZOkr8H1oFjgvDI6J"
},
{
"type": "linkedin"
}
]
},
{
"userId": "usr_ll2LqAVvLk75ER9fv"
}
]
}
}{
"error": "A channel does not belong to the sender. Take the channel id from the team senders list: the mailbox id, the WhatsApp account id or the phone number",
"code": "CAMPAIGN_DYNAMIC_SENDER_UNKNOWN_CHANNEL"
}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"
}{
"error": "The campaign does not use a dynamic sender strategy: its sender pool applies, not the exclusions. Set a dynamic strategy first",
"code": "CAMPAIGN_DYNAMIC_SENDER_STATIC_STRATEGY"
}Senders
Replace Campaign Sender Exclusions
Replaces the senders that the leads of a campaign cannot select.
PUT
/
campaigns
/
{campaignId}
/
dynamic-sender-exclusions
Replace Campaign Sender Exclusions
curl --request PUT \
--url https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"senders": [
{
"userId": "usr_T2wWj3GOt0hXms721",
"channels": [
{
"type": "email",
"id": "usm_oZOkr8H1oFjgvDI6J"
},
{
"type": "linkedin"
}
]
},
{
"userId": "usr_ll2LqAVvLk75ER9fv"
}
]
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/dynamic-sender-exclusions"
payload = { "senders": [{
"userId": "usr_T2wWj3GOt0hXms721",
"channels": [{
"type": "email",
"id": "usm_oZOkr8H1oFjgvDI6J"
}, { "type": "linkedin" }]
}, { "userId": "usr_ll2LqAVvLk75ER9fv" }] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
senders: [
{
userId: 'usr_T2wWj3GOt0hXms721',
channels: [{type: 'email', id: 'usm_oZOkr8H1oFjgvDI6J'}, {type: 'linkedin'}]
},
{userId: 'usr_ll2LqAVvLk75ER9fv'}
]
})
};
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::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"senders\": [\n {\n \"userId\": \"usr_T2wWj3GOt0hXms721\",\n \"channels\": [\n {\n \"type\": \"email\",\n \"id\": \"usm_oZOkr8H1oFjgvDI6J\"\n },\n {\n \"type\": \"linkedin\"\n }\n ]\n },\n {\n \"userId\": \"usr_ll2LqAVvLk75ER9fv\"\n }\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}/dynamic-sender-exclusions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'senders' => [
[
'userId' => 'usr_T2wWj3GOt0hXms721',
'channels' => [
[
'type' => 'email',
'id' => 'usm_oZOkr8H1oFjgvDI6J'
],
[
'type' => 'linkedin'
]
]
],
[
'userId' => 'usr_ll2LqAVvLk75ER9fv'
]
]
]),
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": {
"campaignId": "cam_hNtZRPpyNP6HRp4PV",
"senderStrategy": "contactOwner",
"source": "campaign",
"senders": [
{
"userId": "usr_T2wWj3GOt0hXms721",
"channels": [
{
"type": "email",
"id": "usm_oZOkr8H1oFjgvDI6J"
},
{
"type": "linkedin"
}
]
},
{
"userId": "usr_ll2LqAVvLk75ER9fv"
}
]
}
}{
"error": "A channel does not belong to the sender. Take the channel id from the team senders list: the mailbox id, the WhatsApp account id or the phone number",
"code": "CAMPAIGN_DYNAMIC_SENDER_UNKNOWN_CHANNEL"
}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"
}{
"error": "The campaign does not use a dynamic sender strategy: its sender pool applies, not the exclusions. Set a dynamic strategy first",
"code": "CAMPAIGN_DYNAMIC_SENDER_STATIC_STRATEGY"
}This endpoint requires at least the Email Pro plan.
senders: [...]gives the campaign its own list, which replaces the team list. An empty list excludes nobody on this campaign.senders: nullremoves the campaign list. The campaign uses the team list again.
contactOwner,
leadImporter or customField:<fieldName>). Else the request answers 409.
Change the strategy with
Update Campaign Settings.
Only the leads reviewed or launched after the change get a sender from the new
list.Authorizations
Body
application/json
Was this page helpful?