Campaign Steps
Steps make up a campaign's sequence. Contacts move through the steps in position order.
Step types
type | settings | Description |
|---|---|---|
email | template_id, or both subject and body | Sends an email. Use {{first_name}}-style variables. |
delay | delay_value (integer ≥ 1), delay_unit (minutes, hours, days, weeks) | Waits before the next step |
condition | condition_type (opened, clicked, replied) | Branches the sequence. Child steps set parent_step_id to this step and set branch to true or false. |
The step object
json
{
"id": 3,
"campaign_id": 12,
"type": "email",
"position": 0,
"settings": { "subject": "Hi {{first_name}}", "body": "<p>...</p>" },
"created_at": "...",
"updated_at": "..."
}Endpoints
Each step is identified by {step}, the step's ID.
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /campaigns/{id}/steps | campaigns:read | Every step, sorted by position (not paginated) |
| POST | /campaigns/{id}/steps | campaigns:write | Add a step |
| POST | /campaigns/{id}/steps/bulk-update | campaigns:write | Replace the whole sequence |
| POST | /campaigns/{id}/steps/reorder | campaigns:write | Change the positions |
| GET | /campaigns/{id}/steps/{step} | campaigns:read | Get a step |
| PUT | /campaigns/{id}/steps/{step} | campaigns:write | Update a step |
| DELETE | /campaigns/{id}/steps/{step} | campaigns:write | Delete a step. Returns 204, and the steps after it move up one position. |
Add a step
json
{
"type": "delay",
"position": 1,
"settings": { "delay_value": 2, "delay_unit": "days" }
}| Field | Rules |
|---|---|
type | Required. email, delay or condition |
position | Integer ≥ 0. Defaults to after the last step |
parent_step_id | A condition step in the same campaign |
branch | true or false: which outcome of the parent condition this step follows |
settings | Depends on type. See step types. |
201: { "data": Step }
Replace the sequence
POST /campaigns/{id}/steps/bulk-updateDeletes every existing step and creates the ones you send. Positions follow the array order, starting at 0.
json
{
"steps": [
{ "type": "email", "settings": { "template_id": 7 } },
{ "type": "delay", "settings": { "delay_value": 3, "delay_unit": "days" } },
{ "type": "email", "settings": { "subject": "Follow-up", "body": "<p>...</p>" } }
]
}201: { "data": [Step], "message": "Workflow created successfully", "count": 3 }
WARNING
Pause the campaign before you replace the steps of an active campaign.
Reorder
json
{ "steps": [ { "id": 5, "position": 0 }, { "id": 3, "position": 1 } ] }200: { "data": { "message": "Steps reordered successfully" } }
Update a step
PUT /campaigns/{id}/steps/{step} takes the same fields as create, and every field is optional. When you send settings, it replaces the step's whole settings object.