Add Campaign Senders
curl --request POST \
--url https://api.lemlist.com/api/campaigns/{campaignId}/senders \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"senders": [
{
"userId": "usr_A1b2C3d4E5f6G7h8N"
}
]
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/senders"
payload = { "senders": [{ "userId": "usr_A1b2C3d4E5f6G7h8N" }] }
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({senders: [{userId: 'usr_A1b2C3d4E5f6G7h8N'}]})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/senders', 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}/senders")
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 \"senders\": [\n {\n \"userId\": \"usr_A1b2C3d4E5f6G7h8N\"\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}/senders",
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([
'senders' => [
[
'userId' => 'usr_A1b2C3d4E5f6G7h8N'
]
]
]),
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_A1b2C3d4E5f6G7h8M",
"senderStrategy": "random",
"espMatching": false,
"readOnly": false,
"senders": [
{
"userId": "usr_A1b2C3d4E5f6G7h8K",
"name": "John Doe",
"email": "john@example.com",
"channels": [
{
"type": "email",
"id": "usm_A1b2C3d4E5f6G7h8L",
"label": "john@example.com",
"alias": "john@example.com",
"esp": "google",
"diagnostics": []
}
],
"diagnostics": []
},
{
"userId": "usr_A1b2C3d4E5f6G7h8N",
"name": "Jane Smith",
"email": "jane@example.com",
"channels": [
{
"type": "email",
"id": "usm_A1b2C3d4E5f6G7h8P",
"label": "jane@example.com",
"alias": "jane@example.com",
"esp": "microsoft",
"diagnostics": []
}
],
"diagnostics": []
}
],
"diagnostics": []
}
}{
"error": "No step of the campaign uses this channel type. Add a step of this type first",
"code": "SENDER_CAMPAIGN_CHANNEL_TYPE_NOT_REQUIRED"
}The authentication you supplied is incorrectroute is available starting emailPro plan{
"error": "Campaign not found",
"code": "SENDER_CAMPAIGN_NOT_FOUND"
}{
"error": "Route bad method",
"code": "ROUTE_BAD_METHOD"
}{
"error": "The campaign uses a dynamic sender strategy: the leads select the senders",
"code": "SENDER_CAMPAIGN_DYNAMIC_STRATEGY"
}Senders
Add Campaign Senders
Adds senders, or channels of senders, to the sender pool of a campaign.
POST
/
campaigns
/
{campaignId}
/
senders
Add Campaign Senders
curl --request POST \
--url https://api.lemlist.com/api/campaigns/{campaignId}/senders \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"senders": [
{
"userId": "usr_A1b2C3d4E5f6G7h8N"
}
]
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/senders"
payload = { "senders": [{ "userId": "usr_A1b2C3d4E5f6G7h8N" }] }
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({senders: [{userId: 'usr_A1b2C3d4E5f6G7h8N'}]})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/senders', 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}/senders")
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 \"senders\": [\n {\n \"userId\": \"usr_A1b2C3d4E5f6G7h8N\"\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}/senders",
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([
'senders' => [
[
'userId' => 'usr_A1b2C3d4E5f6G7h8N'
]
]
]),
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_A1b2C3d4E5f6G7h8M",
"senderStrategy": "random",
"espMatching": false,
"readOnly": false,
"senders": [
{
"userId": "usr_A1b2C3d4E5f6G7h8K",
"name": "John Doe",
"email": "john@example.com",
"channels": [
{
"type": "email",
"id": "usm_A1b2C3d4E5f6G7h8L",
"label": "john@example.com",
"alias": "john@example.com",
"esp": "google",
"diagnostics": []
}
],
"diagnostics": []
},
{
"userId": "usr_A1b2C3d4E5f6G7h8N",
"name": "Jane Smith",
"email": "jane@example.com",
"channels": [
{
"type": "email",
"id": "usm_A1b2C3d4E5f6G7h8P",
"label": "jane@example.com",
"alias": "jane@example.com",
"esp": "microsoft",
"diagnostics": []
}
],
"diagnostics": []
}
],
"diagnostics": []
}
}{
"error": "No step of the campaign uses this channel type. Add a step of this type first",
"code": "SENDER_CAMPAIGN_CHANNEL_TYPE_NOT_REQUIRED"
}The authentication you supplied is incorrectroute is available starting emailPro plan{
"error": "Campaign not found",
"code": "SENDER_CAMPAIGN_NOT_FOUND"
}{
"error": "Route bad method",
"code": "ROUTE_BAD_METHOD"
}{
"error": "The campaign uses a dynamic sender strategy: the leads select the senders",
"code": "SENDER_CAMPAIGN_DYNAMIC_STRATEGY"
}The sender pool requires at least the Email Pro plan.
To pin the sender of one step, outside the pool, see
Set Step Sender in the
Sequences group.
- Without
channels, a sender gets the channel types that the campaign steps use, healthy accounts first. The campaign editor does the same when you enable a sender. - A sender already in the pool keeps their channels, and gets the listed channels.
- A channel type must be used by at least one step of the campaign. Get the
types in
requiredChannelTypesof List Senders. - Get the user ids, the account ids and the aliases from List Senders.
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The unique identifier of the campaign
Body
application/json
Minimum array length:
1Show child attributes
Show child attributes
Was this page helpful?