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

Send Test Email

Sends a one-off preview of a campaign message to specific contacts, rendered with their data so personalisation can be checked before the real send. Note the unusual shape: the campaign, message, and project are passed in the request body rather than looked up by ID, so this can preview unsaved edits. Test sends do not touch campaign status or stats, but they do consume balance and respect sender blocking.

POST
/projects/{projectId}/emails/send-test

Authorization

Authorization
AuthorizationBearer <token>

In: header

Path Parameters

projectIdrequiredstring

ID of the project sending the test.

Request Body

application/json

campaignrequiredobject

The campaign to preview. Passed in full rather than by ID so unsaved changes can be tested.

idrequiredstring
createdAtrequiredstring
updatedAtrequiredstring
projectIdrequiredstring
namerequiredstring
statusrequiredstring
Value in: "DRAFT" | "SCHEDULED" | "SENDING" | "SENT" | "PAUSED" | "CANCELLED"
typestring
Default: "STANDARD"Value in: "STANDARD" | "AUTOMATION" | "AB_TEST"
workflowIdstring | null
workflowStepIdstring | null
sentAtstring | null
contactListIdstring | null
contactsFilterGroupsarray<object>
Default: []
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.

lastSuccessContactIdstring | null
lastSuccessContactCreatedAtstring | null
sendOrderByPropertyobject | null
abTestConfigobject | null
utmConfigobject | null
sendCountinteger
Default: 0
sendingTargetDurationMsinteger | null
sendPaginationCountinteger
Default: 0
messagesarray<object>
idrequiredstring
createdAtrequiredstring
updatedAtrequiredstring
projectIdrequiredstring
emailCampaignIdrequiredstring
labelrequiredstring
fromNamerequiredstring
fromEmailUsernamerequiredstring
fromDomainrequiredstring
bccstring | null
ccstring | null
replyTostring | null
textrequiredstring
subjectHTMLrequiredstring
previewTextHTMLrequiredstring
bodyHTMLrequiredstring
scheduledAtstring | null
sentAtstring | null
lastSuccessContactIdstring | null
lastSuccessContactCreatedAtstring | null
bodyJSONrequiredobject
previewTextJSONrequiredobject
sendCountinteger
Default: 0
subjectJSONrequiredobject
themeobject | null
contactsrequiredarray<object>

Contacts to send the preview to. Their properties drive personalisation, so use real contacts to see realistic output.

idrequiredstring
createdAtrequiredstring
updatedAtrequiredstring
projectIdrequiredstring
distinctIdrequiredstring
emailstring | null
toDeleterequiredboolean
propertiesrequiredobject
agenumber | null
avatarstring | null
birthdaystring | null
createdAtstring | null
descriptionstring | null
displayNamestring | null
emailstring | string | null
firstNamestring | null
genderstring | null
idstring | null
lastNamestring | null
namestring | null
phonestring | null
titlestring | null
usernamestring | null
websitestring | null
$idstring | null
$lastSeenstring | null
$lastIdentifiedAtstring | null
$processedAtstring | null
$unsubscribedboolean | string | null
$subscribedboolean | string | null
$unsubscribeReasonstring | null
$unsubscribeSourcestring | null
$emailValidatedboolean | string | null
$lastEmailValidatedAtstring | null
$emailValidationResultstring | null
$emailScorenumber | null
$stripeCustomerIdstring | null
$osstring | null
$browserstring | null
$browserVersionstring | null
$screenHeightnumber | null
$screenWidthnumber | null
$screenDpinumber | null
$devicestring | null
$userAgentstring | null
$ipstring | null
$timezonestring | null
$citystring | null
$countrystring | null
$countryCodestring | null
$continentstring | null
$regionstring | null
$localestring | null
$latitudenumber | null
$longitudenumber | null
$referrerstring | null
$referringDomainstring | null
$initialReferrerstring | null
$initialReferringDomainstring | null
$utmSourcestring | null
$utmMediumstring | null
$utmCampaignstring | null
$utmTermstring | null
$utmContentstring | null
$initialUtmSourcestring | null
$initialUtmMediumstring | null
$initialUtmCampaignstring | null
$initialUtmTermstring | null
$initialUtmContentstring | null
$_toDeleteboolean | string | null
$_emailScoreActionsstring | null
messagerequiredobject

