Skip to content

Request to cancel up to 500 job instances. Once cancelled, the job moves to the CANCELLED state.

Job instances must meet certain criteria to be eligible for cancellation. Learn more about jobs eligible for cancellation in Vault Help. For example, jobs in the SCHEDULED state can always be cancelled. You can use Vault API or VQL to retrieve the status of a job instance.

POST/api/{version}/services/jobs/actions/cancel
NameDescription
Content-Typeapplication/json (default) or text/csv
Acceptapplication/json (default) or application/xml

In the body of the request, include a JSON or CSV with the following information:

NameDescription
{job_id}A JSON array or CSV of each job_id to cancel. Maximum 500 jobs per request.
curl --location 'https://myvault.veevavault.com/api/v25.3/services/jobs/actions/cancel' \ --header 'Authorization: {SESSION_ID}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '[ { "job_id": 1046892 }, { "job_id": 1043341 } ]'
{ "responseStatus": "SUCCESS", "data": [ { "responseStatus": "SUCCESS", "data": { "id": 1068044 } }, { "responseStatus": "FAILURE", "errors": { "type": "INVALID_DATA", "message": "Job [1068337] is not found in QUEUED or QUEUEING state" } } ] }

On SUCCESS, Vault returns an individual responseStatus for each of the requested job instances, either SUCCESS or FAILURE. The status of each job instance is returned in the same order as the request.

For each job instance that successfully begins cancelling, Vault moves the job instance to the CANCELLING state and returns the id of the job instance. Once a job is in the CANCELLING state, the job will not fail to cancel. You can retrieve the job status to check if the job has finished cancelling and moved to the CANCELLED state.

For each job instance that could not begin cancelling, Vault returns an individual errors array containing the type of error (such as INVALID_DATA) and the error message containing the reason for failure and the job ID.