Add Variant to Step
curl --request POST \
--url https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"body": "<string>"
}
'import requests
url = "https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants"
payload = { "body": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({body: JSON.stringify('<string>')})
};
fetch('https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants', 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",
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([
'body' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants"
payload := strings.NewReader("{\n \"body\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body\": \"<string>\"\n}"
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
Add Variant to Step
Adds a new message variant to a step. Multiple variants enable A/B testing
POST
/
v1
/
campaigns
/
{id}
/
steps
/
{stepId}
/
variants
Add Variant to Step
curl --request POST \
--url https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"body": "<string>"
}
'import requests
url = "https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants"
payload = { "body": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({body: JSON.stringify('<string>')})
};
fetch('https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants', 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",
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([
'body' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants"
payload := strings.NewReader("{\n \"body\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app-api.walead.ai/api/v1/campaigns/{id}/steps/{stepId}/variants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body\": \"<string>\"\n}"
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
Adds a new message variant to a step, enabling A/B testing of different message approaches. Variants are only applicable tomessage and screener type steps.
What are Variants?
Variants are different versions of the same message that WaLead rotates through to test which performs better. Each variant:- Has its own message template
- Can be enabled or disabled independently
- Can have custom ICP (Ideal Customer Profile) targeting
- Includes AI tool configurations for personalization
Request Body
The request body is optional. You can create an empty variant and update it later:{
"body": "Hi {{firstName}}, I noticed you work at {{companyName}}..."
}
{}
Variant Rotation
WaLead automatically rotates through enabled variants to distribute tests evenly:- Each lead is assigned a variant based on the order
- Disabled variants are skipped
- Performance metrics are tracked per variant
Use Cases
A/B Testing Different Approaches
// Variant 1: Direct value proposition
{
"body": "Hi {{firstName}}, I help companies like {{companyName}} reduce costs by 30%..."
}
// Variant 2: Question-based approach
{
"body": "Hi {{firstName}}, are you looking for ways to optimize your team's workflow?"
}
// Variant 3: Social proof
{
"body": "Hi {{firstName}}, we've helped 100+ companies in your industry..."
}
ICP-Specific Messages
Use theicpDefinitionRaw field (via update variant) to target specific lead profiles with different messages.
Response
Returns the complete array of variants for the step, including the newly created one with its assigned ID and order.Next Steps
After creating a variant:- Update its message body if you created it empty
- Configure ICP targeting if needed
- Ensure at least one variant remains enabled
Authorizations
API key for authentication. Generate from your WaLead dashboard.
Body
application/json
Variant content (optional)
Message template body