curl --request POST \
--url https://api.lemlist.com/api/campaigns/{campaignId}/leads/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "support@lemlist.com",
"firstName": "John",
"lastName": "Doe",
"companyName": "lemlist",
"jobTitle": "Developer",
"linkedinUrl": "https://www.linkedin.com/in/johndoe",
"phone": "+33 123456789",
"timezone": "Europe/Paris",
"contactOwner": "login_email@lemlist.com",
"companySize": "50-100",
"customVariable1": "any value you want"
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/leads/"
payload = {
"email": "support@lemlist.com",
"firstName": "John",
"lastName": "Doe",
"companyName": "lemlist",
"jobTitle": "Developer",
"linkedinUrl": "https://www.linkedin.com/in/johndoe",
"phone": "+33 123456789",
"timezone": "Europe/Paris",
"contactOwner": "login_email@lemlist.com",
"companySize": "50-100",
"customVariable1": "any value you want"
}
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({
email: 'support@lemlist.com',
firstName: 'John',
lastName: 'Doe',
companyName: 'lemlist',
jobTitle: 'Developer',
linkedinUrl: 'https://www.linkedin.com/in/johndoe',
phone: '+33 123456789',
timezone: 'Europe/Paris',
contactOwner: 'login_email@lemlist.com',
companySize: '50-100',
customVariable1: 'any value you want'
})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/leads/', 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}/leads/")
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 \"email\": \"support@lemlist.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"companyName\": \"lemlist\",\n \"jobTitle\": \"Developer\",\n \"linkedinUrl\": \"https://www.linkedin.com/in/johndoe\",\n \"phone\": \"+33 123456789\",\n \"timezone\": \"Europe/Paris\",\n \"contactOwner\": \"login_email@lemlist.com\",\n \"companySize\": \"50-100\",\n \"customVariable1\": \"any value you want\"\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}/leads/",
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([
'email' => 'support@lemlist.com',
'firstName' => 'John',
'lastName' => 'Doe',
'companyName' => 'lemlist',
'jobTitle' => 'Developer',
'linkedinUrl' => 'https://www.linkedin.com/in/johndoe',
'phone' => '+33 123456789',
'timezone' => 'Europe/Paris',
'contactOwner' => 'login_email@lemlist.com',
'companySize' => '50-100',
'customVariable1' => 'any value you want'
]),
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_bSn8EORHQxbWPjHvu",
"campaignName": "NEW TO DELETE",
"firstName": "John",
"lastName": "Doe",
"companyName": "lemlist",
"jobTitle": "GTM Engineer",
"companyDomain": "example.com",
"email": "support@lemlist.com",
"_id": "lea_fiDpiGV585wy3Oii2",
"isPaused": false,
"contactId": "ctc_xW8Ou6C03Csv8vatp"
}"No API key provided""The authentication you supplied is incorrect""User linked to this API key is blocked""No user found for this API key"Create Lead in Campaign
Creates a new lead and adds it to a specific campaign.
curl --request POST \
--url https://api.lemlist.com/api/campaigns/{campaignId}/leads/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "support@lemlist.com",
"firstName": "John",
"lastName": "Doe",
"companyName": "lemlist",
"jobTitle": "Developer",
"linkedinUrl": "https://www.linkedin.com/in/johndoe",
"phone": "+33 123456789",
"timezone": "Europe/Paris",
"contactOwner": "login_email@lemlist.com",
"companySize": "50-100",
"customVariable1": "any value you want"
}
'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/leads/"
payload = {
"email": "support@lemlist.com",
"firstName": "John",
"lastName": "Doe",
"companyName": "lemlist",
"jobTitle": "Developer",
"linkedinUrl": "https://www.linkedin.com/in/johndoe",
"phone": "+33 123456789",
"timezone": "Europe/Paris",
"contactOwner": "login_email@lemlist.com",
"companySize": "50-100",
"customVariable1": "any value you want"
}
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({
email: 'support@lemlist.com',
firstName: 'John',
lastName: 'Doe',
companyName: 'lemlist',
jobTitle: 'Developer',
linkedinUrl: 'https://www.linkedin.com/in/johndoe',
phone: '+33 123456789',
timezone: 'Europe/Paris',
contactOwner: 'login_email@lemlist.com',
companySize: '50-100',
customVariable1: 'any value you want'
})
};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/leads/', 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}/leads/")
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 \"email\": \"support@lemlist.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"companyName\": \"lemlist\",\n \"jobTitle\": \"Developer\",\n \"linkedinUrl\": \"https://www.linkedin.com/in/johndoe\",\n \"phone\": \"+33 123456789\",\n \"timezone\": \"Europe/Paris\",\n \"contactOwner\": \"login_email@lemlist.com\",\n \"companySize\": \"50-100\",\n \"customVariable1\": \"any value you want\"\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}/leads/",
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([
'email' => 'support@lemlist.com',
'firstName' => 'John',
'lastName' => 'Doe',
'companyName' => 'lemlist',
'jobTitle' => 'Developer',
'linkedinUrl' => 'https://www.linkedin.com/in/johndoe',
'phone' => '+33 123456789',
'timezone' => 'Europe/Paris',
'contactOwner' => 'login_email@lemlist.com',
'companySize' => '50-100',
'customVariable1' => 'any value you want'
]),
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_bSn8EORHQxbWPjHvu",
"campaignName": "NEW TO DELETE",
"firstName": "John",
"lastName": "Doe",
"companyName": "lemlist",
"jobTitle": "GTM Engineer",
"companyDomain": "example.com",
"email": "support@lemlist.com",
"_id": "lea_fiDpiGV585wy3Oii2",
"isPaused": false,
"contactId": "ctc_xW8Ou6C03Csv8vatp"
}"No API key provided""The authentication you supplied is incorrect""User linked to this API key is blocked""No user found for this API key"{{yourVariableName}}.In the example, companySize and customVariable1 are custom variables.Naming rules: only letters, digits, _, -, space and # are kept — any other character (e.g. . or $) is replaced by _. Values are stored as text.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
Query Parameters
Search email address in other campaigns. Will not insert the lead if email address already exists. Default: false
Run the LinkedIn enrichment. Default: false
Find verified email. Default: false
Verify existing email (debounce). Default: false
Find phone number. Default: false
Body
Email of the lead
First name of the lead
Last name of the lead
Company name
Job title
LinkedIn profile URL
Profile picture URL
Phone number
Company domain
Personalized icebreaker message
Lead's timezone in IANA format (e.g., Europe/Paris, America/New_York)
Contact owner (user ID or user login email)
Was this page helpful?