POST/jobs/{job_qrn}/cancel

Cancel a quantum job.

Args:

  • job_qrn (string): Job QRN (qBraid Resource Name)

Returns:

  • Object containing a confirmation message, the job QRN, and the updated status

Raises:

  • 400: Job is in an invalid state for cancellation or vendor is not supported
  • 404: Job is not found
  • 422: Validation error if the job_qrn parameter is invalid

Authorizations

X-API-KEYstringheaderrequired

Authenticate requests using an API key linked to your qBraid account. Obtain your key by registering or logging in at account.qbraid.com.

Path Parameters

job_qrnstringrequired

Job QRN (qBraid Resource Name)

Response

202Successful Response
successbooleanrequired

Whether the cancellation was initiated successfully

dataobjectrequired
404Job Not Found
422Validation Error
POST/jobs/{job_qrn}/cancel
curl --request POST \
  --url https://api-v2.qbraid.com/api/v1/jobs/%3Cjob_qrn%3E/cancel \
  --header 'X-API-KEY: <api-key>'
import requests

url = "https://api-v2.qbraid.com/api/v1/jobs/%3Cjob_qrn%3E/cancel"
headers = {
    "X-API-KEY": "<api-key>"
}

response = requests.post(url, headers=headers)
print(response.json())
const url = "https://api-v2.qbraid.com/api/v1/jobs/%3Cjob_qrn%3E/cancel";
const options = {
  method: "POST",
  headers: {"X-API-KEY":"<api-key>"},
};

const response = await fetch(url, options);
console.log(await response.json());
{
  "success": true,
  "data": {
    "message": "Job cancellation initiated successfully",
    "jobQrn": "qbraid:job:abc123xyz",
    "status": "CANCELLING"
  }
}
{
  "detail": "Job not found"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}