Delete Variant
curl --request DELETE \
--url https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId} \
--header 'x-api-key: <api-key>'import requests
url = "https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}', 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://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"variants": [
{
"id": "<string>",
"body": "<string>",
"order": 123,
"isDisabled": true,
"icpDefinitionRaw": "<string>",
"stepId": "<string>",
"aiTools": [
{
"name": "<string>",
"key": "<string>"
}
]
}
]
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}Sequences
Delete Variant
Removes a message variant from a step
DELETE
/
v1
/
campaigns
/
{id}
/
steps
/
{stepId}
/
variants
/
{variantId}
Delete Variant
curl --request DELETE \
--url https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId} \
--header 'x-api-key: <api-key>'import requests
url = "https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}', 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://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants/{variantId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"variants": [
{
"id": "<string>",
"body": "<string>",
"order": 123,
"isDisabled": true,
"icpDefinitionRaw": "<string>",
"stepId": "<string>",
"aiTools": [
{
"name": "<string>",
"key": "<string>"
}
]
}
]
}{
"statusCode": 123,
"message": "<string>"
}{
"statusCode": 123,
"message": "<string>"
}Overview
Permanently removes a message variant from a step. Use this to clean up underperforming variants or simplify your A/B testing rotation.When to Delete a Variant
- Underperforming messages: Remove variants that consistently get lower response rates
- Completed tests: After determining a winner in your A/B test
- Simplifying rotation: Reduce the number of variants for more focused testing
- Strategy changes: Remove messages that no longer align with your campaign goals
What Happens
- The variant is permanently deleted
- The variant order may be adjusted for remaining variants
- Future leads won’t receive this variant
- Historical data is preserved in analytics
Response
Returns the updated array of variants for the step, showing the remaining active variants.Important Considerations
This action cannot be undone. The variant and its configuration are permanently removed.
Minimum Variants: If this is the only variant for a step, consider either:
- Adding a new variant before deleting this one
- Deleting the entire step instead
Impact on Analytics
- Leads who already received this variant remain in the analytics
- Performance metrics for this variant are preserved
- New leads will be assigned to remaining variants
Alternative: Disable Instead of Delete
If you’re not sure whether to permanently remove a variant, consider using the Update Variant endpoint to disable it instead:{
"isDisabled": true
}
- Preserve the variant for future use
- Keep all historical data and configuration
- Re-enable it later if needed
Best Practices
- Analyze first: Review variant performance before deleting
- Document why: Keep notes on why variants were removed
- Gradual refinement: Remove variants one at a time and monitor impact
- Backup content: Save successful message templates for future campaigns
Authorizations
API key for authentication. Generate from your WaLead dashboard.
Path Parameters
Campaign ID
Step ID
Variant ID