# Stop a channel

API call format

DELETE /channels/{<workflow_id>}

Description

Stops existing channel.

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.
    • We have existing workflow channels with status RUNNING.

Postcondition

  1. On success response code should be 200
  2. On success the current channel status will be returned which initial value should be STOPPING.
  3. On failure an error will be returned with the right error code and description.

Example:

[Request] DELETE https://<base_api_url>/channels/<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] 
{
    "channelStatus":"STOPPING"
}

The initial state returned by this API call is "STOPPING". It will takes some time for a channel to be removed and we may observe several intermediate states on polling the channel state. We poll the state using GET /workflows/{id}/channel. The states the channel goes through are:

  • STOPPING
  • IDLE
  • DELETED
  • NOT_CREATED

When status achieves "NOT_CREATED" the channel is completely removed.