Validate a plan
/api/v1/ext/workflows/validate
Dry-run a plan: the problems it has. Nothing is saved.
A plan is a list of named steps. Each step has a unique name, a type from the Node catalog, optional data (only the fields you want to set — the rest take the type's defaults), and points at the next step by name: next for a single path, branches for a step that splits (ifElse: true / false; findContact: found / notFound).
A plan may start with one trigger of each type (several triggers must all point at the same first step), or with none — then contacts enter only through Add contacts to a workflow.
envelope is optional: name, stopOnReply, allowReEntry, executionWindow. Its status is ignored; a new workflow is always a draft.
Each issue names the step it is about. A plan with no issues is what Create workflow accepts.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| plan | body | object | yes | { steps: [...], envelope?: {...} } — at most 200 steps. |
Responses
| Status | When |
|---|---|
200 | Valid |
200 | Has problems |
400 | Not a plan |
401 | Missing or invalid token |
403 | Missing scope |
curl -X POST "https://backend.mysmsgateway.app/api/v1/ext/workflows/validate" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"plan": {
"steps": [
{
"name": "contactCreated",
"type": "contactCreated",
"next": "welcome"
},
{
"name": "welcome",
"type": "sendSMS",
"data": {
"message": "Hi {{contact.first_name}}, thanks for signing up!"
},
"next": "wait1"
},
{
"name": "wait1",
"type": "wait",
"data": {
"waitType": "duration",
"delay": 86400000,
"delayValue": 1,
"delayUnit": "days"
},
"next": "tag"
},
{
"name": "tag",
"type": "addTag",
"data": {
"tags": [
"welcomed"
]
},
"next": null
}
],
"envelope": {
"name": "Welcome new contacts",
"stopOnReply": true
}
}
}'{
"success": true,
"data": {
"valid": true,
"issues": [],
"step_count": 4
}
}« Node catalog
Create workflow »
