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 WorkflowsgetGet WorkflowpostCreate WorkflowputUpdate WorkflowdelDelete WorkflowpostVerify Workflow Config
Email MarketingWorkflows

Create Workflow

View as MarkdownAgent setup

Creates a workflow definition: the trigger event, audience filters, frequency, and delay between runs. Creating one never starts a run and never sends anything. Steps and edges are added separately.

POST
/projects/{projectId}/workflows

Authorization

Authorization
AuthorizationBearer <token>

In: header

Path Parameters

projectIdrequiredstring

ID of the project that owns the workflow.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

namerequiredstring

Display name of the workflow.

triggerEventrequiredstring

Name of the analytics event that starts a run, e.g. signup.

maxRunsinteger | null

Maximum times a contact can go through this workflow. Null means no cap.

minDelayAmountinteger | null

Minimum delay between runs for the same contact. Pair with minDelayUnit.

minDelayUnitstring | null

Unit for minDelayAmount: MINUTES, HOURS, or DAYS.

frequencyrequiredstring

ONCE runs a contact through at most once. EVERY re-enters them each time the trigger fires, subject to maxRuns and minDelay.

Value in: "ONCE" | "EVERY"
statusrequiredstring

INACTIVE, PAUSED, or ACTIVE.

Value in: "INACTIVE" | "PAUSED" | "ACTIVE"
contactsFilterGroupsrequiredarray<object>

Audience filter groups. A contact must match at least one group to enter the workflow.

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.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/projects/string/workflows" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "triggerEvent": "string",    "frequency": "ONCE",    "status": "INACTIVE",    "contactsFilterGroups": [      {        "filters": [          {            "attributeDistinctId": "string",            "operator": "equals",            "value": "string"          }        ],        "groupType": "AND"      }    ]  }'
{  "id": "string",  "createdAt": "string",  "updatedAt": "string",  "name": "string",  "projectId": "string",  "triggerEvent": "string",  "maxRuns": -9007199254740991,  "minDelayAmount": 5,  "minDelayUnit": "MINUTES",  "frequency": "ONCE",  "status": "INACTIVE",  "contactsFilterGroups": [    {      "filters": [        {          "attributeDistinctId": "string",          "attributeType": "string",          "operator": "equals",          "value": "string"        }      ],      "oneDayEventFilters": [        {          "eventName": "string",          "operator": "performed"        }      ],      "groupType": "AND",      "requireSubscribed": true    }  ]}

Get Workflow

Fetches a single workflow by ID. Returns 404 if no workflow matches.

Update Workflow

Updates a workflow. Only the fields present in changes are written, so omitted keys stay as they are.