Kill a Pending Job using Orchestrator API

,

Hi , I am trying to use Orchestrator API to kill jobs with Pending Status so they wont run. But I am not able to do this. I first did a “GET JOB” API to get list of pending Jobs. Then I used one of the Job`s Id to run a stop Job Action : /odata/Jobs({Id})/UiPath.Server.Configuration.OData.StopJob
Request Body :
{
“strategy”: “Kill”
}

But this is giving me 400 Response code. The User Id that I am using have the Edit permission on the Jobs as well. Can you please confirm if we are not able to use the StopJob action to kill a pending Job, and is there any way using Orchestrator API that we can stop or kill Pending Jobs.

Hi,

Did you try the alternative API available where you can pass the JobID in the Request?

[POST] /odata/Jobs/UiPath.Server.Configuration.OData.StopJobs

{
jobIds (Array[integer]),
strategy (string) = [‘SoftStop’, ‘Kill’]stringEnum:“SoftStop”, “Kill”
}

1 Like

Hi Gaurav, Yes I Tried that also, and its the same result

Hi Gaurav, I tried earlier with invoking API from code for the StopJobs Action, and it was not working. But now when I checked from Swagger the Stopjobs Action, it is working and I am able to kill jobs. So it may be some error in the format of my request. Thank you so much Gaurav.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.