The specific message (subject, body, sender) to render. Pick one variant for an A/B campaign.

idrequiredstring
createdAtrequiredstring
updatedAtrequiredstring
projectIdrequiredstring
emailCampaignIdrequiredstring
labelrequiredstring
fromNamerequiredstring
fromEmailUsernamerequiredstring
fromDomainrequiredstring
bccstring | null
ccstring | null
replyTostring | null
textrequiredstring
subjectHTMLrequiredstring
previewTextHTMLrequiredstring
bodyHTMLrequiredstring
scheduledAtstring | null
sentAtstring | null
lastSuccessContactIdstring | null
lastSuccessContactCreatedAtstring | null
bodyJSONrequiredobject
previewTextJSONrequiredobject
sendCountinteger
Default: 0
subjectJSONrequiredobject
themeobject | null
projectrequiredobject

The sending project, supplying branding and sender identity for the render.

idrequiredstring
createdAtrequiredstring
updatedAtrequiredstring
namerequiredstring
taglinestring | null
slugrequiredstring
balancerequirednumber
balanceVersionrequiredinteger
thumbnailstring | null
stripeCustomerIdstring | null
testStripeCustomerIdstring | null
autoTopUpEnabledrequiredboolean
metaobject | null
autoTopUpAmountnumber | null
autoTopUpThresholdnumber | null

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://www.saasco.com/api/v2/projects/string/emails/send-test" \  -H "Content-Type: application/json" \  -d '{    "campaign": {      "id": "string",      "createdAt": "string",      "updatedAt": "string",      "projectId": "string",      "name": "string",      "status": "DRAFT"    },    "contacts": [      {        "id": "string",        "createdAt": "string",        "updatedAt": "string",        "projectId": "string",        "distinctId": "string",        "toDelete": true,        "properties": {          "property1": "string",          "property2": "string"        }      }    ],    "message": {      "id": "string",      "createdAt": "string",      "updatedAt": "string",      "projectId": "string",      "emailCampaignId": "string",      "label": "string",      "fromName": "string",      "fromEmailUsername": "string",      "fromDomain": "string",      "text": "string",      "subjectHTML": "string",      "previewTextHTML": "string",      "bodyHTML": "string",      "bodyJSON": {        "property1": null,        "property2": null      },      "previewTextJSON": {        "property1": null,        "property2": null      },      "subjectJSON": {        "property1": null,        "property2": null      }    },    "project": {      "id": "string",      "createdAt": "string",      "updatedAt": "string",      "name": "string",      "slug": "string",      "balance": 0,      "balanceVersion": -9007199254740991,      "autoTopUpEnabled": true    }  }'
{
  "message": "string",
  "success": true
}
{
  "code": "BAD_REQUEST",
  "message": "Invalid input data",
  "issues": []
}
{
  "code": "UNAUTHORIZED",
  "message": "Authorization not provided",
  "issues": []
}
{
  "code": "FORBIDDEN",
  "message": "Insufficient access",
  "issues": []
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}

Stop Sending Email Campaign

Pauses a campaign that is currently sending. Any in-flight batch is cancelled and the campaign moves to PAUSED, keeping its pagination cursor so Resume Sending Email Campaign can pick up where it stopped. Emails already handed to the provider still go out.

Count Campaign Emails

How many emails the campaign covers. The meaning shifts with campaign state: while it is still SENDING this is a live count of contacts currently matching the audience, so it can move between calls as contacts subscribe or unsubscribe. In every other state it counts the Email rows actually created. Treat it as a projection before the send finishes and a fact afterwards.