curl --request PATCH \
--url https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "New subject B",
"message": "<div>New body B</div>"
}
'import requests
url = "https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test"
payload = {
"subject": "New subject B",
"message": "<div>New body B</div>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({subject: 'New subject B', message: '<div>New body B</div>'})
};
fetch('https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"New subject B\",\n \"message\": \"<div>New body B</div>\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test",
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' => 'New subject B',
'message' => '<div>New body B</div>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"stepId": "stp_V0JHmSpWiO0rxHUkz",
"abTest": true,
"emailTemplateBId": "etp_9aZ2k1QwErTyUiOp3",
"subject": "Quick question, {{firstName}}",
"message": "<div>Hi {{firstName}}, ...</div>"
}{
"error": "The premium invitation note must not exceed 300 characters",
"code": "SEQUENCE_AB_ALT_MESSAGE_TOO_LONG"
}The authentication you supplied is incorrectroute is available starting emailPro plan{
"error": "No A/B test variant on this step",
"code": "SEQUENCE_AB_NO_VARIANT"
}{
"error": "Bad method"
}Update A/B Test Variant
Edits variant B content and config of the A/B test on a step.
curl --request PATCH \
--url https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "New subject B",
"message": "<div>New body B</div>"
}
'import requests
url = "https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test"
payload = {
"subject": "New subject B",
"message": "<div>New body B</div>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({subject: 'New subject B', message: '<div>New body B</div>'})
};
fetch('https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"New subject B\",\n \"message\": \"<div>New body B</div>\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/sequences/{sequenceId}/steps/{stepId}/ab-test",
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' => 'New subject B',
'message' => '<div>New body B</div>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"stepId": "stp_V0JHmSpWiO0rxHUkz",
"abTest": true,
"emailTemplateBId": "etp_9aZ2k1QwErTyUiOp3",
"subject": "Quick question, {{firstName}}",
"message": "<div>Hi {{firstName}}, ...</div>"
}{
"error": "The premium invitation note must not exceed 300 characters",
"code": "SEQUENCE_AB_ALT_MESSAGE_TOO_LONG"
}The authentication you supplied is incorrectroute is available starting emailPro plan{
"error": "No A/B test variant on this step",
"code": "SEQUENCE_AB_NO_VARIANT"
}{
"error": "Bad method"
}Request Body
| Field | Type | Description |
|---|---|---|
subject | string | Variant B subject. An empty string removes it: variant B then replies in the thread of the previous email sent to the lead in this campaign, like variant A would |
message | string | Variant B body (HTML) |
altMessage | string | Variant B’s LinkedIn note, same meaning as the step-level altMessage: the premium invitation note on a linkedinInvite step, the out-of-network note on a linkedinSend one. Over 300 characters on an invite is rejected with 400 |
altMessagePremium | string | Variant B’s premium variant of the out-of-network note, on linkedinSend steps only. Any other step type is rejected with 400, and so is a value over 300 characters |
cc | array of strings | CC recipients |
plainText | boolean | Send as plain text |
400. An empty message is also
rejected with 400, except on LinkedIn invite steps where it means “invite
without a note”.
If the step does not run an A/B test, the endpoint returns 404.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The unique identifier of the sequence
The unique identifier of the step
Body
Variant B subject. An empty string removes it: variant B then replies in the thread of the previous email sent to the lead in this campaign, like variant A would.
Variant B body (HTML). An empty string is rejected, except on LinkedIn invite steps where it means "invite without a note"
Variant B's LinkedIn note, same meaning as the step-level altMessage: the premium invitation note on a linkedinInvite step, the out-of-network note on a linkedinSend one. On a linkedinInvite step, over 300 characters is rejected with 400
Variant B's premium variant of the out-of-network note, on linkedinSend steps only: any other step type is rejected with 400. Over 300 characters is rejected with 400 too
Response
Variant B updated
Email template ID of variant B
Variant B subject
Variant B body (HTML)
Variant B's LinkedIn note, same meaning as the step-level altMessage: the premium invitation note on a linkedinInvite step, the out-of-network note on a linkedinSend one
Variant B's premium variant of the out-of-network note, on linkedinSend steps only
Was this page helpful?