Senlo

Cancel automation runs

POST /api/automations/cancel ends a contact's runs in progress.

curl -X POST https://senlo.io/api/automations/cancel \
  -H "Authorization: Bearer $SENLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "ada@example.com", "workflowId": 12 }'

Ends the contact's automation runs in progress. Their remaining steps (waits, emails, checks) do not run. Use it when something in your app makes a flow pointless: the overdue invoice was paid, the user deleted their account, the trial converted.

The contact can enter the automation again with its next event.

Body

FieldTypeRequiredDescription
emailstringyesThe contact in this workspace.
workflowIdintegernoOnly runs of this automation (its id is in the editor's URL). Without it, the contact's runs in every automation of the workspace.

Response

{ "success": true, "data": { "cancelled": 1 } }

cancelled is the number of runs ended; 0 when none was in progress.

Errors

StatusWhen
400email missing or invalid, workflowId not a positive integer.
401No key, or a wrong one.
404No contact with this email, or no automation with this id, in the workspace.
429Rate limited.
Edit this page on GitHub

On this page