Skip to main content
Version: 24.05

/i/tasks/stop

Endpoint​

/i/tasks/stop

Overview​

Stops a running task by ending the database operation that is executing it.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

  • Requires write access to feature core for the target app.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API authentication key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
app_idStringYesApp ID used for write-permission validation.
task_idStringYesID of the task to stop.

Examples​

Example 1: Stop task​

/i/tasks/stop?
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2&
task_id=17f0f6c3a2c42cbced96d4a01f88f9a7f45bc7a5

Response​

Success Response​

{
"result": "Success"
}

Response Fields​

FieldTypeDescription
resultStringOutcome message.

Error Responses​

Status Code: 200 OK

{
"result": "Task does not exist"
}
{
"result": "No permission to stop this task"
}
{
"result": "Operation could not be stopped"
}

Behavior​

Behavior Modes​

ModeTriggerResponse
Task stoppedtask_id exists in long_tasks and the database accepts the stop request.{ "result": "Success" }
Task missingtask_id is not found.{ "result": "Task does not exist" }
Creator missingThe task has a creator that no longer exists as a dashboard member.{ "result": "No permission to stop this task" }
Stop refusedThe database could not end the operation.{ "result": "Operation could not be stopped" }
  • The endpoint answers with HTTP status 200 in all of these cases, so check the result text.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission validationReads member identity and app-level write permissions; checks that the task creator still exists.
countly.long_tasksTask metadata storageReads the task document to find the database operation to stop.