cURL
curl -X PUT "https://api.ionq.co/v0.3/jobs/status/cancel" \
-H "Authorization: apiKey your-api-key" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"617a1f8b-59d4-435d-aa33-695433d7155e",
"2ccf2773-4c28-468e-a290-2f8554808a25",
"f92df2b6-d212-4f4a-b9ea-024b58c5c3e8"
]
}'import requests
url = "https://api.ionq.co/v0.3/jobs/status/cancel"
payload = { "ids": ["aa54e783-0a9b-4f73-ad2f-63983b6aa4a8"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['aa54e783-0a9b-4f73-ad2f-63983b6aa4a8']})
};
fetch('https://api.ionq.co/v0.3/jobs/status/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ionq.co/v0.3/jobs/status/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'aa54e783-0a9b-4f73-ad2f-63983b6aa4a8'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ionq.co/v0.3/jobs/status/cancel"
payload := strings.NewReader("{\n \"ids\": [\n \"aa54e783-0a9b-4f73-ad2f-63983b6aa4a8\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.ionq.co/v0.3/jobs/status/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"aa54e783-0a9b-4f73-ad2f-63983b6aa4a8\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionq.co/v0.3/jobs/status/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"aa54e783-0a9b-4f73-ad2f-63983b6aa4a8\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"ids": [
"aa54e783-0a9b-4f73-ad2f-63983b6aa4a8"
],
"status": "canceled"
}Jobs
Cancel many Jobs
Cancel the execution of many jobs at once by passing a list of jobs.
PUT
/
jobs
/
status
/
cancel
cURL
curl -X PUT "https://api.ionq.co/v0.3/jobs/status/cancel" \
-H "Authorization: apiKey your-api-key" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"617a1f8b-59d4-435d-aa33-695433d7155e",
"2ccf2773-4c28-468e-a290-2f8554808a25",
"f92df2b6-d212-4f4a-b9ea-024b58c5c3e8"
]
}'import requests
url = "https://api.ionq.co/v0.3/jobs/status/cancel"
payload = { "ids": ["aa54e783-0a9b-4f73-ad2f-63983b6aa4a8"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['aa54e783-0a9b-4f73-ad2f-63983b6aa4a8']})
};
fetch('https://api.ionq.co/v0.3/jobs/status/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ionq.co/v0.3/jobs/status/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'aa54e783-0a9b-4f73-ad2f-63983b6aa4a8'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ionq.co/v0.3/jobs/status/cancel"
payload := strings.NewReader("{\n \"ids\": [\n \"aa54e783-0a9b-4f73-ad2f-63983b6aa4a8\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.ionq.co/v0.3/jobs/status/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"aa54e783-0a9b-4f73-ad2f-63983b6aa4a8\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionq.co/v0.3/jobs/status/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"aa54e783-0a9b-4f73-ad2f-63983b6aa4a8\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"ids": [
"aa54e783-0a9b-4f73-ad2f-63983b6aa4a8"
],
"status": "canceled"
}Body
application/json
A list of job UUIDs to cancel.
The UUID of a job. We'll provide the UUID initially in our response to a job creation request.
Response
200 - application/json
Successfully cancelled requested jobs
Response body from successfully cancelling many jobs.
A list of UUIDs of cancelled jobs.
The UUID of a job. We'll provide the UUID initially in our response to a job creation request.
Status of a job (always canceled).
Available options:
canceled Was this page helpful?
⌘I

