Cancel Batches
const url = 'https://example.com/api/v1/batches/cancel';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"batch_ids":["00000000-0000-0000-0000-000000000002"]}'};
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/v1/batches/cancel \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "batch_ids": [ "00000000-0000-0000-0000-000000000002" ] }'Cancel a group of batches owned by the authenticated user, matching the given criteria.
If batch_ids is provided, all other filters are ignored and only
the specified batches are canceled. To cancel all batches, use
cancel_all alone without any other filters.
Returns: A list of canceled batches and any batches that could not be canceled with their error explained.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Request to cancel a collection of batches.
object
Responses
Section titled “ Responses ”Successful Response
object
Response to a request for cancelling a bunch of batches.
object
Batches that were successfully canceled.
Response for a batch request that not includes its jobs.
This schema defines all the fields that can be publicly shared by the API.
object
Unique identifier for the batch.
Current batch status.
Deprecated. Use open instead. Indicates whether the batch is still accepting additional jobs. False means the batch is open; True means it is closed.
Whether the batch is open and accepting additional jobs.
Deprecated. Priority of the batch.
Target device type for the batch.
ID of the user who created the batch.
ID of the project this batch belongs to.
Timestamp when the batch was created.
Timestamp of the last batch update.
Total number of jobs in the batch.
Number of jobs grouped by status.
object
User-defined labels for organizing batches.
Priority queue on which the batch is scheduled.
Batch IDs that could not be canceled, with error details.
object
Example
{ "data": { "batches": [ { "complete": true, "created_at": "2025-01-15T10:30:00Z", "device_type": "FRESNEL", "end_datetime": "2025-01-15T10:40:00Z", "id": "00000000-0000-0000-0000-000000000002", "jobs_count": 2, "jobs_count_per_status": { "CANCELED": 2 }, "open": false, "priority": 0, "project_id": "00000000-0000-0000-0000-000000000001", "queue_priority": "MEDIUM", "sequence_builder": "<serialized Pulser sequence>", "status": "CANCELED", "tags": [ "experiment-1" ], "updated_at": "2025-01-15T10:40:00Z", "user_id": "user-123" } ], "errors": {} }}Validation Error
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}