Create a workflow
Creates a workflow with its single trigger step. trigger_type defaults to EVENT, which requires event_name; SCHEDULE takes interval_ms and MANUAL is started only by POST /api/v1/workflows/{id}/executions.
Pass sequence to create the steps at the same time, as a LINEAR chain behind the trigger. Anything with a branch is PUT /api/v1/workflows/{id}/graph. Without a sequence the workflow holds only its trigger and stays inert until it has steps to run, which is why it is created disabled.
Requires the workflows:write scope — Create, edit, enable, and delete your automation workflows.
AuthorizationBearer <API Key>API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.
application/json- body
Body for POST /api/v1/workflows.
name*string1 <= length <= 200description?stringlength <= 1000trigger_type?WorkflowTriggerTypeV1What starts this workflow. Defaults to EVENT, which is the only kind the API created before this field existed. EVENT requires event_name; SCHEDULE uses interval_ms; MANUAL is started only by POST /api/v1/workflows/{id}/executions.
"EVENT""MANUAL""SCHEDULE"event_name?stringThe custom event that starts this workflow, e.g. user.signup. Required for EVENT workflows (the default) and ignored for the other trigger types.
1 <= length <= 200interval_ms?integerFor SCHEDULE workflows: how often the workflow fires, in milliseconds. Between one minute and 30 days; defaults to one hour.
60000 <= value <= 2592000000enabled?booleanWorkflows are created disabled. A workflow can only be enabled once every step is configured.
allow_reentry?booleansequence?array<>Optional LINEAR chain to create the workflow with, in run order. The trigger step is prepended and each step is wired to the next, so this cannot express branches — use PUT /api/v1/workflows/{id}/graph for those. Omit it to create a workflow that holds only its trigger step.
1 <= items <= 199Workflow created
application/json- response
An automation workflow as exposed on the v1 API.
id*stringuuidname*stringdescription*string|nullenabled*booleantrigger_type*string"EVENT""MANUAL""SCHEDULE"event_name*|Trigger event for EVENT workflows; null for the other trigger types.
allow_reentry*booleanmax_executions_per_hour*integer|nullversion*integerIncremented on every structural (step/transition) change.
step_count*integerSteps in this workflow's graph, trigger step included — so a workflow that has only ever been created reports 1. Read /graph for the steps themselves.
created_at*stringdate-timeupdated_at*stringdate-timecurl -X POST 'https://api.sendly.now/api/v1/workflows' \ -H 'Content-Type: application/json' \ -d '{ "name": "string"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "enabled": true, "trigger_type": "EVENT", "event_name": "string", "allow_reentry": true, "max_executions_per_hour": 0, "version": 0, "step_count": 0, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}