Skip to main content
IBM Quantum Platform

Sessions


Create a session

Create a session

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access

  • quantum-computing.session.create

Auditing

Calling this method generates the following auditing events.

  • quantum-computing.session.create

Input

Body Parameters
Name, Type
Description
max_ttl
integer

The maximum time (in seconds) for the session to run, subject to plan limits.

Default value: 28800
Minimum value: 1
Maximum value: 2147483647
mode
string

Execution mode to run the session in

Possible values: batchdedicated
backend
string

Backend name

backend_name
string

Backend name (fallback)

Code samples
POST
/v1/sessions

If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/sessions

curl -X POST \
  https://quantum.cloud.ibm.com/api/v1/sessions \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR-TOKEN' \
  -H 'Service-CRN: YOUR-SERVICE-CRN' \
  -H 'IBM-API-Version: 2026-02-15'

Output

HTTP Response Status Codes
Status code
Description
200Ok
400Bad Request
401Unauthorized
500Internal error
Responses
{
  "id": "example",
  "backend_name": "example",
  "started_at": "example",
  "activated_at": "example",
  "closed_at": "example",
  "last_job_started": "example",
  "last_job_completed": "example",
  "interactive_ttl": 1,
  "max_ttl": 1,
  "active_ttl": 1,
  "state": "open",
  "state_reason": "example",
  "accepting_jobs": true,
  "mode": "batch",
  "timestamps": [
    {
      "status": "open",
      "timestamp": "example"
    }
  ],
  "user_id": "example",
  "elapsed_time": 1.432
}

Get a session

Get a session

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access

  • quantum-computing.session.read

Auditing

Calling this method generates the following auditing events.

  • quantum-computing.session.read

Input

Path Parameters
Name, Type
Description
id
Required
string

Job Session ID

Code samples
GET
/v1/sessions/{id}

If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/sessions/{id}

curl -X GET \
  https://quantum.cloud.ibm.com/api/v1/sessions/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR-TOKEN' \
  -H 'Service-CRN: YOUR-SERVICE-CRN' \
  -H 'IBM-API-Version: 2026-02-15'

Output

HTTP Response Status Codes
Status code
Description
200OK
401Unauthorized
404Not Found
500Internal error
Responses
{
  "id": "example",
  "backend_name": "example",
  "started_at": "example",
  "activated_at": "example",
  "closed_at": "example",
  "last_job_started": "example",
  "last_job_completed": "example",
  "interactive_ttl": 1,
  "max_ttl": 1,
  "active_ttl": 1,
  "state": "open",
  "state_reason": "example",
  "accepting_jobs": true,
  "mode": "batch",
  "timestamps": [
    {
      "status": "open",
      "timestamp": "example"
    }
  ],
  "user_id": "example",
  "elapsed_time": 1.432
}

Update a session

Update a session

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access

  • quantum-computing.session.update

Auditing

Calling this method generates the following auditing events.

  • quantum-computing.session.update

Input

Path Parameters
Name, Type
Description
id
Required
string

Job Session ID

Body Parameters
Name, Type
Description
accepting_jobs
Required
boolean

If true, the session is actively accepting new jobs to be queued. If false, jobs will be rejected on create and the session will be immediately closed when there are no more jobs to run in the session.

Code samples
PATCH
/v1/sessions/{id}

If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/sessions/{id}

curl -X PATCH \
  https://quantum.cloud.ibm.com/api/v1/sessions/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR-TOKEN' \
  -H 'Service-CRN: YOUR-SERVICE-CRN' \
  -H 'IBM-API-Version: 2026-02-15' \
  -H 'Content-Type: application/json' \
  -d '{"accepting_jobs":true}'

Output

HTTP Response Status Codes
Status code
Description
204Successfully updated session
401Unauthorized
404Not Found
500Internal error
Responses
Successfully updated session

Close job session

Closes the runtime session. The session stops accepting new jobs and queued jobs will not run. Existing running jobs will run to completion. This is analogous to the cancel() function in Qiskit.

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access

  • quantum-computing.session.update

Auditing

Calling this method generates the following auditing events.

  • quantum-computing.session.update

Input

Path Parameters
Name, Type
Description
id
Required
string

Session Id

Code samples
DELETE
/v1/sessions/{id}/close

If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/sessions/{id}/close

curl -X DELETE \
  https://quantum.cloud.ibm.com/api/v1/sessions/{id}/close \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR-TOKEN' \
  -H 'Service-CRN: YOUR-SERVICE-CRN' \
  -H 'IBM-API-Version: 2026-02-15'

Output

HTTP Response Status Codes
Status code
Description
204Successfully closed runtime session
Responses
Successfully closed runtime session
Was this page helpful?
Report a bug, typo, or request content on GitHub.