Get Campaign Sequences
curl --request GET \
--url https://api.lemlist.com/api/campaigns/{campaignId}/sequences \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/sequences"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/sequences', 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}/sequences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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/campaigns/{campaignId}/sequences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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;
}{
"seq_rH5RD3fMkkt2gM3YC": {
"_id": "seq_rH5RD3fMkkt2gM3YC",
"steps": [
{
"_id": "stp_sFUj6keaSz9wr049M",
"delay": 0,
"emailTemplateId": "etp_ahlbc2yafFyu728H8",
"type": "linkedinSend",
"index": 1,
"sequenceId": "seq_rH5RD3fMkkt2gM3YC",
"sequenceStep": 0,
"message": "Hey {{firstName}}, \n\nwe're launching an event, a place where people can regularly meet, network, and learn from each other. We would love it if you could join us for a drink & chat next week. What do you say? 😊"
},
{
"_id": "stp_qsTl0LO6zkQQJQqsP",
"delay": 1,
"emailTemplateId": "etp_HFjUGtyDxIOxgZYcG",
"index": 2,
"sequenceId": "seq_rH5RD3fMkkt2gM3YC",
"sequenceStep": 1,
"subject": "{{firstName}}, do we count on you for the event?",
"message": "<p style=\"margin: 0px; box-sizing: border-box;\">Hey {{firstName}},<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">Do you have any plans for Thursday, 7pm?<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">What about spending the evening with cool people by our office?<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">We're launching an event, a place where people can regularly meet, network, and build connections that help them grow further 😊<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">It would be really nice if we could count on you for the event- <a target=\"_blank\" style=\"color: rgb(0, 123, 255); text-decoration: none; background-color: transparent; user-select: auto; box-sizing: border-box;\" rel=\"noopener noreferrer\" href=\"{{event_link_to_send}}\">here's your invite</a> 🔥</p><p style=\"margin: 0px; box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">Can you make it?<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">Sarah,</p><p style=\"margin: 0px; box-sizing: border-box;\">Head of Marketing</p>",
"type": "email"
},
{
"_id": "stp_pRcXzJDmOrBkFtNc3",
"delay": 1,
"emailTemplateId": "etp_3tjFTgdOMS6JL8U1g",
"index": 3,
"sequenceId": "seq_rH5RD3fMkkt2gM3YC",
"sequenceStep": 2,
"subject": "{{firstName}}, do we count on you for the event?",
"message": "<p style=\"margin: 0px; box-sizing: border-box;\">So, should I add you to the list of attendees?<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">We'll meet around 7pm, have a drink and exchange with entrepreneurs, marketers, and salespeople.<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\"><a target=\"_blank\" style=\"color: rgb(0, 123, 255); text-decoration: none; background-color: transparent; user-select: auto; box-sizing: border-box;\" rel=\"noopener noreferrer\" href=\"{{event_link_to_send}}\">Here's the link</a> if you want to join!<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">We would love to have you with us for this event!<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\">Sarah</p><p style=\"margin: 0px; box-sizing: border-box;\">Head of Marketing</p>",
"type": "email"
},
{
"_id": "stp_Ae93hiemDkypHLys2",
"delay": 2,
"index": 4,
"sequenceId": "seq_rH5RD3fMkkt2gM3YC",
"sequenceStep": 3,
"type": "conditional",
"conditions": [
{
"sequenceId": "seq_jacL5GNH3YpNnuNQ2",
"key": "customLeadInfo",
"name": "Decision makers",
"label": "If lead variable \"jobTitle\" contains \"CEO, Founder\"",
"selector": "{\"$or\":[{\"variables.jobTitle\":{\"$regex\":\"CEO\",\"$options\":\"i\"}},{\"variables.jobTitle\":{\"$regex\":\"Founder\",\"$options\":\"i\"}}]}"
},
{
"sequenceId": "seq_xzrGLxhZwoo5oxukc",
"key": "customLeadInfo",
"label": "If lead variable \"jobTitle\" contains \"CTO\"",
"selector": "{\"variables.jobTitle\":{\"$regex\":\"CTO\",\"$options\":\"i\"}}"
},
{
"sequenceId": "seq_Kd8pQrLm3Nv6Tz0Wy",
"fallback": true
}
]
}
],
"level": 0
},
"seq_jacL5GNH3YpNnuNQ2": {
"_id": "seq_jacL5GNH3YpNnuNQ2",
"steps": [
{
"_id": "stp_Tq5mWx8Rn2Kd7Yz3B",
"delay": 0,
"index": 1,
"sequenceId": "seq_jacL5GNH3YpNnuNQ2",
"sequenceStep": 0,
"type": "linkedinInvite",
"message": "Hi {{firstName}}, would love to connect ahead of the event!"
}
],
"level": 1,
"parentId": "seq_rH5RD3fMkkt2gM3YC",
"conditionalStepIndex": 4
}
}"Bad team""The authentication you supplied is incorrect""Campaign not found"Sequences
Get Campaign Sequences
Retrieves all sequences and their steps for a specific campaign.
GET
/
campaigns
/
{campaignId}
/
sequences
Get Campaign Sequences
curl --request GET \
--url https://api.lemlist.com/api/campaigns/{campaignId}/sequences \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/campaigns/{campaignId}/sequences"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/campaigns/{campaignId}/sequences', 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}/sequences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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/campaigns/{campaignId}/sequences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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;
}{
"seq_rH5RD3fMkkt2gM3YC": {
"_id": "seq_rH5RD3fMkkt2gM3YC",
"steps": [
{
"_id": "stp_sFUj6keaSz9wr049M",
"delay": 0,
"emailTemplateId": "etp_ahlbc2yafFyu728H8",
"type": "linkedinSend",
"index": 1,
"sequenceId": "seq_rH5RD3fMkkt2gM3YC",
"sequenceStep": 0,
"message": "Hey {{firstName}}, \n\nwe're launching an event, a place where people can regularly meet, network, and learn from each other. We would love it if you could join us for a drink & chat next week. What do you say? 😊"
},
{
"_id": "stp_qsTl0LO6zkQQJQqsP",
"delay": 1,
"emailTemplateId": "etp_HFjUGtyDxIOxgZYcG",
"index": 2,
"sequenceId": "seq_rH5RD3fMkkt2gM3YC",
"sequenceStep": 1,
"subject": "{{firstName}}, do we count on you for the event?",
"message": "<p style=\"margin: 0px; box-sizing: border-box;\">Hey {{firstName}},<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">Do you have any plans for Thursday, 7pm?<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">What about spending the evening with cool people by our office?<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">We're launching an event, a place where people can regularly meet, network, and build connections that help them grow further 😊<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">It would be really nice if we could count on you for the event- <a target=\"_blank\" style=\"color: rgb(0, 123, 255); text-decoration: none; background-color: transparent; user-select: auto; box-sizing: border-box;\" rel=\"noopener noreferrer\" href=\"{{event_link_to_send}}\">here's your invite</a> 🔥</p><p style=\"margin: 0px; box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">Can you make it?<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">Sarah,</p><p style=\"margin: 0px; box-sizing: border-box;\">Head of Marketing</p>",
"type": "email"
},
{
"_id": "stp_pRcXzJDmOrBkFtNc3",
"delay": 1,
"emailTemplateId": "etp_3tjFTgdOMS6JL8U1g",
"index": 3,
"sequenceId": "seq_rH5RD3fMkkt2gM3YC",
"sequenceStep": 2,
"subject": "{{firstName}}, do we count on you for the event?",
"message": "<p style=\"margin: 0px; box-sizing: border-box;\">So, should I add you to the list of attendees?<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">We'll meet around 7pm, have a drink and exchange with entrepreneurs, marketers, and salespeople.<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\"><a target=\"_blank\" style=\"color: rgb(0, 123, 255); text-decoration: none; background-color: transparent; user-select: auto; box-sizing: border-box;\" rel=\"noopener noreferrer\" href=\"{{event_link_to_send}}\">Here's the link</a> if you want to join!<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\"></p>\n<p style=\"margin: 0px; box-sizing: border-box;\">We would love to have you with us for this event!<br style=\"box-sizing: border-box;\"><br style=\"box-sizing: border-box;\">Sarah</p><p style=\"margin: 0px; box-sizing: border-box;\">Head of Marketing</p>",
"type": "email"
},
{
"_id": "stp_Ae93hiemDkypHLys2",
"delay": 2,
"index": 4,
"sequenceId": "seq_rH5RD3fMkkt2gM3YC",
"sequenceStep": 3,
"type": "conditional",
"conditions": [
{
"sequenceId": "seq_jacL5GNH3YpNnuNQ2",
"key": "customLeadInfo",
"name": "Decision makers",
"label": "If lead variable \"jobTitle\" contains \"CEO, Founder\"",
"selector": "{\"$or\":[{\"variables.jobTitle\":{\"$regex\":\"CEO\",\"$options\":\"i\"}},{\"variables.jobTitle\":{\"$regex\":\"Founder\",\"$options\":\"i\"}}]}"
},
{
"sequenceId": "seq_xzrGLxhZwoo5oxukc",
"key": "customLeadInfo",
"label": "If lead variable \"jobTitle\" contains \"CTO\"",
"selector": "{\"variables.jobTitle\":{\"$regex\":\"CTO\",\"$options\":\"i\"}}"
},
{
"sequenceId": "seq_Kd8pQrLm3Nv6Tz0Wy",
"fallback": true
}
]
}
],
"level": 0
},
"seq_jacL5GNH3YpNnuNQ2": {
"_id": "seq_jacL5GNH3YpNnuNQ2",
"steps": [
{
"_id": "stp_Tq5mWx8Rn2Kd7Yz3B",
"delay": 0,
"index": 1,
"sequenceId": "seq_jacL5GNH3YpNnuNQ2",
"sequenceStep": 0,
"type": "linkedinInvite",
"message": "Hi {{firstName}}, would love to connect ahead of the event!"
}
],
"level": 1,
"parentId": "seq_rH5RD3fMkkt2gM3YC",
"conditionalStepIndex": 4
}
}"Bad team""The authentication you supplied is incorrect""Campaign not found"
For example, if the main sequence includes a condition that contains two sequences, you will receive both the sequence tree and all condition sequences in the main sequences array.
On a step running an A/B test,
abTest and emailTemplateBId are set, but the
step’s subject and message are always variant A’s — read variant B with
Get A/B Test Variant.
Condition steps
A step of typeconditional carries its branches in conditions, in execution order with the Else
branch last. Each entry names the sub-sequence its leads walk — look that sequenceId up as a key of
this same response to read the branch’s own steps.
| Field | Description |
|---|---|
sequenceId | The branch’s sub-sequence id: the key to look up here, and the branch’s address on the branch endpoints |
key | The condition the step tests. Every branch shares it; absent on the Else branch |
label | The server-stamped description of what is tested, e.g. If lead variable "jobTitle" contains "CEO". On a step with several branches it doubles as the branch’s name when name is unset |
name | The name someone gave the branch, when they gave one. The “Branch 1”, “Branch 2”, … and “Else” labels lemlist displays are not stored |
fallback | true on the Else branch, which catches every lead no other branch matched and always comes last |
delay, delayType | The time window a lead-action condition waits on, in days. Present instead of selector once hydrated |
selector | The raw stored selector, as JSON. customLeadInfo and hasEmailAddress keep it, since they carry no time window |
A branch whose
delay was hydrated has no selector left, so what it actually tests is not in
this response at all — a hasScore branch shows its window but not its score band, an aircallDone
branch not its call statuses.GET /sequences/{sequenceId}/steps/{stepId}/branches
returns the same branches with everything decoded into parameters (customField, customOperator,
customValues, scoreComparator, scoreThreshold, emailStatusFilter, callStatusFilter,
delay, delayType) instead of a raw Mongo fragment. Use it whenever you need to read or edit what
a branch tests.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
Response
Success
Object where each key is a sequence ID and each value is a sequence object
Show child attributes
Show child attributes
Was this page helpful?