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>"
}
'import requests
url = "https://api.example.com/v1/campaigns/{id}/steps"
payload = {
"subject": "<string>",
"body": "<string>",
"delay_days": 123,
"delay_hours": 123,
"send_condition": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
subject: '<string>',
body: JSON.stringify('<string>'),
delay_days: 123,
delay_hours: 123,
send_condition: '<string>'
})
};
fetch('https://api.example.com/v1/campaigns/{id}/steps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/campaigns/{id}/steps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => '<string>',
'body' => '<string>',
'delay_days' => 123,
'delay_hours' => 123,
'send_condition' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/campaigns/{id}/steps"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"delay_days\": 123,\n \"delay_hours\": 123,\n \"send_condition\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/campaigns/{id}/steps")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"delay_days\": 123,\n \"delay_hours\": 123,\n \"send_condition\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/campaigns/{id}/steps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"delay_days\": 123,\n \"delay_hours\": 123,\n \"send_condition\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"step": {}
}
}Campaigns
Create Campaign Step
Append a new email step to a campaign sequence
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>"
}
'import requests
url = "https://api.example.com/v1/campaigns/{id}/steps"
payload = {
"subject": "<string>",
"body": "<string>",
"delay_days": 123,
"delay_hours": 123,
"send_condition": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
subject: '<string>',
body: JSON.stringify('<string>'),
delay_days: 123,
delay_hours: 123,
send_condition: '<string>'
})
};
fetch('https://api.example.com/v1/campaigns/{id}/steps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/campaigns/{id}/steps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => '<string>',
'body' => '<string>',
'delay_days' => 123,
'delay_hours' => 123,
'send_condition' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/campaigns/{id}/steps"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"delay_days\": 123,\n \"delay_hours\": 123,\n \"send_condition\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/campaigns/{id}/steps")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"delay_days\": 123,\n \"delay_hours\": 123,\n \"send_condition\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/campaigns/{id}/steps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"delay_days\": 123,\n \"delay_hours\": 123,\n \"send_condition\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"step": {}
}
}Request
Path Parameters
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
string
required
Email subject line. Supports merge variables:
{{first_name}}, {{last_name}}, {{company_name}}, {{job_title}}.string
required
Email body. Plain text or HTML.
integer
default:"0"
Days to wait after the previous step before sending this one.
integer
default:"0"
Additional hours on top of
delay_days (0–23).string
default:"always"
When to send:
always, if_no_reply, if_no_open, if_opened, if_clicked.Response
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"
}'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
CAMPAIGN_ID = "cmp_abc123"
response = requests.post(
f"{BASE_URL}/v1/campaigns/{CAMPAIGN_ID}/steps",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={
"subject": "Re: {{company_name}}",
"body": "Just circling back on my note from last week...",
"delay_days": 3,
"send_condition": "if_no_reply",
},
)
const CAMPAIGN_ID = 'cmp_abc123';
await fetch(
`https://data.leadlex.com/functions/v1/api-gateway/v1/campaigns/${CAMPAIGN_ID}/steps`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
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
| Status | Code | Description |
|---|---|---|
| 400 | missing_required_field | subject or body missing |
| 400 | invalid_send_condition | send_condition is not a recognized value |
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing campaigns:write permission |
| 404 | campaign_not_found | No campaign with this ID |
| 429 | rate_limited | Rate limit exceeded |