# Delete a Workflow
API call format
DELETE /workflows/<workflow_id>
Description
We could remove existing workflow after a channel is removed.
Precondition
- Authorization token is needed.
- Mandatory elements (should be specified):
- <workflow_id> - valid workflow id. Take a workflow id using Workflow List API call.
- We have existing workflow channel with status
NOT_CREATED.
Postcondition
- On success response code should be 200
- On success the workflow object is removed.
- On failure an error will be returned with the right error code and description.
Example-Positive:
[Request] DELETE https://<base_api_url>/workflows/<workflow_id>
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","Authorization":"<IdToken>"}
[Response] 200
[Request Cookies] []
[Response Headers] {"Content-Type":["application/json"],"Content-Length":["28"],"Connection":["keep-alive"],....}
[Response] null
Example-Negative:
The workflow may be removed only if the channel is removed first as predicate.If we try to remove a workflow on a running channel we will get an error similar to this example:
[Request] DELETE https://<base_api_url>/workflows/<workflow_id>
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","Authorization":"<AccessToken>"}
[Response] 400
[Request Cookies] []
[Response Headers] {"Content-Type":["application/json"],"Content-Length":["28"],"Connection":["keep-alive"],....}
[Response]
{
"message" : "Channel must be STOPPED in order to delete a workflow!"
}