End Lead
curl --request POST \
--url https://api.lemlist.com/api/leads/end/{leadIdOrEmail} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/leads/end/{leadIdOrEmail}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/leads/end/{leadIdOrEmail}', 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/leads/end/{leadIdOrEmail}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/leads/end/{leadIdOrEmail}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"leadId": "lea_8xJSc7sV7ggpiVnXe",
"campaignId": "cam_A1B2C3D4E5F6G7H8I9",
"status": "ended"
}
}{
"error": "Route bad request",
"code": "ROUTE_BAD_REQUEST"
}{
"error": "Lead not found",
"code": "LEAD_NOT_FOUND"
}{
"error": "This lead is not launched yet, so it cannot be ended. Delete it from the campaign instead.",
"code": "LEAD_END_NOT_LAUNCHED"
}Leads
End Lead
Ends a lead in one campaign, as “Stop lead” does in the lemlist app.
POST
/
leads
/
end
/
{leadIdOrEmail}
End Lead
curl --request POST \
--url https://api.lemlist.com/api/leads/end/{leadIdOrEmail} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/leads/end/{leadIdOrEmail}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/leads/end/{leadIdOrEmail}', 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/leads/end/{leadIdOrEmail}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/leads/end/{leadIdOrEmail}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"leadId": "lea_8xJSc7sV7ggpiVnXe",
"campaignId": "cam_A1B2C3D4E5F6G7H8I9",
"status": "ended"
}
}{
"error": "Route bad request",
"code": "ROUTE_BAD_REQUEST"
}{
"error": "Lead not found",
"code": "LEAD_NOT_FOUND"
}{
"error": "This lead is not launched yet, so it cannot be ended. Delete it from the campaign instead.",
"code": "LEAD_END_NOT_LAUNCHED"
}The lead leaves the campaign’s sequence, its pending steps are dropped and its
opportunities are deleted. An end cannot be undone: resuming the lead does not
bring it back.
campaignIdis required: one call ends the lead in one campaign only.- A paused lead is ended too.
- A lead already ended answers
already_endedand nothing changes. - A lead not launched yet (imported, or waiting for review) answers
409: delete it from the campaign instead.
Authorizations
Was this page helpful?