Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Pass as Authorization: ServiceToken <token>. You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.

Path Parameters

workspace
string
required

Workspace where the workflow should be created (staging, production, etc.)

slug
string
required

Unique identifier of the workflow. You can get it from workflow settings for existing workflows.

Query Parameters

commit
boolean
default:false

Whether to commit the workflow immediately. Workflow will be successfully committed only if validation_result.is_valid is true.

commit_message
string

Optional commit message describing the changes. Used only when commit=true.

Body

application/json
name
string
required

Human-readable name of the workflow. The workflow slug is taken from the URL path, not generated from this name.

Maximum string length: 255
Example:

"Welcome Sequence"

category
string
required

Notification category of the workflow. Used to apply category-specific settings and preferences.

Example:

"transactional"

trigger_type
enum<string>
required

You can trigger a workflow either via API by passing its slug directly, or through an event-based system where the workflow runs when a specific event occurs. You can compare both methods here. If the workflow should run when a user enters or exits a list, use trigger_type = event.

Available options:
event,
api
tree
object
required

Node tree structure of the workflow. Contains the nodes array with all workflow nodes and their configuration.

description
string | null

Description explaining the usecase of the workflow

Maximum string length: 500
is_enabled
boolean
default:true

Whether the workflow should be enabled

tags
string[]

Tags are used for grouping and filtering workflows in list (max 25).

Maximum array length: 25
Maximum string length: 128
Example:
payload_schema
object | null

Schema to validate workflow api data structure. Used only when trigger_type = api.

trigger_events
string[]

Events that trigger this workflow (required if trigger_type = event, max 10). In case of list entry/exit, event names will be $USER_ENTERED_LIST - <list_id> and $USER_EXITED_LIST - <list_id> respectively.

Maximum array length: 10
Maximum string length: 255
ratelimit
object | null

Throttle settings for the workflow. This is used to limit the number of times a workflow can be executed per user in a given time period.

conditions
object[] | null

Trigger Conditions (max 10). Workflow will be executed if any of the conditions in this array evaluate to true.

Maximum array length: 10
override_recipients_type
enum<string>

Override recipients using a property from the trigger payload. Type defines if the workflow should run for a list of users or a single object. Only applicable for trigger_type = event.

Available options:
user,
single_object_fields
Example:

"user"

override_recipients_user_expr
string | null

JQ expression to override recipients when override_recipients_type = user. Only applicable for trigger_type = event.

Example:

".distinct_id"

override_recipients_single_object_fields_expr
object | null

JQ expression to override recipients with object when override_recipients_type = single_object_fields. Only applicable for trigger_type = event.

Example:
override_actor_user_expr
string | null

JQ expression to override actor. Only applicable for trigger_type = event.

Example:

".actor_id"

override_tenant_expr
string | null

JQ expression to override tenant. Only applicable for trigger_type = event.

Example:

".tenant_id"

Response

Workflow created. The response includes the saved workflow object along with a validation_result field that indicates whether the workflow configuration is valid. When commit=true is passed, a commit_result field is also returned.

validation_result
object
commit_result
object

Present only when commit=true is passed. is_committed is false if validation failed or the commit raised an error; the upsert itself is still saved.