Cancel Jobs
const url = 'https://example.com/api/v2/batches/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancel/jobs';const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/api/v2/batches/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancel/jobs \ --header 'Authorization: Bearer <token>'Cancel a subset of jobs within a batch based on filter criteria. Only the batch owner can perform this operation.
Only jobs in a cancelable state (PENDING, RUNNING) are affected. Already completed or errored jobs are left unchanged.
Returns: The list of successfully canceled jobs and the list of job IDs that could not be canceled, with their error explained.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “ Responses ”Successful Response
object
Response to a request for cancelling a bunch of jobs without the results of the jobs.
object
Jobs that were successfully canceled.
Response to a request for a job.
This schema defines all the fields that can be publicly shared by the API and do not require significant computational resources. For example, 'logs_links' or 'results link'.
object
Unique identifier for the job.
Current job status.
ID of the batch this job belongs to.
ID of the project this job belongs to.
Timestamp when the job was created.
Timestamp of the last job update.
Position in the creation order within the batch.
Job IDs that could not be canceled, with error details.
object
Example
{ "data": { "errors": {}, "jobs": [ { "batch_id": "00000000-0000-0000-0000-000000000002", "created_at": "2025-01-15T10:30:00Z", "creation_order": 0, "end_timestamp": "2025-01-15T10:40:00Z", "id": "00000000-0000-0000-0000-000000000003", "project_id": "00000000-0000-0000-0000-000000000001", "runs": 100, "status": "CANCELED", "updated_at": "2025-01-15T10:40:00Z", "variables": { "omega": 5 } } ] }}Validation Error
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}