Saasco logoSaasco logo
Saasco logoSaasco logo

Introduction

Quick StartWhat is Saasco?

Analytics

CRM

Email Marketing

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 Stats

Knowledge

Support

Projects

Campaigns

Update Email Campaign

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

changesrequiredobject

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

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

Attribute filters combined with 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 filters evaluated over the last 24 hours only.

eventNamerequiredstring

Analytics event name.

operatorrequiredstring

Whether the contact performed the event in the last 24 hours.

Value in: "performed" | "notPerformed"
groupTyperequiredstring

How filters in this group are combined.

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

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

namestring
sendOrderByPropertyobject | null
statusstring
Value in: "DRAFT" | "SCHEDULED" | "SENDING" | "SENT" | "PAUSED" | "CANCELLED"
utmConfigobject | null
workflowIdstring | null
workflowStepIdstring | null
sendingTargetDurationMsinteger | null
bccstring | null
bodyHTMLstring
ccstring | null
fromDomainstring
fromEmailUsernamestring
fromNamestring
previewTextHTMLstring
replyTostring | null
scheduledAtstring | null
subjectHTMLstring
textstring
themeobject | null
bodyJSONobject
previewTextJSONobject
subjectJSONobject

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://www.saasco.com/api/v2/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",
  "sendOrderByProperty": {
    "direction": "asc",
    "propertyKey": "string"
  },
  "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": 9007199254740991
  },
  "utmConfig": {
    "enabled": true,
    "params": {
      "campaign": "",
      "content": "",
      "medium": "",
      "source": "",
      "term": ""
    }
  },
  "sendCount": 0,
  "sendingTargetDurationMs": 9007199254740991,
  "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
      }
    }
  }
}
{
  "code": "BAD_REQUEST",
  "message": "Invalid input data",
  "issues": []
}
{
  "code": "UNAUTHORIZED",
  "message": "Authorization not provided",
  "issues": []
}
{
  "code": "FORBIDDEN",
  "message": "Insufficient access",
  "issues": []
}
{
  "code": "NOT_FOUND",
  "message": "Not found",
  "issues": []
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}

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, and 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.