Update Campaign Settings
curl --request PATCH \
--url https://api.lemlist.com/api/campaigns/{campaignId}/settings \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"tracking": {
"trackOpens": false,
"trackClicks": false
},
"automation": {
"autoReview": true,
"autoReviewConditions": [
"deliverable"
]
},
"onReplied": {
"campaignProgress": "pause"
}
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/settings"
payload = {
"tracking": {
"trackOpens": False,
"trackClicks": False
},
"automation": {
"autoReview": True,
"autoReviewConditions": ["deliverable"]
},
"onReplied": { "campaignProgress": "pause" }
}
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({
tracking: {trackOpens: false, trackClicks: false},
automation: {autoReview: true, autoReviewConditions: ['deliverable']},
onReplied: {campaignProgress: 'pause'}
})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/settings', 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}/settings")
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 \"tracking\": {\n \"trackOpens\": false,\n \"trackClicks\": false\n },\n \"automation\": {\n \"autoReview\": true,\n \"autoReviewConditions\": [\n \"deliverable\"\n ]\n },\n \"onReplied\": {\n \"campaignProgress\": \"pause\"\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}/settings",
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([
'tracking' => [
'trackOpens' => false,
'trackClicks' => false
],
'automation' => [
'autoReview' => true,
'autoReviewConditions' => [
'deliverable'
]
],
'onReplied' => [
'campaignProgress' => 'pause'
]
]),
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;
}{
"campaignId": "cam_hNtZRPpyNP6HRp4PV",
"timezone": "Europe/Paris",
"senderStrategy": "random",
"general": {
"labels": [
{
"id": "lab_aHYwTgdfZU1GpO47A",
"name": "Outbound"
}
],
"sequenceId": "seq_4LUxRGgCy7MGaQq0c",
"sequenceSharing": false,
"unsubscribeMode": "contact",
"addUnsubscribeLink": true,
"unsubscribeLinkText": "Unsubscribe"
},
"senders": {
"espMatching": true,
"espRouting": {
"gmail": "gmail",
"outlook": "outlook",
"other": "other"
}
},
"automation": {
"autoReview": true,
"autoReviewConditions": [
"deliverable"
]
},
"tracking": {
"trackOpens": false,
"trackClicks": false,
"trackReplies": true
},
"onReplied": {
"createNewTask": false,
"campaignProgress": "pause",
"propagateProgressToCompany": false,
"disableOutOfOffice": false
},
"onLinkClicked": {
"createNewTask": false,
"campaignProgress": "continue",
"propagateProgressToCompany": false,
"specificLinks": []
},
"onMeetingBooked": {
"campaignProgress": "stop",
"propagateProgressToCompany": true
},
"aiFeatures": {
"scoreReplies": true,
"onInterestedReply": {
"enabled": true,
"pauseAllCampaignsForLead": true,
"pauseCampaignForCompany": false,
"pauseAllCampaignsForCompany": false
},
"onNotInterestedReply": {
"enabled": false,
"pauseAllCampaignsForLead": false,
"pauseCampaignForCompany": false,
"pauseAllCampaignsForCompany": false
}
},
"schedule": {
"isTimezoneBasedSchedule": false,
"timezoneBasedScheduleId": null,
"scheduleIds": [
"skd_NHanXKczmWCI0tl1m"
],
"holidayCountries": [
"FR"
],
"sendingPattern": {
"newLeadsPriorityRatio": 0.5
}
}
}{
"error": "Invalid campaign settings",
"code": "CAMPAIGN_SETTINGS_INVALID_INPUT",
"details": {
"issues": [
{
"field": "general.labels",
"code": "CAMPAIGN_SETTINGS_READ_ONLY_FIELD",
"message": "Read-only: returned by GET, not writable with PATCH"
},
{
"field": "onReplied.campaignProgress",
"code": "invalid_value",
"message": "Invalid option: expected one of \"continue\"|\"pause\"|\"stop\""
}
]
}
}The authentication you supplied is incorrectroute is available starting emailPro plan{
"error": "Campaign not found",
"code": "CAMPAIGN_NOT_FOUND"
}{
"error": "Route bad method",
"code": "ROUTE_BAD_METHOD"
}{
"error": "Auto-review needs a custom tracking domain. Set one up, or send tracking: { trackOpens: false, trackClicks: false } in the same request",
"code": "CAMPAIGN_SETTINGS_AUTO_REVIEW_REQUIRES_CTD"
}Campaigns
Update Campaign Settings
Changes the settings of a campaign, then returns all its settings.
PATCH
/
campaigns
/
{campaignId}
/
settings
Update Campaign Settings
curl --request PATCH \
--url https://api.lemlist.com/api/campaigns/{campaignId}/settings \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"tracking": {
"trackOpens": false,
"trackClicks": false
},
"automation": {
"autoReview": true,
"autoReviewConditions": [
"deliverable"
]
},
"onReplied": {
"campaignProgress": "pause"
}
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/settings"
payload = {
"tracking": {
"trackOpens": False,
"trackClicks": False
},
"automation": {
"autoReview": True,
"autoReviewConditions": ["deliverable"]
},
"onReplied": { "campaignProgress": "pause" }
}
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({
tracking: {trackOpens: false, trackClicks: false},
automation: {autoReview: true, autoReviewConditions: ['deliverable']},
onReplied: {campaignProgress: 'pause'}
})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/settings', 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}/settings")
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 \"tracking\": {\n \"trackOpens\": false,\n \"trackClicks\": false\n },\n \"automation\": {\n \"autoReview\": true,\n \"autoReviewConditions\": [\n \"deliverable\"\n ]\n },\n \"onReplied\": {\n \"campaignProgress\": \"pause\"\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}/settings",
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([
'tracking' => [
'trackOpens' => false,
'trackClicks' => false
],
'automation' => [
'autoReview' => true,
'autoReviewConditions' => [
'deliverable'
]
],
'onReplied' => [
'campaignProgress' => 'pause'
]
]),
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;
}{
"campaignId": "cam_hNtZRPpyNP6HRp4PV",
"timezone": "Europe/Paris",
"senderStrategy": "random",
"general": {
"labels": [
{
"id": "lab_aHYwTgdfZU1GpO47A",
"name": "Outbound"
}
],
"sequenceId": "seq_4LUxRGgCy7MGaQq0c",
"sequenceSharing": false,
"unsubscribeMode": "contact",
"addUnsubscribeLink": true,
"unsubscribeLinkText": "Unsubscribe"
},
"senders": {
"espMatching": true,
"espRouting": {
"gmail": "gmail",
"outlook": "outlook",
"other": "other"
}
},
"automation": {
"autoReview": true,
"autoReviewConditions": [
"deliverable"
]
},
"tracking": {
"trackOpens": false,
"trackClicks": false,
"trackReplies": true
},
"onReplied": {
"createNewTask": false,
"campaignProgress": "pause",
"propagateProgressToCompany": false,
"disableOutOfOffice": false
},
"onLinkClicked": {
"createNewTask": false,
"campaignProgress": "continue",
"propagateProgressToCompany": false,
"specificLinks": []
},
"onMeetingBooked": {
"campaignProgress": "stop",
"propagateProgressToCompany": true
},
"aiFeatures": {
"scoreReplies": true,
"onInterestedReply": {
"enabled": true,
"pauseAllCampaignsForLead": true,
"pauseCampaignForCompany": false,
"pauseAllCampaignsForCompany": false
},
"onNotInterestedReply": {
"enabled": false,
"pauseAllCampaignsForLead": false,
"pauseCampaignForCompany": false,
"pauseAllCampaignsForCompany": false
}
},
"schedule": {
"isTimezoneBasedSchedule": false,
"timezoneBasedScheduleId": null,
"scheduleIds": [
"skd_NHanXKczmWCI0tl1m"
],
"holidayCountries": [
"FR"
],
"sendingPattern": {
"newLeadsPriorityRatio": 0.5
}
}
}{
"error": "Invalid campaign settings",
"code": "CAMPAIGN_SETTINGS_INVALID_INPUT",
"details": {
"issues": [
{
"field": "general.labels",
"code": "CAMPAIGN_SETTINGS_READ_ONLY_FIELD",
"message": "Read-only: returned by GET, not writable with PATCH"
},
{
"field": "onReplied.campaignProgress",
"code": "invalid_value",
"message": "Invalid option: expected one of \"continue\"|\"pause\"|\"stop\""
}
]
}
}The authentication you supplied is incorrectroute is available starting emailPro plan{
"error": "Campaign not found",
"code": "CAMPAIGN_NOT_FOUND"
}{
"error": "Route bad method",
"code": "ROUTE_BAD_METHOD"
}{
"error": "Auto-review needs a custom tracking domain. Set one up, or send tracking: { trackOpens: false, trackClicks: false } in the same request",
"code": "CAMPAIGN_SETTINGS_AUTO_REVIEW_REQUIRES_CTD"
}This endpoint requires at least the Email Pro plan.
Validation
- An unknown field or a read-only field answers
400CAMPAIGN_SETTINGS_INVALID_INPUT.details.issueslists every refused field, so that you can fix them all in one retry. - An empty body answers
400. - All the checks run before the first write. A refused request writes nothing.
Conditions
| Change | Condition | Error if not met |
|---|---|---|
senders.espMatching: true | The team has at least one active mailbox. | 409 CAMPAIGN_SETTINGS_ESP_MATCHING_UNAVAILABLE |
automation.autoReview: true | The team has a custom tracking domain, or open and click tracking are off. | 409 CAMPAIGN_SETTINGS_AUTO_REVIEW_REQUIRES_CTD |
senderStrategy | random, contactOwner, leadImporter or customField:<fieldName>. | 400 CAMPAIGN_INVALID_SENDER_STRATEGY |
tracking: { "trackOpens": false, "trackClicks": false } in the same request.
On a campaign with a dynamic sender strategy, set the senders that the leads
cannot select with
Replace Campaign Sender Exclusions.
Authorizations
Body
application/json
The settings to change. Send at least one section. An omitted section or field keeps its value. An unknown or read-only field answers 400.
Sending schedule options. Change the schedules themselves with the Schedules endpoints.
Show child attributes
Show child attributes
Response
Success
All the settings of a campaign.
Sending schedule options. Read and change the schedules themselves with the Schedules endpoints.
Show child attributes
Show child attributes
Was this page helpful?