Skip to main content
GET
List Condition Branches

How a condition step branches

A condition step (type: "conditional") holds an ordered list of branches. Each branch owns a sub-sequence — the steps a lead walks once it matches — and the last entry is the Else branch, which catches every lead no other branch matched. Order is execution priority: lemlist tests the branches top to bottom and the first match wins. The Else branch always runs last and is never part of that race. A branch is addressed by its sequenceId, never by its position. A reorder moves positions around; the sub-sequence id is what the runtime routes leads to, and what every branch endpoint takes as its branchSequenceId. That same id is also the one you pass to POST /sequences/{sequenceId}/steps to put steps inside the branch.

Reading a branch

The key is the condition the step tests — every branch of a step shares it, so a branch never carries a condition of its own. What differs from one branch to the next is the value it tests, returned as structured parameters rather than as a raw Mongo selector: selector comes back only when none of those could describe the branch — an unknown or hand-written shape. Everything else is expressed as parameters you can send straight back to the write endpoints.
customValues is an array because a customLeadInfo branch may test several values: it matches when any one of them does. The write endpoints currently take a single customValue; a branch testing several values is built from the lemlist campaign editor.

Names

name is the name someone gave the branch, and it is only present when someone did. lemlist labels the unnamed branches “Branch 1”, “Branch 2”, … by rank, and the last one “Else” — those defaults are display copy, not stored data, so this endpoint does not invent them for you.

Access

Reading branches is open to everyone. Writing them — add, rename, re-select, reorder, delete — is in closed beta and answers 403 unless the beta is enabled for your team.

Editing a running campaign

Once leads have entered the campaign, lemlist locks the part of the tree they walk. Adding, removing and reordering branches, and changing what a branch tests, are then refused with 409 SEQUENCE_BRANCH_CAMPAIGN_RUNNING — re-routing live leads would strand those already sent down the old path. Two things stay editable on a running campaign:
  • renaming a branch, which never re-routes anyone;
  • the delay value of a lead-action condition (hasScore, aircallDone) — how long it waits, not what it waits for. Changing delayType, or anything else about the selector, still locks.
Deleting a branch has one further guard: it is refused while any lead sits anywhere inside the branch’s sub-tree, checked before anything is written.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

sequenceId
string
required

The unique identifier of the sequence holding the condition step

stepId
string
required

The unique identifier of the condition step, from GET /campaigns/{campaignId}/sequences

Response

The step's branches, ordered.

sequenceId
string

The branch's sub-sequence id, and its address on every branch endpoint. Pass it to POST /sequences/{sequenceId}/steps to add steps inside the branch.

index
integer

Execution rank among the non-fallback branches, starting at 0. The first branch whose test matches takes the lead. Absent on the Else branch, which always runs last.

fallback
boolean

true on the Else branch - the one that catches every lead no other branch matched. Absent on the others.

key
string

The condition the step tests. Every branch of a step shares it: a branch never carries a condition of its own.

name
string

The branch's display name, present only when someone has set one. lemlist labels the unnamed ones "Branch 1", "Branch 2", … and "Else"; those defaults are not stored and are not returned here.

delay
integer

Length of the time window the condition waits on the lead's action, in days. Only on the lead-action conditions that store one.

delayType
enum<string>

How the condition waits: within branches once the window is over, waitUntil parks the lead until the action happens, with no time bound.

Available options:
within,
waitUntil
scoreComparator
enum<string>

hasScore only - how the lead's score is compared to scoreThreshold.

Available options:
$gte,
$lt
scoreThreshold
integer

hasScore only - the score this branch tests against.

emailStatusFilter
enum<string>[]

hasEmailAddress only - the email statuses this branch matches.

Available options:
deliverable,
risky,
undeliverable,
unverified
callStatusFilter
string[]

aircallDone only - the call-status keys this branch matches.

customField
string

customLeadInfo only - the tested field, normalized: a lead variable reads back as variables.<name>, a contact field as fields.<name>. Every branch of the step tests the same field.

customOperator
enum<string>

customLeadInfo only - how the field is compared to the tested values.

Available options:
equal,
contains,
empty,
notEmpty
customValues
string[]

customLeadInfo only - every value this branch tests; the branch matches when any of them does. Empty for the empty and notEmpty operators.

selector
string

The raw stored condition selector, as JSON. Returned only when none of the fields above could describe the branch.