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 StatspostCancel Scheduled Email CampaignpostCreate Campaign VariationdelDelete Campaign VariationgetGet Email Stats by ProviderputUpdate Campaign Message
Transactional Emails
Email MarketingCampaigns

Update Email Campaign

View as MarkdownAgent setup

Updates a campaign's settings. Despite the PUT, only the fields present in changes are written. Anything omitted keeps its current value. Editing a campaign that has already sent changes future behaviour only; it does not alter or resend emails already delivered.

PUT
/projects/{projectId}/email-campaigns/{campaignId}

Authorization

Authorization
AuthorizationBearer <token>

In: header

Path Parameters

projectIdrequiredstring

ID of the project that owns the campaign.

campaignIdrequiredstring

ID of the campaign to update.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

changesrequiredobject

Fields to change. Anything omitted is left as-is.

abTestConfigobject | null
contactListIdstring | null
contactsFilterGroupsarray<object>
filtersrequiredarray<object>

Attribute conditions, combined with oneDayEventFilters by groupType.

attributeDistinctIdrequiredstring

Contact attribute distinct id to filter on.

attributeTypestring

Attribute type. Defaults to string when omitted.

Default: "string"Value in: "string" | "number" | "boolean" | "date" | "url" | "email"
operatorrequiredstring

Comparison operator for the attribute value.

Value in: "equals" | "contains" | "notEquals" | "notContains" | "gt" | "gte" | "lt" | "lte" | "on" | "since" | "before" | "between" | "last"
valuerequiredstring

Value to compare the attribute against.

oneDayEventFiltersarray<object>

Event conditions over a rolling 24 hour window (not configurable). Each one is a condition in the group alongside filters, so AND, OR, and NOT apply to both. Used the same way by CRM lists, campaign audiences, workflow entry filters, and Audience Filter steps.

eventNamerequiredstring

Analytics event name from analytics_queryEvents with groupBy action, or Sent email, Delivered email, Opened email, Clicked email, Bounced email, Complained email, or Suppressed email. Those seven read email activity for the same 24 hour window, not analytics.

operatorrequiredstring

performed: the contact has at least one event with this name in the last 24 hours. notPerformed: a contact in the project with no such event in the last 24 hours, including contacts with no events at all.

Value in: "performed" | "notPerformed"
groupTyperequiredstring

How the conditions in filters and oneDayEventFilters combine: AND all true, OR any true, NOT none true.

Value in: "AND" | "OR" | "NOT"
requireSubscribedboolean

When true, the group is ANDed with $subscribed == true. Set by email sending, not the filter UI.

requireUnvalidatedEmailboolean

When true, the group is ANDed with $emailValidated != true. Set by email validation, not the filter UI. The user's AND, OR, and NOT are unchanged.

sunsetAfterSendsobject

Sunset rules by mailbox provider. A contact at a listed provider who has been sent that many campaign emails since they last opened or clicked is excluded. Set by email sending, not the filter UI.

namestring
sendOrderByPropertyobject | null
utmConfigobject | null
workflowIdstring | null
workflowStepIdstring | null
sendingTargetDurationMsinteger | null
bccstring | null
bodyHTMLstring
ccstring | null
fromDomainstring
fromEmailUsernamestring
fromNamestring
previewTextHTMLstring
replyTostring | null
scheduledAtstring | null

When to send this message, as an ISO 8601 timestamp with a timezone offset. Null clears it. On a STANDARD campaign this is the send time Send Email Campaign (emailMarketing_sendCampaign) uses when called without its own scheduledAt; nothing is scheduled until that call. Once the campaign is SCHEDULED, change the time through Send Email Campaign instead. On an A/B test it only applies when the tested variable is SEND_TIME.

subjectHTMLstring
textstring
themeobject | null
bodyJSONobject

Email body as email-editor JSON, written by the dashboard. Omit it and send bodyHTML: the saved editor JSON is cleared and the dashboard editor opens the new HTML. Only send it together with the matching bodyHTML.

previewTextJSONobject

Inbox preview as email-editor JSON, written by the dashboard. Omit it and send previewTextHTML: the saved editor JSON is cleared and the dashboard editor opens the new HTML. Only send it together with the matching previewTextHTML.

subjectJSONobject

Subject as email-editor JSON, written by the dashboard. Omit it and send subjectHTML: the saved editor JSON is cleared and the dashboard editor opens the new HTML. Only send it together with the matching subjectHTML.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/projects/string/email-campaigns/string" \  -H "Content-Type: application/json" \  -d '{    "changes": {}  }'
{  "id": "string",  "createdAt": "string",  "updatedAt": "string",  "projectId": "string",  "name": "string",  "status": "DRAFT",  "type": "STANDARD",  "workflowId": "string",  "workflowStepId": "string",  "sentAt": "string",  "contactListId": "string",  "contactsFilterGroups": [],  "lastSuccessContactId": "string",  "lastSuccessContactCreatedAt": "string",  "sendCursor": {    "distinctId": "string",    "sortValue": "string"  },  "sendOrderByProperty": {    "direction": "asc",    "propertyKey": "string"  },  "providerSendState": {    "checkedAt": "string",    "lanes": {      "property1": {        "deferred": true,        "passed": 0,        "slowed": {          "at": "string",          "finding": "string"        }      },      "property2": {        "deferred": true,        "passed": 0,        "slowed": {          "at": "string",          "finding": "string"        }      }    },    "pausedForProviders": true,    "rescanFrom": {      "cursor": {        "distinctId": "string",        "sortValue": "string"      }    },    "slowPass": true  },  "abTestConfig": {    "variable": "SUBJECT",    "samplePercent": 20,    "winnerMetric": "OPEN_RATE",    "winnerWaitHours": 4,    "winnerWaitUnit": "HOURS",    "sendTimeDelayHours": 2,    "sendTimeDelayUnit": "HOURS",    "winnerMessageId": "string",    "winnerSelectedAt": "string",    "winnerRolloutAt": "string",    "winnerWaitStartedAt": "string",    "status": "AWAITING_SAMPLE",    "samplePaginationEnd": 0  },  "utmConfig": {    "enabled": true,    "params": {      "campaign": "",      "content": "",      "medium": "",      "source": "",      "term": ""    }  },  "sendCount": 0,  "sendingTargetDurationMs": 0,  "sendPaginationCount": 0,  "messages": [],  "bcc": "string",  "bodyHTML": "string",  "bodyJSON": {    "property1": null,    "property2": null  },  "cc": "string",  "fromDomain": "string",  "fromEmailUsername": "string",  "fromName": "string",  "previewTextHTML": "string",  "previewTextJSON": {    "property1": null,    "property2": null  },  "replyTo": "string",  "scheduledAt": "string",  "subjectHTML": "string",  "subjectJSON": {    "property1": null,    "property2": null  },  "text": "string",  "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      }    }  }}

Create Email Campaign

Creates a campaign together with its first message (subject, body, sender) in one transaction. New campaigns always start as a DRAFT. Creating one never sends anything. Define the audience with `contactListId`, `contactsFilterGroups`, or both; set `type` to `AB_TEST` and supply `abTestConfig` for a split test.

Duplicate Email Campaign

Copies a campaign (its messages, audience, sending speed, UTM tags, and other settings) into a new DRAFT. The copy is named `"<original> (Copy)"`, incrementing to `(Copy 2)` and beyond if that name is taken. Send counts, sent timestamps, and any A/B winner are reset, so the duplicate behaves like a fresh campaign rather than inheriting the original's results.