Delete Condition Branch
curl --request DELETE \
--url https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId}', 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/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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;
}{
"ok": true,
"removedSequenceIds": [
"seq_xzrGLxhZwoo5oxukc"
]
}{
"error": "A condition step must keep at least one branch",
"code": "SEQUENCE_BRANCH_LAST_NOT_REMOVABLE"
}"The authentication you supplied is incorrect""route is available starting emailPro plan"{
"error": "Condition branches are not enabled for this team",
"code": "SEQUENCE_BRANCH_BETA_REQUIRED"
}{
"error": "No branch with this sequenceId on this step",
"code": "SEQUENCE_BRANCH_NOT_FOUND"
}{
"error": "You cannot add, remove or reorder branches once leads have entered the campaign",
"code": "SEQUENCE_BRANCH_CAMPAIGN_RUNNING"
}Sequences
Delete Condition Branch
Removes a branch and the sub-tree behind it.
DELETE
/
sequences
/
{sequenceId}
/
steps
/
{stepId}
/
branches
/
{branchSequenceId}
Delete Condition Branch
curl --request DELETE \
--url https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId}', 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/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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/sequences/{sequenceId}/steps/{stepId}/branches/{branchSequenceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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;
}{
"ok": true,
"removedSequenceIds": [
"seq_xzrGLxhZwoo5oxukc"
]
}{
"error": "A condition step must keep at least one branch",
"code": "SEQUENCE_BRANCH_LAST_NOT_REMOVABLE"
}"The authentication you supplied is incorrect""route is available starting emailPro plan"{
"error": "Condition branches are not enabled for this team",
"code": "SEQUENCE_BRANCH_BETA_REQUIRED"
}{
"error": "No branch with this sequenceId on this step",
"code": "SEQUENCE_BRANCH_NOT_FOUND"
}{
"error": "You cannot add, remove or reorder branches once leads have entered the campaign",
"code": "SEQUENCE_BRANCH_CAMPAIGN_RUNNING"
}New to condition branches? Start with
List Condition Branches, which explains
how a step branches and how a branch is addressed.
This deletes the branch’s whole sub-tree — its sub-sequence, its steps, and every sequence only
reachable through it, however deep. It cannot be undone.
removedSequenceIds lists exactly what was deleted alongside the branch entry. A sequence another
step still points at is left alone, so the list can be shorter than the sub-tree you walked, and it
is empty when the branch held no steps of its own.
What is refused
| Case | Response |
|---|---|
| The Else branch | 400 SEQUENCE_BRANCH_IS_FALLBACK — a condition step always keeps its fallback |
| The step’s last branch besides Else | 400 SEQUENCE_BRANCH_LAST_NOT_REMOVABLE — delete the whole step instead |
| Leads have entered the campaign | 409 SEQUENCE_BRANCH_CAMPAIGN_RUNNING |
| A lead is sitting anywhere inside the sub-tree | 409 SEQUENCE_BRANCH_CAMPAIGN_RUNNING |
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 sequence holding the condition step
The unique identifier of the condition step, from GET /campaigns/{campaignId}/sequences
The branch's own sub-sequence id, from GET /sequences/{sequenceId}/steps/{stepId}/branches. A branch is never addressed by its position.
Was this page helpful?