Update Campaign Sender Channels
curl --request PATCH \
--url https://api.lemlist.com/api/campaigns/{campaignId}/senders/{userId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
{
"type": "whatsapp",
"id": "uwa_A1b2C3d4E5f6G7h8Q",
"enabled": true
},
{
"type": "email",
"id": "usm_A1b2C3d4E5f6G7h8P",
"alias": "hello@example.com"
}
]
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/senders/{userId}"
payload = { "channels": [
{
"type": "whatsapp",
"id": "uwa_A1b2C3d4E5f6G7h8Q",
"enabled": True
},
{
"type": "email",
"id": "usm_A1b2C3d4E5f6G7h8P",
"alias": "hello@example.com"
}
] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channels: [
{type: 'whatsapp', id: 'uwa_A1b2C3d4E5f6G7h8Q', enabled: true},
{type: 'email', id: 'usm_A1b2C3d4E5f6G7h8P', alias: 'hello@example.com'}
]
})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/senders/{userId}', 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/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channels\": [\n {\n \"type\": \"whatsapp\",\n \"id\": \"uwa_A1b2C3d4E5f6G7h8Q\",\n \"enabled\": true\n },\n {\n \"type\": \"email\",\n \"id\": \"usm_A1b2C3d4E5f6G7h8P\",\n \"alias\": \"hello@example.com\"\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/{userId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'channels' => [
[
'type' => 'whatsapp',
'id' => 'uwa_A1b2C3d4E5f6G7h8Q',
'enabled' => true
],
[
'type' => 'email',
'id' => 'usm_A1b2C3d4E5f6G7h8P',
'alias' => 'hello@example.com'
]
]
]),
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": "hello@example.com",
"esp": "microsoft",
"diagnostics": []
},
{
"type": "whatsapp",
"id": "uwa_A1b2C3d4E5f6G7h8Q",
"label": "+15550100199",
"diagnostics": []
}
],
"diagnostics": []
}
],
"diagnostics": []
}
}{
"error": "LinkedIn cannot be disabled alone. Remove the sender from the campaign instead",
"code": "SENDER_CAMPAIGN_LINKEDIN_IMPLICIT"
}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
Update Campaign Sender Channels
Enables or disables channels of one sender, or changes the alias of a mailbox.
PATCH
/
campaigns
/
{campaignId}
/
senders
/
{userId}
Update Campaign Sender Channels
curl --request PATCH \
--url https://api.lemlist.com/api/campaigns/{campaignId}/senders/{userId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
{
"type": "whatsapp",
"id": "uwa_A1b2C3d4E5f6G7h8Q",
"enabled": true
},
{
"type": "email",
"id": "usm_A1b2C3d4E5f6G7h8P",
"alias": "hello@example.com"
}
]
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/senders/{userId}"
payload = { "channels": [
{
"type": "whatsapp",
"id": "uwa_A1b2C3d4E5f6G7h8Q",
"enabled": True
},
{
"type": "email",
"id": "usm_A1b2C3d4E5f6G7h8P",
"alias": "hello@example.com"
}
] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channels: [
{type: 'whatsapp', id: 'uwa_A1b2C3d4E5f6G7h8Q', enabled: true},
{type: 'email', id: 'usm_A1b2C3d4E5f6G7h8P', alias: 'hello@example.com'}
]
})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/senders/{userId}', 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/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channels\": [\n {\n \"type\": \"whatsapp\",\n \"id\": \"uwa_A1b2C3d4E5f6G7h8Q\",\n \"enabled\": true\n },\n {\n \"type\": \"email\",\n \"id\": \"usm_A1b2C3d4E5f6G7h8P\",\n \"alias\": \"hello@example.com\"\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/{userId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'channels' => [
[
'type' => 'whatsapp',
'id' => 'uwa_A1b2C3d4E5f6G7h8Q',
'enabled' => true
],
[
'type' => 'email',
'id' => 'usm_A1b2C3d4E5f6G7h8P',
'alias' => 'hello@example.com'
]
]
]),
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": "hello@example.com",
"esp": "microsoft",
"diagnostics": []
},
{
"type": "whatsapp",
"id": "uwa_A1b2C3d4E5f6G7h8Q",
"label": "+15550100199",
"diagnostics": []
}
],
"diagnostics": []
}
],
"diagnostics": []
}
}{
"error": "LinkedIn cannot be disabled alone. Remove the sender from the campaign instead",
"code": "SENDER_CAMPAIGN_LINKEDIN_IMPLICIT"
}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.
| Change | Body entry |
|---|---|
| Enable one account | { "type": "whatsapp", "id": "<account id>", "enabled": true } |
| Enable every account of a type | { "type": "email", "enabled": true } |
| Disable one account | { "type": "email", "id": "<mailbox id>", "enabled": false } |
| Change the alias of a mailbox | { "type": "email", "id": "<mailbox id>", "alias": "<address>" } |
- A sender outside the pool joins the pool with the enabled channels.
- When the last channel of a sender is disabled, the sender leaves the pool.
- LinkedIn cannot be disabled alone: a sender in the pool always sends on LinkedIn. To stop it, use Remove Campaign Sender.
- An enabled channel type must be used by at least one step of the campaign.
impact.contactedLeads gives the
contacted leads that keep this channel. Their next steps stop with a “Send user
is missing” error, until the channel comes back in the pool.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
The team member to change
Body
application/json
Minimum array length:
1Show child attributes
Show child attributes
Was this page helpful?