Update Campaign Step
curl --request PATCH \
--url https://api.example.com/v1/campaigns/{id}/steps/{step_id} \
--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/{step_id}"
payload = {
"subject": "<string>",
"body": "<string>",
"delay_days": 123,
"delay_hours": 123,
"send_condition": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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/{step_id}', 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/{step_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{step_id}"
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("PATCH", 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.patch("https://api.example.com/v1/campaigns/{id}/steps/{step_id}")
.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/{step_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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
Update Campaign Step
Modify an existing step’s content or timing
PATCH
/
v1
/
campaigns
/
{id}
/
steps
/
{step_id}
Update Campaign Step
curl --request PATCH \
--url https://api.example.com/v1/campaigns/{id}/steps/{step_id} \
--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/{step_id}"
payload = {
"subject": "<string>",
"body": "<string>",
"delay_days": 123,
"delay_hours": 123,
"send_condition": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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/{step_id}', 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/{step_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{step_id}"
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("PATCH", 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.patch("https://api.example.com/v1/campaigns/{id}/steps/{step_id}")
.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/{step_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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)
string
required
The step’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. All body fields are optional — include only fields you want to change.Body Parameters
string
Email subject line
string
Email body
integer
Days to wait after previous step
integer
Additional hours (0–23)
string
always, if_no_reply, if_no_open, if_opened, or if_clickedUpdating a step only affects future sends. Contacts who have already received this step under the previous configuration are unaffected.
Response
curl -X PATCH https://data.leadlex.com/functions/v1/api-gateway/v1/campaigns/cmp_abc123/steps/step_2 \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"delay_days": 5}'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
CAMPAIGN_ID = "cmp_abc123"
STEP_ID = "step_2"
response = requests.patch(
f"{BASE_URL}/v1/campaigns/{CAMPAIGN_ID}/steps/{STEP_ID}",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={"delay_days": 5},
)
const CAMPAIGN_ID = 'cmp_abc123';
const STEP_ID = 'step_2';
await fetch(
`https://data.leadlex.com/functions/v1/api-gateway/v1/campaigns/${CAMPAIGN_ID}/steps/${STEP_ID}`,
{
method: 'PATCH',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({ delay_days: 5 }),
}
);
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": 5,
"delay_hours": 0,
"send_condition": "if_no_reply"
}
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_send_condition | Unrecognized send_condition |
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing campaigns:write permission |
| 404 | campaign_not_found | No campaign with this ID |
| 404 | step_not_found | No step with this ID in the campaign |
| 429 | rate_limited | Rate limit exceeded |