•••
 
Documentation   /   API   /   API: Stopping tasks
 
 

API: Stopping tasks

 

Endpoint

POST https://plainly.com/stop

Parameters

Parameter Required Description
task Yes The key of the task to stop. In the workflow this is {{checklist_key}}.
key Yes The workflow's API key, from its Developer tab.
comment No Why the task was stopped. It's recorded on the task and returned in the response.
restart No true restarts a stopped task instead. A task stopped by a Kill action can't be restarted.

Example

curl -X POST https://plainly.com/stop \
  --data-urlencode "key=YOUR_WORKFLOW_API_KEY" \
  --data-urlencode "task=1a2b3c4d5e6f7g8h" \
  --data-urlencode "comment=Customer no longer wishes to proceed."

On success

{
  "data": {
    "status": 200,
    "title": "Task stopped",
    "detail": "Customer no longer wishes to proceed."
  }
}

When restarting, the title is "Task restarted".

Errors

Status Title Detail
400 Missing attribute You need task and key parameters.
400 Invalid attribute Your task and/or key parameters were invalid.
400 Bad request That task has been completed so can't be stopped.
400 Bad request That task has been stopped already.
400 Bad request That task is already live. (When restarting a task that isn't stopped.)
400 Bad request That task has been archived so can't be restarted.
500 Technical error Something went wrong. Please contact us.