Saasco logoSaasco logo
Saasco logoSaasco logo

Introduction

OverviewGetting startedAgent setupWhat is Saasco?

SDK

Quick startTrackingIdentifyConfigurationWidgetsProperties

MCP

Quick startHow it worksAuthorizationTool reference
Skills for agents

REST API

Quick start
getList Email CampaignsgetGet Email CampaignpostCreate Email CampaignputUpdate Email CampaignpostDuplicate Email CampaigndelDelete Email CampaignpostSend Email CampaignpostResume Sending Email CampaignpostStop Sending Email CampaignpostSend Test EmailgetCount Campaign EmailsgetGet Email StatspostCreate Campaign VariationdelDelete Campaign VariationputUpdate Campaign Message
Transactional Emails
Email MarketingCampaigns

Create Campaign Variation

View as MarkdownAgent setup

Adds a variation to a draft or paused campaign. The new variation copies the first one, then applies changes. Same content fields as Update Campaign Message, including subjectHTML, subjectJSON, bodyHTML, bodyJSON, previewTextHTML, and previewTextJSON. A second variation on a STANDARD campaign sets the type to AB_TEST. Returns the variation and a permalink that opens the message step in the editor.

POST
/projects/{projectId}/email-campaigns/{campaignId}/variations

Authorization

Authorization
AuthorizationBearer <token>

In: header

Path Parameters

projectIdrequiredstring

Project that owns the campaign.

campaignIdrequiredstring

Campaign that receives the variation. emailMarketing_createEmailCampaign.id or emailMarketing_listEmailCampaigns[].id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

changesobject

Content for the new variation. Same fields as emailMarketing_updateCampaignMessage changes: subjectHTML, subjectJSON, bodyHTML, bodyJSON, previewTextHTML, previewTextJSON, text, fromName, fromEmailUsername, fromDomain, replyTo, cc, bcc, label, scheduledAt, and theme. Omitted fields are copied from the first variation. bodyHTML must be an HTML fragment.

bccstring | null
bodyHTMLstring
ccstring | null
fromDomainstring
fromEmailUsernamestring
fromNamestring
labelstring
previewTextHTMLstring
replyTostring | null
scheduledAtstring | null

When to send this message, as an ISO 8601 timestamp with a timezone offset. Null clears it.

subjectHTMLstring
textstring
themeobject | null
bodyJSONobject
previewTextJSONobject
subjectJSONobject

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/projects/string/email-campaigns/string/variations" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "createdAt": "string",  "updatedAt": "string",  "projectId": "string",  "emailCampaignId": "string",  "label": "string",  "fromName": "string",  "fromEmailUsername": "string",  "fromDomain": "string",  "bcc": "string",  "cc": "string",  "replyTo": "string",  "text": "string",  "subjectHTML": "string",  "previewTextHTML": "string",  "bodyHTML": "string",  "scheduledAt": "string",  "sentAt": "string",  "lastSuccessContactId": "string",  "lastSuccessContactCreatedAt": "string",  "bodyJSON": {    "property1": null,    "property2": null  },  "previewTextJSON": {    "property1": null,    "property2": null  },  "sendCount": 0,  "subjectJSON": {    "property1": null,    "property2": null  },  "theme": {    "body": {      "align": "left",      "background": "string",      "container": "string"    },    "button": {      "background": "string",      "borderColor": "string",      "borderSize": 0,      "color": "string",      "radius": 0    },    "link": {      "color": "string"    },    "template": "string",    "typography": {      "h1": {        "color": "string",        "fontSize": 0,        "lineHeight": 0      },      "h2": {        "color": "string",        "fontSize": 0,        "lineHeight": 0      },      "h3": {        "color": "string",        "fontSize": 0,        "lineHeight": 0      },      "p": {        "color": "string",        "fontSize": 0,        "lineHeight": 0      }    }  },  "permalink": "string"}

Get Email Stats

Aggregate delivery and engagement figures for one campaign: sent, delivered, opened, clicked, bounced, complained, and delivery-delayed. Each comes back as a raw `total`, a `unique` count that collapses repeat events from the same recipient, and a `rate`, so open rate is not just opens divided by sends. For the per-recipient breakdown behind these numbers use List Emails.

Delete Campaign Variation

Deletes one variation from a draft or paused campaign. The campaign must keep at least one variation. Deleting the last extra variation on an AB_TEST campaign sets the type back to STANDARD. Returns a permalink that opens the message step in the editor.