curl --request POST \
--url https://api.lemlist.com/api/campaigns \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My new campaign"
}
'import requests
url = "https://api.lemlist.com/api/campaigns"
payload = { "name": "My new campaign" }
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({name: 'My new campaign'})
};
fetch('https://api.lemlist.com/api/campaigns', 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")
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 \"name\": \"My new campaign\"\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",
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([
'name' => 'My new campaign'
]),
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;
}{
"_id": "cam_kok3I33Sba7mcNIO7",
"sequenceId": "seq_ScVmFnlKdP6aVmyZN",
"scheduleIds": [
"skd_IrCdCoQ0ZUAEeUDwR"
],
"teamId": "tea_edrkv2LgUK4Wf4ZzO",
"createdBy": "usr_Sy3xIhbEi7auHFv5A",
"createdAt": "2025-01-16T13:53:22.726Z",
"state": "running",
"scannedCount": 0,
"reviewedCount": 0,
"inSequenceLeadCount": 0,
"variableKeys": [],
"senders": [],
"sendUsers": [],
"displayedVariableKeys": [
"companyName"
],
"emoji": "π",
"stopOnEmailReplied": true,
"crmOpportunitiesOnTask": true,
"unsubscribe": "campaign",
"name": "My new campaign",
"crm": "hubspot",
"crmUserId": "usr_0p9Q8ZyXSTNGpsHOe"
}No API key providedThe authentication you supplied is incorrectUser linked to this API key is blockedNo user found for this API keyCreate Campaign
Creates a new campaign with auto-generated sequence and schedule.
curl --request POST \
--url https://api.lemlist.com/api/campaigns \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My new campaign"
}
'import requests
url = "https://api.lemlist.com/api/campaigns"
payload = { "name": "My new campaign" }
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({name: 'My new campaign'})
};
fetch('https://api.lemlist.com/api/campaigns', 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")
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 \"name\": \"My new campaign\"\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",
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([
'name' => 'My new campaign'
]),
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;
}{
"_id": "cam_kok3I33Sba7mcNIO7",
"sequenceId": "seq_ScVmFnlKdP6aVmyZN",
"scheduleIds": [
"skd_IrCdCoQ0ZUAEeUDwR"
],
"teamId": "tea_edrkv2LgUK4Wf4ZzO",
"createdBy": "usr_Sy3xIhbEi7auHFv5A",
"createdAt": "2025-01-16T13:53:22.726Z",
"state": "running",
"scannedCount": 0,
"reviewedCount": 0,
"inSequenceLeadCount": 0,
"variableKeys": [],
"senders": [],
"sendUsers": [],
"displayedVariableKeys": [
"companyName"
],
"emoji": "π",
"stopOnEmailReplied": true,
"crmOpportunitiesOnTask": true,
"unsubscribe": "campaign",
"name": "My new campaign",
"crm": "hubspot",
"crmUserId": "usr_0p9Q8ZyXSTNGpsHOe"
}No API key providedThe authentication you supplied is incorrectUser linked to this API key is blockedNo user found for this API keytimezone (IANA format, e.g. America/New_York) to control the campaign scheduleβs timezone. If omitted, it defaults to Europe/Paris.
You can optionally set an emoji (e.g. π) to show next to the campaign name. If omitted, a random emoji is assigned. An empty or whitespace-only string, null, or a value containing < or > returns a 400 error.
Set autoReview to true to automatically launch leads as soon as they are added to the campaign, skipping manual review. Use autoReviewConditions to restrict auto-launch to leads whose email verification matches one of the given deliverability statuses (deliverable, risky, undeliverable, unverified). Passing an invalid status returns a 400 error.
The returned data includes the campaign, sequence, and schedule IDs, which you can use later to update campaign settings, add sequence steps, or modify the schedule.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
The name of the campaign
IANA timezone for the campaign schedule (e.g. America/New_York). Defaults to Europe/Paris if omitted.
Emoji shown next to the campaign name (e.g. π). A random emoji is assigned when omitted. An empty or whitespace-only string, null, or a value containing < or > returns a 400 error.
Automatically launch (review) leads as soon as they are added to the campaign, instead of requiring manual review. Defaults to false.
Email deliverability statuses for which a lead is auto-launched when autoReview is enabled. Only leads whose email verification matches one of these statuses are launched automatically. Invalid values are rejected with a 400 error.
deliverable, risky, undeliverable, unverified Response
Success
Was this page helpful?