Skip to content

Write Split Test Variant

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

Writes internal name, subject and preheader of one test variant of a split test campaign, addressed by its email ID as get-newsletter lists it in splitTestVariants, and returns the test with all variants. This is the only place a variant's subject can be set; update-newsletter-draft refuses a split test. Writing subject or preheader invalidates every contentRevision read from this variant. Omitted arguments keep their value, a call without any change is refused, and a started test refuses the write. The body of a variant is written by the block tools through its editorUrl, the test settings through configure-newsletter-split-test. Nothing is sent.

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 }