Jobs
Run a job
Invoke a Qiskit Runtime primitive. Note the returned job ID. You will use it to check the job's status and review results. This request is rate limited to 5 jobs per minute per user.
HTTP Response Status Codes
Status code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
409 | Usage exceeds instance limit |
Code samples
curl -X POST \
/api/v1/jobs \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"POST",
"/api/v1/jobs",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"id": "c5dge2d3rn7breq27i9g",
"backend": "ibm_backend"
}
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Job ID"
},
"backend": {
"type": "string",
"description": "Backend selected to run job"
},
"session_id": {
"type": "string",
"description": "Id of the session associated with the job"
}
},
"description": "Response when creating a job",
"required": [
"id",
"backend"
]
}
List jobs
List the quantum program jobs you have run.
Query Parameters
Name, Type | Description |
---|---|
limit integer | Number of results to return at a time Default value: 200 |
offset integer | Number of results to offset when retrieving the list of jobs |
pending boolean | Returns 'Queued' and 'Running' jobs if true. Returns 'Completed', 'Cancelled', and 'Failed' jobs if false. |
program string | Program ID to filter jobs |
backend string | Backend to filter jobs |
created_after string | Job created after filter |
created_before string | Job created before filter |
sort string | Sort jobs by created time ASC or DESC (default) |
tags string[] | Tags to filter jobs |
session_id string | Session ID to filter jobs |
exclude_params boolean | Exclude job params from the response Default value: true |
HTTP Response Status Codes
Status code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
Code samples
curl -X GET \
/api/v1/jobs \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/jobs",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"jobs": [
{
"id": "c5dge2d3rn7breq27i9g",
"backend": "ibmq_qasm_simulator",
"cost": 0,
"state": {
"status": "Completed",
"reason": ""
},
"status": "Completed",
"params": {
"iterations": 3
},
"program": {
"id": "myprogram-abcdef12345"
},
"created": "2021-10-04T13:52:09.456851Z",
"runtime": "ntc-provider-primitives:latest",
"tags": [
"tag1",
"tag2",
"tag3",
"tag4"
],
"session_id": "c5dge2d3rn7breq27i9g",
"usage": {
"seconds": 1
}
}
],
"count": 1,
"limit": 1,
"offset": 0
}
{
"title": "JobsResponse",
"type": "object",
"description": "Jobs collection response",
"properties": {
"jobs": {
"description": "A list of jobs",
"type": "array",
"items": {
"title": "JobResponse",
"type": "object",
"description": "A job",
"properties": {
"id": {
"type": "string",
"description": "Identifier assigned to the job"
},
"backend": {
"type": "string",
"description": "**Warning:** While this parameter is not currently required for requests, specifying it is strongly encouraged. Running an ISA circuit on a backend that has a different instruction set will result in an error. The backend parameter will be required in a future release.\n\nThe backend on which to run the program. If no backend is specified, the job is sent to the backend with the shortest queue that you have access to.\n",
"pattern": ".*"
},
"state": {
"title": "JobState",
"type": "object",
"description": "Current state of the job",
"properties": {
"status": {
"type": "string",
"description": "Current status of the job",
"enum": [
"Queued",
"Running",
"Completed",
"Cancelled",
"Failed"
]
},
"reason": {
"type": "string",
"description": "Reason for the current status"
},
"reason_code": {
"type": "integer",
"description": "Reason code for the current status"
},
"reason_solution": {
"type": "string",
"description": "Next steps user can take in case of failure"
}
},
"required": [
"status"
]
},
"status": {
"title": "JobStatus",
"type": "string",
"description": "Current status of the job",
"enum": [
"Queued",
"Running",
"Completed",
"Cancelled",
"Cancelled - Ran too long",
"Failed"
]
},
"params": {
"type": "object",
"additionalProperties": true,
"description": "Parameters used to execute the job"
},
"program": {
"type": "object",
"description": "Program associated with the job",
"properties": {
"id": {
"type": "string",
"description": "Identifier from the executed program"
}
},
"required": [
"id"
]
},
"created": {
"type": "string",
"description": "UTC timestamp for when the job was created"
},
"runtime": {
"type": "string",
"description": "Name and tag of the image to use when running a program (IBM Quantum channel users only)"
},
"cost": {
"type": "integer",
"description": "Cost of the job"
},
"tags": {
"title": "Tags",
"description": "List of job or program tags",
"type": "array",
"minItems": 1,
"maxItems": 5,
"items": {
"type": "string",
"pattern": ".*",
"minLength": 1,
"maxLength": 24
}
},
"remote_storage": {
"allOf": [
{
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Default remote storage option for where input data is stored and where output data should be stored"
}
]
},
{
"title": "RemoteStorage",
"description": "(Only enabled for Qiskit Runtime instances with the Channel Partner plan) Metadata and connection information on where job params are stored remotely\nand/or where to store results, logs, transpiled circuits, etc. Omitted properties\nin field specific objects will be inherited from the default remote storage option.\nAs an example, the following two objects are equivalent:\n\n```\n{\n \"type\": \"ibmcloud_cos\",\n \"region\": \"us-east\",\n \"region_type\": \"regional\",\n \"bucket_crn\": \"crn\",\n \"job_params\": {\n \"object_name\": \"my-object\"\n }\n}\n```\n\n```\n{\n \"type\": \"ibmcloud_cos\",\n \"region\": \"us-east\",\n \"region_type\": \"regional\",\n \"bucket_crn\": \"crn\",\n \"job_params\": {\n \"type\": \"ibmcloud_cos\",\n \"region\": \"us-east\",\n \"region_type\": \"regional\",\n \"bucket_crn\": \"crn\",\n \"object_name\": \"my-object\"\n }\n}\n```\n",
"properties": {
"job_params": {
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Location for where user supplied job params (omitted properties will will be inherited from default remote storage option)"
}
]
},
"results": {
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Location for where job results will be stored (omitted properties will will be inherited from default remote storage option)"
}
]
},
"logs": {
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Location for where job logs will be stored (omitted properties will will be inherited from default remote storage option)"
}
]
},
"transpiled_circuits": {
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Location for where job transpiled circuits will be stored. If not provided, transpiled circuits will not be stored."
}
]
}
},
"required": [
"job_params",
"results"
]
}
]
},
"session_id": {
"type": "string",
"description": "Identifier of the session that the job is a part of"
},
"user_id": {
"type": "string",
"description": "The id of the user submitted the job"
},
"usage": {
"title": "Usage",
"description": "usage metrics",
"type": "object",
"properties": {
"seconds": {
"type": "number",
"description": "Number of seconds of Qiskit Runtime usage including quantum compute and near-time classical pre- and post-processing"
}
},
"required": [
"seconds"
]
}
},
"required": [
"id",
"created",
"program",
"state",
"status",
"cost"
]
}
},
"count": {
"type": "integer",
"description": "Total number of jobs for the user"
},
"offset": {
"type": "integer",
"description": "Offset at which paginated results are returned"
},
"limit": {
"type": "integer",
"description": "Maximum number of results returned in the paginated response"
}
},
"required": [
"limit",
"offset"
]
}
List job details
List the details about the specified quantum program job.
Code samples
curl -X GET \
/api/v1/jobs/{id} \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/jobs/{id}",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"id": "c5dge2d3rn7breq27i9g",
"backend": "ibmq_qasm_simulator",
"cost": 0,
"state": {
"status": "Completed",
"reason": ""
},
"status": "Completed",
"params": {
"iterations": 3
},
"program": {
"id": "myprogram-abcdef12345"
},
"created": "2021-10-04T13:52:09.456851Z",
"runtime": "ntc-provider-primitives:latest",
"tags": [
"tag1",
"tag2",
"tag3",
"tag4"
],
"session_id": "c5dge2d3rn7breq27i9g"
}
{
"title": "JobResponse",
"type": "object",
"description": "A job",
"properties": {
"id": {
"type": "string",
"description": "Identifier assigned to the job"
},
"backend": {
"type": "string",
"description": "**Warning:** While this parameter is not currently required for requests, specifying it is strongly encouraged. Running an ISA circuit on a backend that has a different instruction set will result in an error. The backend parameter will be required in a future release.\n\nThe backend on which to run the program. If no backend is specified, the job is sent to the backend with the shortest queue that you have access to.\n",
"pattern": ".*"
},
"state": {
"title": "JobState",
"type": "object",
"description": "Current state of the job",
"properties": {
"status": {
"type": "string",
"description": "Current status of the job",
"enum": [
"Queued",
"Running",
"Completed",
"Cancelled",
"Failed"
]
},
"reason": {
"type": "string",
"description": "Reason for the current status"
},
"reason_code": {
"type": "integer",
"description": "Reason code for the current status"
},
"reason_solution": {
"type": "string",
"description": "Next steps user can take in case of failure"
}
},
"required": [
"status"
]
},
"status": {
"title": "JobStatus",
"type": "string",
"description": "Current status of the job",
"enum": [
"Queued",
"Running",
"Completed",
"Cancelled",
"Cancelled - Ran too long",
"Failed"
]
},
"params": {
"type": "object",
"additionalProperties": true,
"description": "Parameters used to execute the job"
},
"program": {
"type": "object",
"description": "Program associated with the job",
"properties": {
"id": {
"type": "string",
"description": "Identifier from the executed program"
}
},
"required": [
"id"
]
},
"created": {
"type": "string",
"description": "UTC timestamp for when the job was created"
},
"runtime": {
"type": "string",
"description": "Name and tag of the image to use when running a program (IBM Quantum channel users only)"
},
"cost": {
"type": "integer",
"description": "Cost of the job"
},
"tags": {
"title": "Tags",
"description": "List of job or program tags",
"type": "array",
"minItems": 1,
"maxItems": 5,
"items": {
"type": "string",
"pattern": ".*",
"minLength": 1,
"maxLength": 24
}
},
"remote_storage": {
"allOf": [
{
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Default remote storage option for where input data is stored and where output data should be stored"
}
]
},
{
"title": "RemoteStorage",
"description": "(Only enabled for Qiskit Runtime instances with the Channel Partner plan) Metadata and connection information on where job params are stored remotely\nand/or where to store results, logs, transpiled circuits, etc. Omitted properties\nin field specific objects will be inherited from the default remote storage option.\nAs an example, the following two objects are equivalent:\n\n```\n{\n \"type\": \"ibmcloud_cos\",\n \"region\": \"us-east\",\n \"region_type\": \"regional\",\n \"bucket_crn\": \"crn\",\n \"job_params\": {\n \"object_name\": \"my-object\"\n }\n}\n```\n\n```\n{\n \"type\": \"ibmcloud_cos\",\n \"region\": \"us-east\",\n \"region_type\": \"regional\",\n \"bucket_crn\": \"crn\",\n \"job_params\": {\n \"type\": \"ibmcloud_cos\",\n \"region\": \"us-east\",\n \"region_type\": \"regional\",\n \"bucket_crn\": \"crn\",\n \"object_name\": \"my-object\"\n }\n}\n```\n",
"properties": {
"job_params": {
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Location for where user supplied job params (omitted properties will will be inherited from default remote storage option)"
}
]
},
"results": {
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Location for where job results will be stored (omitted properties will will be inherited from default remote storage option)"
}
]
},
"logs": {
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Location for where job logs will be stored (omitted properties will will be inherited from default remote storage option)"
}
]
},
"transpiled_circuits": {
"allOf": [
{
"oneOf": [
{
"type": "object",
"description": "Remote storage metadata for where data is stored or to be stored in an IBM Cloud Object Storage bucket. Required fields may be omitted in field specific objected if allowed and defined in the default remote storage option.",
"properties": {
"type": {
"type": "string",
"enum": [
"ibmcloud_cos"
],
"default": "ibmcloud_cos"
},
"region": {
"type": "string",
"example": "us-east",
"description": "Region, Cross-Region, or Single Data Center as defined by IBM Cloud Object Storage (https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints)",
"pattern": "^[a-zA-Z-]+$"
},
"region_type": {
"type": "string",
"enum": [
"regional",
"cross-region",
"single-site"
]
},
"bucket_crn": {
"description": "Fully specified <a href=\"https://cloud.ibm.com/docs/account?topic=account-crn\">CRN</a> for the target Cloud Object Storage bucket",
"type": "string",
"example": "crn:v1:bluemix:public:cloud-object-storage:global:a/abc123:abc123:bucket:my-bucket"
},
"object_name": {
"description": "Name/ID of the object in the IBM Cloud Object Storage bucket. May *not* be specified in the default remote storage option.",
"type": "string"
}
},
"required": [
"object_name",
"bucket_crn",
"region",
"region_type"
]
}
],
"discriminator": {
"propertyName": "type"
}
},
{
"description": "Location for where job transpiled circuits will be stored. If not provided, transpiled circuits will not be stored."
}
]
}
},
"required": [
"job_params",
"results"
]
}
]
},
"session_id": {
"type": "string",
"description": "Identifier of the session that the job is a part of"
},
"user_id": {
"type": "string",
"description": "The id of the user submitted the job"
},
"usage": {
"title": "Usage",
"description": "usage metrics",
"type": "object",
"properties": {
"seconds": {
"type": "number",
"description": "Number of seconds of Qiskit Runtime usage including quantum compute and near-time classical pre- and post-processing"
}
},
"required": [
"seconds"
]
}
},
"required": [
"id",
"created",
"program",
"state",
"status",
"cost"
]
}
Delete a job
Delete the specified job and its associated data. Job must be in a terminal state.
HTTP Response Status Codes
Status code | Description |
---|---|
204 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal error deleting job |
Code samples
curl -X DELETE \
/api/v1/jobs/{id} \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"DELETE",
"/api/v1/jobs/{id}",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
Cancel a job
Cancels the specified job.
HTTP Response Status Codes
Status code | Description |
---|---|
204 | OK |
400 | Bad cancel request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
409 | Job is in non cancellable status. |
500 | Internal error cancelling job |
Code samples
curl -X POST \
/api/v1/jobs/{id}/cancel \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"POST",
"/api/v1/jobs/{id}/cancel",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
List job interim results
Return the interim results from this job. Interim results are kept two days after the job has finished running.
HTTP Response Status Codes
Status code | Description |
---|---|
200 | Returns job interim results. |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
Code samples
curl -X GET \
/api/v1/jobs/{id}/interim_results \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/jobs/{id}/interim_results",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
List job logs
List all job logs for the specified job.
HTTP Response Status Codes
Status code | Description |
---|---|
200 | Returns job logs. |
401 | Unauthorized |
403 | Forbidden |
404 | Not found |
Code samples
curl -X GET \
/api/v1/jobs/{id}/logs \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/jobs/{id}/logs",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
Get job metrics
Gets metrics of specified job
Code samples
curl -X GET \
/api/v1/jobs/{id}/metrics \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/jobs/{id}/metrics",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"timestamps": {
"created": "2022-06-20T12:55:20.268427Z",
"running": "2022-06-20T12:55:20.268427Z",
"finished": "2022-06-20T12:55:20.268427Z"
},
"bss": {
"seconds": 123
},
"usage": {
"quantum_seconds": 123,
"seconds": 123
},
"executions": 123,
"num_circuits": 123,
"num_qubits": [
1,
2,
3
],
"circuit_depths": [
0,
1,
2,
3
],
"qiskit_version": "0.36.2",
"estimated_start_time": "2022-06-20T12:55:20.268427Z",
"estimated_completion_time": "2022-06-20T12:55:20.268427Z",
"position_in_queue": 10,
"position_in_provider": 10
}
{
"title": "JobMetrics",
"type": "object",
"description": "Various metrics about the execution of a job",
"properties": {
"timestamps": {
"type": "object",
"description": "A map of status transitions to timestamps",
"properties": {
"created": {
"type": "string",
"description": "Timestamp of when the job create request was received"
},
"finished": {
"type": "string",
"description": "Timestamp of when the job finished"
},
"running": {
"type": "string",
"description": "Timestamp of when the job started running"
}
}
},
"bss": {
"type": "object",
"description": "Contains information about job usage metrics",
"properties": {
"seconds": {
"type": "integer",
"description": "Total billed time for the job - quantum seconds only."
}
}
},
"usage": {
"type": "object",
"description": "Contains information about job usage metrics",
"properties": {
"quantum_seconds": {
"type": "integer",
"format": "int64",
"description": "Total quantum seconds used by the job"
},
"seconds": {
"type": "integer",
"description": "Total billed time for the job - quantum seconds only."
}
}
},
"executions": {
"type": "integer",
"description": "Number of executions during job"
},
"num_circuits": {
"type": "integer",
"description": "Number of circuits executed on quantum backend"
},
"num_qubits": {
"type": "array",
"items": {
"type": "integer"
},
"description": "Number of qubits on quantum backend"
},
"circuit_depths": {
"type": "array",
"items": {
"type": "integer"
},
"description": "An array of circuit depths"
},
"qiskit_version": {
"type": "string",
"description": "Qiskit version used during execution of the job"
},
"estimated_start_time": {
"type": "string",
"deprecated": true,
"description": "UTC timestamp for when the job will start"
},
"estimated_completion_time": {
"type": "string",
"deprecated": true,
"description": "UTC timestamp for when the job will complete"
},
"position_in_queue": {
"type": "integer",
"deprecated": true,
"description": "Current position of job in queue (IBM Quantum channel users only)"
},
"position_in_provider": {
"type": "integer",
"deprecated": true,
"description": "Current position of job in provider (IBM Quantum channel users only)"
}
}
}
List job results
Return the final result from this job.
HTTP Response Status Codes
Status code | Description |
---|---|
200 | Returns the job's final result. |
204 | Job's final result not found. |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
Code samples
curl -X GET \
/api/v1/jobs/{id}/results \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/jobs/{id}/results",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
Replace job tags
Replace job tags
Body Parameters (application/json)
Name, Type | Description |
---|---|
tags Required string[] | List of job or program tags |
HTTP Response Status Codes
Status code | Description |
---|---|
204 | OK |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
Code samples
curl -X PUT \
/api/v1/jobs/{id}/tags \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"tags":["example"]}'
import requests
response = requests.request(
"PUT",
"/api/v1/jobs/{id}/tags",
headers={
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
data="{\"tags\":[\"example\"]}"
)
print(response.json())
Responses
Get job transpiled circuits
Return a presigned download URL for the transpiled circuits. Currently supported only for sampler primitive.
HTTP Response Status Codes
Status code | Description |
---|---|
200 | Returns a presigned URL to download job transpiled circuits. |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
Code samples
curl -X GET \
/api/v1/jobs/{id}/transpiled_circuits \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/jobs/{id}/transpiled_circuits",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"url": "example"
}
{
"title": "JobsTranspiledCircuitsResponse",
"type": "object",
"description": "Jobs Transpiled Circuits presigned URL to download",
"properties": {
"url": {
"description": "URL to download the transpiled circuits",
"type": "string"
}
},
"required": [
"url"
]
}