Skip to Content
SendlySendly
API ReferenceWorkflows

Update a workflow

PATCH
/api/v1/workflows/{id}

Sparse update — omitted fields are left unchanged.

Two state rules apply: the trigger (trigger_type/event_name/interval_ms) cannot be changed while the workflow has running executions (409), and enabled: true is refused while any step is still unconfigured (422), because an enabled workflow accepts contacts immediately and would otherwise fail only once one reached the broken step.

sequence REPLACES every non-trigger step with a linear chain and is likewise refused while executions are running. Omit it to leave the graph untouched.

Requires the workflows:write scope — Create, edit, enable, and delete your automation workflows.

headerAuthorizationBearer <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.

id*string

Workflow id.

Formatuuid
application/json
  1. body

Body for PATCH /api/v1/workflows/{id}. Every field is optional; omitted fields are left unchanged. Changing the trigger while executions are running answers 409.

name?string
Length1 <= length <= 200
description?string
Lengthlength <= 1000
trigger_type?string

What starts a workflow. EVENT: a custom event you record. MANUAL: only an explicit API call. SCHEDULE: a fixed repeating interval.

Value in"EVENT""MANUAL""SCHEDULE"
event_name?string
Length1 <= length <= 200
interval_ms?integer

For SCHEDULE workflows: how often the workflow fires, in milliseconds. Between one minute and 30 days; defaults to one hour.

Range60000 <= value <= 2592000000
enabled?boolean
allow_reentry?boolean
max_executions_per_hour?|

Per-workflow start rate cap. null removes the cap.

Range0 < value
sequence?array<>

Optional LINEAR chain that REPLACES every non-trigger step, in run order. Destructive: the existing steps are discarded and their ids do not survive, which is why omitting this field leaves the graph untouched. Branches need PUT /api/v1/workflows/{id}/graph instead.

Items1 <= items <= 199

Response Body

Updated workflow

application/json
  1. response

An automation workflow as exposed on the v1 API.

id*string
Formatuuid
name*string
description*string|null
enabled*boolean
trigger_type*string
Value in"EVENT""MANUAL""SCHEDULE"
event_name*|

Trigger event for EVENT workflows; null for the other trigger types.

allow_reentry*boolean
max_executions_per_hour*integer|null
version*integer

Incremented on every structural (step/transition) change.

step_count*integer

Steps 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*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X PATCH 'https://api.sendly.now/api/v1/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "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"}