How To Cancel The Action Center Tasks In Bulk?

How to cancel the Action Center tasks in Bulk?

Resolution

Achieve the requirement by using the Rest API calls.

  1. Get the Task Ids from Action Center

Method: GET

URL: https://cloud.uipath.com/your_org_name/your_tenant_name/orchestrator_/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFolders?$orderby=CreationTime%20desc,Priority%20asc&$expand=CreatorUser&$top=1000

Headers:

Authorization: Bearer your_access_token

X-UIPATH-FolderKey: your_folder_name

Example:

  1. Delete the Task IDs from Action Center

Method: POST

URL: https://cloud.uipath.com/your_org_name/your_tenant_name/orchestrator_/odata/Tasks/UiPath.Server.Configuration.OData.DeleteTasks

Headers:

Authorization: Bearer your_access_token

X-UIPATH-FolderKey: your_folder_name

Accept: application/json

Body of type JSON:

{

"taskIds": [

TASK_ID_1,

TASK_ID_2,

...

]

}

Example:

  • Before deleting the tasks from the Action Center

  • After deleting the tasks from the Action Center


How to obtain the Bearer access_token?

Method: POST

URL: https://cloud.uipath.com/identity_/connect/token

Headers:

Content-Type: application/x-www-form-urlencoded

Body of type x-www-form-urlencoded

grant_type: client_credentials

client_id: your_client_id

scope: OR.Tasks

client_secret: your_client_secret

Example: