Skip to main content
Version: Next

Task Cancellation

Method for canceling a task. May be necessary if the task failed and changes need to be rolled back.

Request Parameters

POST /api/clients/v1/tasks/{id}/cancel/

Headers

  • Content-Type: application/json
  • Authorization: Bearer $access_token

Path

ParameterTypeConstraintsDescriptionExample
idstringuuid, requiredTask IDb8d2fc52-d922-46fb-9ce3-e005188d039c

Response Parameters

JSON body

ParameterTypeDescription
idstringTask ID
task_typestringTask type
subject_typestringType of object being acted upon
subject_idintegerID of object being acted upon
owner_idintegerID of task initiator
statusstringTask status
percentageintegerTask completion percentage
completed_atstringTask completion time

Examples

200 OK

Task object

{
"id": "ac1c7c6c-f63e-4fc2-9339-864af20a9e87",
"task_type": "ENABLE_VOD",
"subject_type": "vod",
"subject_id": 19,
"owner_id": 11,
"status": "CANCELLING",
"percentage": 0,
"completed_at": null
}
400 Bad Request

Invalid path parameters provided

{
"id": [
"A valid integer is required."
]
}
401 Unauthorized

Authentication credentials were missing or invalid

{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
403 Forbidden

Only project participants can cancel tasks associated with it

{
"detail": "Only participants can view this project's tasks"
}
404 Not Found

Task with this ID not found

{
"detail": "Task not found"
}