Skip to content

Results are limited to the current section: Cloud services

Product news

Cancel Jobs

PATCH
/api/v2/batches/{batch__id}/cancel/jobs
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.

batch__id
required
Batch Id
string format: uuid
id
Any of:
Array<string>

Unique id for the job

id__starts_with
Any of:
string

First characters of the job id

batch_id
Any of:
Array<string>

Owner batch of the job

project_id
Any of:
Array<string>

Owner project of the job

user_id
Any of:
Array<string>

Owner user of the job

status
Any of:
Array<string>
Allowed values: PENDING RUNNING DONE ERROR CANCELED CANCELING

Job status type enum

min_runs
Any of:
integer

Minimum number of times the pulser sequence is repeated

max_runs
Any of:
integer

Maximum number of times the pulser sequence is repeated

errors
Any of:
boolean

Whether errors were returned when executing the job

origin
Any of:
Array<string>
Allowed values: CLIENT AZURE OVH UNKNOWN

Origin of the job

start_date
Any of:
string format: date-time

Time when the emulator or QPU indicated a job was started

end_date
Any of:
string format: date-time

Time when the emulator or QPU indicated a job finished, failed or was cancelled

Successful Response

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

Response to a request for cancelling a bunch of jobs without the results of the jobs.

object
jobs
required
Jobs

Jobs that were successfully canceled.

Array<object>
ProducedPartialJobResponse

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

Unique identifier for the job.

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

Current job status.

string
Allowed values: PENDING RUNNING DONE ERROR CANCELED CANCELING
runs
required
Any of:
integer
batch_id
required
Batch Id

ID of the batch this job belongs to.

string format: uuid
project_id
required
Project Id

ID of the project this job belongs to.

string format: uuid
created_at
required
Created At

Timestamp when the job was created.

string format: date-time
updated_at
required
Updated At

Timestamp of the last job update.

string format: date-time
start_timestamp
required
Any of:
string format: date-time
end_timestamp
required
Any of:
string format: date-time
variables
required
Any of:
object
key
additional properties
any
errors
required
Any of:
Array<string>
progress
required
Any of:
integer
<= 100
sequence
required
Any of:
string
creation_order
required
Creation Order

Position in the creation order within the batch.

integer
errors
required
Errors

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

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

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"
}
]
}