Skip to content

Results are limited to the current section: Cloud services

Product news

Cancel Batches

PATCH
/api/v1/batches/cancel
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.

Media typeapplication/json
ConsumedBatchBulkCancelRequest

Request to cancel a collection of batches.

object
batch_ids
Any of:
Array<string>
project_id
Any of:
Array<string>
user_id
Any of:
Array<string>
device_type
Any of:
Array<string>
status
Any of:
Array<string>
Allowed values: PENDING RUNNING DONE CANCELED CANCELING TIMED_OUT ERROR PAUSED
open
Any of:
boolean
start_date
Any of:
string format: date-time
queue_priority
Any of:
Array<string>
Allowed values: CRITICAL HIGH MEDIUM LOW FREE
tags
Any of:
Array<string>
cancel_all
Any of:
boolean

Successful Response

Media typeapplication/json
NonPaginatedResponse[ProducedBatchBulkCancelResponse]
object
data
Any of:
ProducedBatchBulkCancelResponse

Response to a request for cancelling a bunch of batches.

object
batches
required
Batches

Batches that were successfully canceled.

Array<object>
ProducedBatchWithoutJobsResponse

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
id
required
Id

Unique identifier for the batch.

string format: uuid
parent_id
required
Any of:
string format: uuid
status
required
BatchStatus

Current batch status.

string
Allowed values: PENDING RUNNING DONE CANCELED CANCELING TIMED_OUT ERROR PAUSED
complete
required
Complete

Deprecated. Use open instead. Indicates whether the batch is still accepting additional jobs. False means the batch is open; True means it is closed.

boolean
open
required
Open

Whether the batch is open and accepting additional jobs.

boolean
priority
required
Priority

Deprecated. Priority of the batch.

integer
device_type
required
Device Type

Target device type for the batch.

string
user_id
required
User Id

ID of the user who created the batch.

string
project_id
required
Project Id

ID of the project this batch belongs to.

string format: uuid
created_at
required
Created At

Timestamp when the batch was created.

string format: date-time
updated_at
required
Updated At

Timestamp of the last batch update.

string format: date-time
sequence_builder
required
Any of:
string
jobs_count
required
Jobs Count

Total number of jobs in the batch.

integer
jobs_count_per_status
required
Jobs Count Per Status

Number of jobs grouped by status.

object
key
additional properties
any
tags
required
Tags

User-defined labels for organizing batches.

Array<string>
unique items
configuration
required
Any of:
object
key
additional properties
any
backend_configuration
required
Any of:
string
webhook
required
Any of:
string
start_datetime
required
Any of:
string format: date-time
end_datetime
required
Any of:
string format: date-time
queue_priority
required
QueuePriority

Priority queue on which the batch is scheduled.

string
Allowed values: CRITICAL HIGH MEDIUM LOW FREE
errors
required
Errors

Batch IDs that could not be canceled, with error details.

object
key
additional properties
string
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

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}