arazzo: 1.0.1
info:
title: IBM Quantum Pause Session and Confirm
summary: Read a session's state, toggle whether it accepts new jobs, and confirm the change.
description: >-
A session-control flow. The workflow reads a session's current state and
accepting-jobs flag, updates the session to start or stop accepting new jobs
based on the supplied flag, and re-reads the session to confirm the change
took effect. Each request inlines its bearer token, Service-CRN, and
IBM-API-Version headers so the flow can be read and executed without opening
the underlying OpenAPI descriptions.
version: 1.0.0
sourceDescriptions:
- name: sessionsApi
url: ../openapi/ibm-quantum-sessions-api-openapi.yml
type: openapi
workflows:
- workflowId: pause-session-and-confirm
summary: Toggle a session's accepting-jobs flag and confirm the new state.
description: >-
Reads a session, updates its accepting-jobs flag, and reads it back to
confirm.
inputs:
type: object
required:
- accessToken
- serviceCrn
- apiVersion
- sessionId
- acceptingJobs
properties:
accessToken:
type: string
description: IBM Cloud IAM bearer token used in the Authorization header.
serviceCrn:
type: string
description: IBM Cloud Service CRN identifying the Qiskit Runtime instance.
apiVersion:
type: string
description: API version date sent in the IBM-API-Version header (e.g. 2026-03-15).
sessionId:
type: string
description: Identifier of the session to inspect and update.
acceptingJobs:
type: boolean
description: Whether the session should accept new jobs (true) or stop accepting them (false).
steps:
- stepId: getSession
description: >-
Read the session's current state and accepting-jobs flag before changing
it.
operationId: get_session
parameters:
- name: Authorization
in: header
value: "Bearer $inputs.accessToken"
- name: Service-CRN
in: header
value: $inputs.serviceCrn
- name: IBM-API-Version
in: header
value: $inputs.apiVersion
- name: id
in: path
value: $inputs.sessionId
successCriteria:
- condition: $statusCode == 200
outputs:
currentState: $response.body#/state
currentAcceptingJobs: $response.body#/accepting_jobs
- stepId: updateSession
description: >-
Update the session to start or stop accepting new jobs based on the
supplied flag. A 204 confirms the update.
operationId: update_session
parameters:
- name: Authorization
in: header
value: "Bearer $inputs.accessToken"
- name: Service-CRN
in: header
value: $inputs.serviceCrn
- name: IBM-API-Version
in: header
value: $inputs.apiVersion
- name: id
in: path
value: $inputs.sessionId
requestBody:
contentType: application/json
payload:
accepting_jobs: $inputs.acceptingJobs
successCriteria:
- condition: $statusCode == 204
- stepId: confirmSession
description: >-
Re-read the session to confirm its accepting-jobs flag now matches the
requested value.
operationId: get_session
parameters:
- name: Authorization
in: header
value: "Bearer $inputs.accessToken"
- name: Service-CRN
in: header
value: $inputs.serviceCrn
- name: IBM-API-Version
in: header
value: $inputs.apiVersion
- name: id
in: path
value: $inputs.sessionId
successCriteria:
- condition: $statusCode == 200
outputs:
finalAcceptingJobs: $response.body#/accepting_jobs
finalState: $response.body#/state
outputs:
finalAcceptingJobs: $steps.confirmSession.outputs.finalAcceptingJobs
finalState: $steps.confirmSession.outputs.finalState
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.