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

Update Workflow

View as MarkdownAgent setup

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

PUT
/projects/{projectId}/workflows/{workflowId}

Authorization

Authorization
AuthorizationBearer <token>

In: header

Path Parameters

projectIdrequiredstring

ID of the project that owns the workflow.

workflowIdrequiredstring

ID of the workflow 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.

contactsFilterGroupsarray<object>

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

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.

frequencystring

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"
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.

namestring

Display name of the workflow.

projectIdstring
statusstring

INACTIVE, PAUSED, or ACTIVE.

Value in: "INACTIVE" | "PAUSED" | "ACTIVE"
triggerEventstring

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

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/projects/string/workflows/string" \  -H "Content-Type: application/json" \  -d '{    "changes": {}  }'
{  "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,      "requireUnvalidatedEmail": true    }  ]}

Create Workflow

Creates a workflow definition: the trigger event, audience filters, frequency, and delay between runs. Creating one never starts a run and never sends anything. Optional templateId (welcome-series, trial-nurture, re-engagement) also creates connected steps and editable draft emails in one transaction; template workflows always start INACTIVE. Without a template, steps and edges are added separately.

Delete Workflow

Permanently deletes a workflow and everything cascading from it: steps, edges, runs, and run logs. Cannot be undone.