Skip to content

Write Split Test Variant

Tool name: update-newsletter-split-test-variant

Updates one email newsletter split-test variant's internal name, subject or preheader by emailId. This is where a variant's subject is set; its body uses the email editor. Omitted values stay unchanged. Changing subject or preheader invalidates earlier contentRevision values. Refused after the test starts; sends nothing.

Input schema

campaignIdinteger, >= 1required

ID of the split test campaign the variant belongs to

emailIdinteger, >= 1required

Email ID of the variant to write, as get-newsletter returns it in splitTestVariants

namenull or string, <= 250 characters

New internal name of this variant, never sent to a recipient; omit to keep the current one

Default:null
subjectnull or string, <= 998 characters

New subject line of this variant, without HTML; ask the user, never invent one. Invalidates the variant's contentRevision

Default:null
preheadernull or string, <= 120 characters

New inbox preview line of this variant, at most 120 characters, without HTML; empty string removes it, omit keeps it

Default:null
accountIdnull or integer, >= 1

User ID of the account; omit for the account the access token works in

Default:null
Input example
{ "campaignId": 1, "emailId": 1, "name": null, "subject": null, "preheader": null, "accountId": null }

Output schema

accountIdintegerrequired
newsletterIdintegerrequired
variantsArray of objectsrequired
variantCountintegerrequired
needsMoreVariantsbooleanrequired
sharePerVariantPercentintegerrequired
testSizePercentintegerrequired
testDurationHoursintegerrequired
winnerBystring or nullrequired
hasStartedbooleanrequired
Output example
{ "accountId": 0, "newsletterId": 0, "variants": [ { "emailId": 0, "label": "string", "name": "string", "subject": "string", "editorUrl": "string", "contentRevision": "string" } ], "variantCount": 0, "needsMoreVariants": true, "sharePerVariantPercent": 0, "testSizePercent": 0, "testDurationHours": 0, "winnerBy": "string", "hasStarted": true }