Create or Update Workflow
Create a new workflow or update the draft version of an existing one
Authorizations
Pass as Authorization: ServiceToken <token>. You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Path Parameters
Workspace where the workflow should be created (staging, production, etc.)
Unique identifier of the workflow. You can get it from workflow settings for existing workflows.
Query Parameters
Whether to commit the workflow immediately. Workflow will be successfully committed only if validation_result.is_valid is true.
Optional commit message describing the changes. Used only when commit=true.
Body
Human-readable name of the workflow. The workflow slug is taken from the URL path, not generated from this name.
255"Welcome Sequence"
Notification category of the workflow. Used to apply category-specific settings and preferences.
"transactional"
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.
event, api Node tree structure of the workflow. Contains the nodes array with all workflow nodes and their configuration.
Description explaining the usecase of the workflow
500Whether the workflow should be enabled
Tags are used for grouping and filtering workflows in list (max 25).
25128Schema to validate workflow api data structure. Used only when trigger_type = api.
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.
10255Throttle 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.
Trigger Conditions (max 10). Workflow will be executed if any of the conditions in this array evaluate to true.
10JQ expression to override recipients when override_recipients_type = user. Only applicable for trigger_type = event.
".distinct_id"
JQ expression to override recipients with object when override_recipients_type = single_object_fields. Only applicable for trigger_type = event.
JQ expression to override actor. Only applicable for trigger_type = event.
".actor_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.