Delete Campaign Step
curl --request DELETE \
--url https://api.example.com/v1/campaigns/{id}/steps/{step_id}import requests
url = "https://api.example.com/v1/campaigns/{id}/steps/{step_id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
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 => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/campaigns/{id}/steps/{step_id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/v1/campaigns/{id}/steps/{step_id}")
.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::Delete.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"deleted": true,
"id": "<string>"
}
}Campaigns
Delete Campaign Step
Remove a step from a campaign sequence
DELETE
/
v1
/
campaigns
/
{id}
/
steps
/
{step_id}
Delete Campaign Step
curl --request DELETE \
--url https://api.example.com/v1/campaigns/{id}/steps/{step_id}import requests
url = "https://api.example.com/v1/campaigns/{id}/steps/{step_id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
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 => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/campaigns/{id}/steps/{step_id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/v1/campaigns/{id}/steps/{step_id}")
.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::Delete.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"deleted": true,
"id": "<string>"
}
}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
Requires an API key with the
campaigns:write permission.Subsequent step indexes are compacted after deletion — a step previously at index 3 becomes index 2. Contacts currently between steps may skip the deleted step. If you want to preserve history, pause the campaign first.
Response
curl -X DELETE https://data.leadlex.com/functions/v1/api-gateway/v1/campaigns/cmp_abc123/steps/step_2 \
-H "Authorization: Bearer wbk_your_api_key_here"
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.delete(
f"{BASE_URL}/v1/campaigns/{CAMPAIGN_ID}/steps/{STEP_ID}",
headers={"Authorization": f"Bearer {API_KEY}"},
)
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: 'DELETE',
headers: { 'Authorization': 'Bearer wbk_your_api_key_here' },
}
);
Example Response
{
"data": {
"deleted": true,
"id": "step_2"
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 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 |