POST
/
v1
/
{workspace}
/
workflow
/
{slug}
/
Create or Update Workflow
curl --request POST \
  --url https://api.suprsend.com/v1/{workspace}/workflow/{slug}/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Welcome Email",
  "description": "Sends welcome email to new users",
  "category": "transactional",
  "tags": [
    "welcome",
    "onboarding"
  ],
  "tree": {
    "nodes": [
      {
        "name": "Send Email",
        "node_type": "send_email",
        "properties": {
          "template": "welcome-email-template",
          "subject": "Welcome to our platform!"
        },
        "description": "Send welcome email to new users"
      }
    ]
  }
}'
{
  "validation_result": {
    "is_valid": true,
    "errors": [
      "<string>"
    ]
  }
}
Create a new workflow or update an existing workflow configuration. You can optionally commit the workflow immediately upon creation/update.

Authorizations

Authorization
string
header
required

Pass as ServiceToken <Service_Token>. 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

Commit message describing the changes (required if commit=true)

Body

application/json

Response

201
application/json

The response includes the same workflow object as input along with a validation_result field that indicates whether the workflow configuration is valid.

The response is of type object.