Skip to main content
POST
/
v1
/
campaigns
/
{id}
/
steps
Create Campaign Step
curl --request POST \
  --url https://api.example.com/v1/campaigns/{id}/steps \
  --header 'Content-Type: application/json' \
  --data '
{
  "subject": "<string>",
  "body": "<string>",
  "delay_days": 123,
  "delay_hours": 123,
  "send_condition": "<string>"
}
'
{
  "data": {
    "step": {}
  }
}

Request

Path Parameters

id
string
required
The campaign’s unique ID (UUID)

Headers

Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Requires an API key with the campaigns:write permission. New steps are appended to the end of the sequence. Fires the campaign.step_created webhook event.

Body Parameters

subject
string
required
Email subject line. Supports merge variables: {{first_name}}, {{last_name}}, {{company_name}}, {{job_title}}.
body
string
required
Email body. Plain text or HTML.
delay_days
integer
default:"0"
Days to wait after the previous step before sending this one.
delay_hours
integer
default:"0"
Additional hours on top of delay_days (0–23).
send_condition
string
default:"always"
When to send: always, if_no_reply, if_no_open, if_opened, if_clicked.

Response

data
object
curl -X POST https://data.leadlex.com/functions/v1/api-gateway/v1/campaigns/cmp_abc123/steps \
  -H "Authorization: Bearer wbk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Re: {{company_name}}",
    "body": "Just circling back on my note from last week...",
    "delay_days": 3,
    "send_condition": "if_no_reply"
  }'

Example Response

{
  "data": {
    "step": {
      "id": "step_2",
      "index": 1,
      "subject": "Re: {{company_name}}",
      "body": "Just circling back on my note from last week...",
      "delay_days": 3,
      "delay_hours": 0,
      "send_condition": "if_no_reply",
      "created_at": "2026-04-17T14:30:00Z"
    }
  }
}

Errors

StatusCodeDescription
400missing_required_fieldsubject or body missing
400invalid_send_conditionsend_condition is not a recognized value
401invalid_keyInvalid or expired API key
403insufficient_permissionsMissing campaigns:write permission
404campaign_not_foundNo campaign with this ID
429rate_limitedRate limit exceeded