Skip to content

Drip Sequences Reference

Follow-up sequences (drips) are timed email to leads, owned by a brokerage and triggered by a pipeline stage. This page lists the fields and the endpoints. For how to build one and what stops it, read set up follow-up sequences.

FieldTypeNotes
idinteger
brokerage_idintegerThe owning brokerage. Non-admins are pinned to their own.
namestring, up to 120Unique per brokerage.
descriptionstring or nullFree text for the list.
trigger_stateNEW, CONTACTING, QUALIFIED, ARCHIVEDThe stage whose entry enrolls a lead.
pipeline_typebuyer, seller, or nullNull means both. Stored today; filtering on it arrives with the lead pipeline type.
activebooleanOff pauses enrollment and stops everyone currently on it (sequence_deactivated).
stop_on_state_changeboolean, default trueWhether leaving the enrolled stage ends the enrollment.
stepslist of stepsOrdered by position.
active_enrollmentsintegerRead only.
total_enrollmentsintegerRead only. Includes completed and stopped.
FieldTypeNotes
positioninteger from 1Assigned from list order on save.
delay_daysinteger, 0 to 365From enrollment for the first step, from the previous step otherwise.
subject_templatestring, up to 300Placeholders allowed.
body_templatestring, up to 20000Plain text with placeholders. The unsubscribe footer is appended at send time.

Placeholders: {{first_name}}, {{last_name}}, {{agent_name}}, {{agent_phone}}, {{agent_email}}, {{brokerage_name}}, {{brokerage_phone}}. Unknown names render as empty text. GET /api/v1/admin/drips/meta returns the current list.

Enrollments point at a step by position, not by id, so editing or reordering steps does not orphan a lead mid-sequence: the next send picks up whichever step now holds that position. Deleting the step a lead is waiting on skips to the next one that exists, or completes.

One row per lead per sequence.

FieldTypeNotes
lead_id, lead_name, lead_email
enrolled_attimestamp
enrolled_statestageThe stage the lead was in when enrolled. Compared against the current stage before every send when stop_on_state_change is on.
next_step_positioninteger or nullNull once completed or stopped.
next_send_attimestamp or nullWhen the sweep will send the next step.
statusactive, completed, stopped
stopped_reasonsee below
stopped_attimestamp or null
last_sent_attimestamp or null
send_failuresintegerConsecutive failures; reset to 0 on a successful send.
ReasonSet when
state_changedThe lead left the stage it was enrolled in and the sequence stops on stage change.
unsubscribedThe lead has the Unsubscribed flag (link or staff).
flaggedThe lead has Do Not Contact or No Email.
manualStaff clicked Stop.
sequence_deactivatedThe sequence was turned off.
send_failedThree consecutive sends failed.
no_emailThe lead has no email address.

Re-enrolling through the API or the lead page restarts a completed or stopped lead from step one with a fresh enrolled_at. An active enrollment is not restarted; the request answers 409.

The lifecycle sweep that runs inside the API about once a minute also runs the drips. Each pass sends at most one step per enrollment. Before sending, it re-derives the lead’s stage, re-reads its flags, and checks for an email address, in that order, so nothing that was set since the last pass is missed. A failed send leaves next_send_at alone and is retried on the next pass; the third consecutive failure stops the enrollment.

Emails go out from the platform sender with the assigned agent’s address as Reply-To. Every body ends with an unsubscribe line. With DRIP_UNSUBSCRIBE_SECRET (or a non-default FAVORITES_SECRET) and PUBLIC_API_URL set, the line is a link to GET /api/drips/unsubscribe/{token}, where the token is the lead id signed with the secret; visiting it sets the Unsubscribed flag with reason unsubscribe link, stops the lead’s sequences, and shows a plain confirmation page. Without those settings the line asks the reader to reply, and the run report notes that links are disabled.

All routes live under /api/v1/admin/drips and take the same bearer auth as the rest of the admin API. Brokers and owners see and edit their brokerage; agents may read; admins see every brokerage and may pass brokerage_id when listing or creating. Out-of-scope ids answer 404. Mutations by an agent answer 403.

Method and pathDoes
GET /metaTrigger stages, pipeline types, placeholders, whether unsubscribe links are enabled.
GET /?brokerage_id=List sequences with steps and enrollment counts.
POST /Create. Body: the sequence fields plus steps as an ordered list of {delay_days, subject_template, body_template}. 409 on a duplicate name.
GET /{id}One sequence.
PUT /{id}Partial update. When steps is present it replaces the whole list. Setting active: false stops current enrollments.
DELETE /{id}Deletes the sequence and its enrollments.
GET /{id}/enrollmentsEvery enrollment with lead name, status, next send. Agents see only their own leads.
POST /{id}/enrollments/{lead_id}Enroll or restart from step one. 409 if already active or the sequence has no steps.
DELETE /{id}/enrollments/{lead_id}Stop with reason manual. 404 if nothing is active.
POST /{id}/previewBody {lead_id, position?}. Returns the rendered subject and body, To, Reply-To, and whether the footer is a link. Sends nothing.
POST /run?dry_run=Admins only. Runs the drip pass now and returns the actions taken (sent, retry, stopped, completed, or would_send in a dry run).

The lead page uses GET /api/v1/admin/leads/{lead_id}/drips, which returns the lead’s enrollments, the brokerage’s active sequences it could be put on, and can_manage for the caller.