Skip to main content

Get session status

Call requirements, permissions, request fields, response fields, and error handling.

Request and permissions

GET https://openapi.qwenwork.ai/v1/session/sessions/{session_id} Authentication: Authorization: Bearer <access_token>; use an access token obtained through user OAuth authorization. Required business Scope: session.session.read Authorization methods declared by the contract: Organization authorization (organization), personal authorization (personal) The platform must enable the Scope for the application. The user must have the corresponding business permissions, and the target resource must be within their accessible scope. Whether personal or organization authorization is available to the application depends on the actual console configuration.

Behavior and limitations

Omitting session_type selects a cloud session. Every remote-control request must use session_type=remote and provide a nonempty device_id. Providing device_id for a cloud session, an empty or unknown type, or duplicate target parameters returns 422 VALIDATION_ERROR. Cross-device aggregated lists and automatic fallback to cloud are not provided. Both types use the same authentication chain; the open platform validates the corresponding Scope declared by each endpoint. Cloud sessions: Returns the current session state:
  • status—one of starting, idle, running, action_required, or terminated
  • pending_action—a question awaiting an answer, including its content and the tool_call_id needed to answer. Non-null if and only if status is action_required
  • current_turn—the executing turn, used to correlate prompts and events
  • cursor—the latest event's seq_id, used to resume reading the event stream
  • children—summaries of child sessions, up to 15
status is the authoritative value for what the session is doing; the other fields remain consistent with it. Remote-control sessions: Shares public gateway authentication with cloud sessions; this endpoint requires the business Scope stated below. No controller device ID or pairing is required. The target remote-control master switch must be enabled. If explicitly disabled, returns 403 FORBIDDEN with detail.reason=ACP_HOST_DISABLED; rejected write requests return detail.acceptance=not_accepted. An explicitly nonexistent session returns 404 NOT_FOUND with detail.reason=SESSION_NOT_FOUND. Commands route only to target connections signed in to the currently authenticated account. Offline targets, unknown targets, and targets belonging to other accounts all return device unavailable. Unknown request body fields are rejected. Reads the desktop's current execution context without scanning history. pending_requests retains complete safe ACP requests, including options and tool input. Any pending permission request yields action_required, including requests answerable only on the desktop. execution_context_available=false means context is unknown, and both current_turn_id and pending_requests are null; when no pending requests are known to exist, pending_requests is []. No fallback to history scanning is provided for older desktops or unavailable capabilities. If the full context exceeds the response budget, treat it as unavailable rather than returning a partial pending set or an empty array. Prompt the user to handle it on the desktop; do not enter an automatic retry loop. Call through the open platform, retaining the existing oauth_app Token, identity resolution, application IP restrictions, and resource ownership checks. Cloud and remote-control parameters retain their actual contract semantics. Short paths such as /sessions in this page are relative to the common prefix /v1/session. Use the full path at the top of this page for actual requests. Supported session types: cloud, remote In the full JSON, x-session-variants preserves the parameters, request bodies, and responses for cloud and remote-control sessions separately. Do not mix fields from the two branches.

Path parameters

ParameterTypeRequiredDescription and constraints
session_idstringYesSession identifier: a UUID for cloud sessions; an opaque identifier on the selected device for remote-control sessions.
Minimum length: 1
Maximum length: 256

Query parameters

ParameterTypeRequiredDescription and constraints
session_typestringNoOmitting session_type selects a cloud session. Every remote-control request must use session_type=remote and provide a nonempty device_id. Providing device_id for a cloud session, an empty or unknown type, or duplicate target parameters returns 422 VALIDATION_ERROR. Cross-device aggregated lists and automatic fallback to cloud are not provided. Both types use the same authentication chain; the open platform validates the corresponding Scope declared by each endpoint.
Default: "cloud"
Allowed values: ["cloud", "remote"]
device_idstringNoRequired only for remote control. An opaque target device identifier from device discovery; it must be URL-encoded. The target connection must be signed in to the currently authenticated account.
Minimum length: 1
Maximum length: 256

Request body

The public contract declares no request body. Do not add identity fields or undeclared business fields.

Successful responses

Preserve the original response structure of each business endpoint; do not add a common code/msg/data wrapper.

HTTP 200

Success Response type: application/json
FieldTypeRequiredDescription and constraints
$schemastringNoAt least one of: branch 1
URL of the JSON Schema for this object.
Format: "uri"
childrenarrayYesAt least one of: branch 1
Child sessions spawned by this session, up to 15. An empty array when none exist. Each child session is itself a session—call GET /sessions/{child_id} for full details.
children[]objectNoAt least one of: branch 1
Additional fields: false
children[].namestringYesAt least one of: branch 1
Display name of the child session.
children[].session_idstringYesAt least one of: branch 1
Child session id. Use GET /sessions/{session_id} for full details.
children[].statusstringYesAt least one of: branch 1
Current status of the child session.
clientstringNoAt least one of: branch 1
Immutable creation source; later prompts do not change it.
created_atstringYesAt least one of: branch 1
When the session was created. ISO 8601, with microseconds and timezone, for example 2026-08-24T09:15:04.123456+00:00.
current_turnobject | nullYesAt least one of: branch 1
The turn in progress, or null if none. A turn blocked by a question counts as in progress—it continues after an answer, so this may be nonempty when status is action_required. Use its turn_id to correlate the POST /prompt response, event stream, and GET /turns/&#123;turn_id&#125;.

⚠️ At turn boundaries, this field and status may disagree for a few hundred milliseconds, because they have different writers: a new turn appears here immediately when it starts, while status waits for the agent's own report (an observed 144ms window still showed status as idle). Treat persistent, not transient, inconsistencies as problems; use current_turn to determine whether anything can be cancelled.
current_turnobjectYesAt least one of: branch 1 At least one of: branch 1
Additional fields: false
current_turn.started_atstringYesAt least one of: branch 1 At least one of: branch 1
When this turn started. ISO 8601, with microseconds and timezone. Always populated: a turn appears in current_turn only after its start has been recorded. Prompts that are queued but not yet started appear in GET /prompt-queue, not here.
current_turn.turn_idstringYesAt least one of: branch 1 At least one of: branch 1
This turn's id. Pass it to GET /sessions/{id}/turns/{turn_id}, or correlate it with turn_id on events.
current_turnnullYesAt least one of: branch 1 At least one of: branch 2
—
cursorintegerYesAt least one of: branch 1
The latest event's seq_id in this session. Pass it as ?cursor= to GET /events to read subsequent events, or persist it to resume after a restart. 0 means no cursor is available: either the session has no events yet, or this value could not be read for this request. Keep your existing cursor in that case; do not store 0 as a position.
Format: "int64"
end_reasonstring | nullYesAt least one of: branch 1
Why the session ended, or null if it has not ended. Populated only when status is terminated. Open enum—treat unrecognized values as abnormal termination.
ended_atstring | nullYesAt least one of: branch 1
When the session ended, or null while alive. ISO 8601, in the same format as created_at.
errorobject | nullYesAt least one of: branch 1
Structured failure details, or null if there is no failure. Present on abnormal termination.
errorobjectYesAt least one of: branch 1 At least one of: branch 1
Additional fields: false
error.categorystringNoAt least one of: branch 1 At least one of: branch 1
Problem category: quota, auth, permission, rate_limit, model_unavailable, timeout, content_rejected, input_too_large, input_invalid, limit_reached, service_error, or unknown. Open enum. For classification and statistics; branch on remedy instead, because the same category can require different actions. Treat unrecognized values as unknown.
error.codestringYesAt least one of: branch 1 At least one of: branch 1
Machine-readable failure code. Open enum. Branch on known codes and handle the rest as generic failures.
error.messagestringYesAt least one of: branch 1 At least one of: branch 1
Human-readable explanation for logs and operational displays. The wording is not part of the contract and may change.
error.remedystringNoAt least one of: branch 1 At least one of: branch 1
Action required to resolve the error: retry, retry_after_backoff, switch_model, new_session, modify_input, reauthenticate, top_up_quota, contact_admin, refresh, or report. Open enum. Branch on this field. retry and retry_after_backoff mean the same request can be resent; all other values require a change first. new_session means the problem affects the entire session: create a new session instead of merely changing the prompt. Treat unrecognized values as requiring a change first.
error.trace_idstringNoAt least one of: branch 1 At least one of: branch 1
Server trace id, identical to the X-Request-Id response header. Include it when reporting a problem—we use it to locate the request.
errornullYesAt least one of: branch 1 At least one of: branch 2
—
extra_dataobjectNoAt least one of: branch 1
Public creation metadata. An opaque creation context string is not inherited by later prompts.
modestringYesAt least one of: branch 1
The capability tier this session runs on. Open enum; GET /session-modes returns available values.
multi_agentobjectYesAt least one of: branch 1
Sub-agent configuration for this session.
Additional fields: false
multi_agent.child_modestringNoAt least one of: branch 1
Pin child sessions to a mode. If unset, they inherit the current session's mode—useful for running child sessions on a cheaper tier.
multi_agent.enabledboolean | nullYesAt least one of: branch 1
Whether the agent can spawn child sessions. Each child occupies its own runtime, so enabling this increases compute consumption. Child sessions appear in the children array of GET /sessions/{id}.
namestringYesAt least one of: branch 1
Display name. Generated from the first prompt when omitted.
operation_controlobject | nullNoAt least one of: branch 1
—
operation_controlobjectNoAt least one of: branch 1 At least one of: branch 1
Additional fields: false
operation_control.owner_typestringYesAt least one of: branch 1 At least one of: branch 1
Allowed values: ["personal_assistant", "user"]
operation_control.release_atstring | nullNoAt least one of: branch 1 At least one of: branch 1
—
operation_control.revisionstringYesAt least one of: branch 1 At least one of: branch 1
—
operation_control.session_statusstringYesAt least one of: branch 1 At least one of: branch 1
—
operation_controlnullNoAt least one of: branch 1 At least one of: branch 2
—
parent_session_idstring | nullYesAt least one of: branch 1
The session that spawned this one; null for a top-level session.
pending_actionobject | nullYesAt least one of: branch 1
The question this session is waiting to have answered, or null if none. Non-null if and only if status is action_required. Includes the full question content and the tool_call_id required for POST /sessions/{id}/question-response.
pending_actionobjectYesAt least one of: branch 1 At least one of: branch 1
Additional fields: false
pending_action.asked_atstringYesAt least one of: branch 1 At least one of: branch 1
When the agent asked the question. ISO 8601, with microseconds and timezone. The turn has been consuming wall-clock time since then, so treat older values as urgent.
pending_action.questionsarrayYesAt least one of: branch 1 At least one of: branch 1
Questions to display, ready to render. Usually only one. Answer in the same order in the answers array.
pending_action.questions[]objectNoAt least one of: branch 1 At least one of: branch 1
Additional fields: false
pending_action.questions[].headerstringNoAt least one of: branch 1 At least one of: branch 1
Optional short label for the question, suitable as a heading above it.
pending_action.questions[].multi_selectbooleanYesAt least one of: branch 1 At least one of: branch 1
true means the agent requests multiple selections. ⚠️ The answer field accepts only one string per question, so multiple selections are written as text in that entry for the agent to interpret, not parsed—see updated_input.answers in POST /question-response. When false, return exactly one label.
pending_action.questions[].optionsarrayNoAt least one of: branch 1 At least one of: branch 1
List of options. When empty, this is a free-text question and any text is a valid answer.
pending_action.questions[].options[]objectNoAt least one of: branch 1 At least one of: branch 1
Additional fields: false
pending_action.questions[].options[].descriptionstringNoAt least one of: branch 1 At least one of: branch 1
Optional additional explanation of what selecting this option means.
pending_action.questions[].options[].labelstringYesAt least one of: branch 1 At least one of: branch 1
Return this string unchanged when answering. It identifies the option; it is not just display text.
pending_action.questions[].questionstringYesAt least one of: branch 1 At least one of: branch 1
Question text to display.
pending_action.tool_call_idstringYesAt least one of: branch 1 At least one of: branch 1
Return this as tool_call_id in POST /sessions/{id}/question-response. It associates the answer with the question asked.
pending_actionnullYesAt least one of: branch 1 At least one of: branch 2
—
session_idstringYesAt least one of: branch 1
Session id, as returned by POST /sessions.
session_typestringYesAt least one of: branch 1
Allowed values: ["cloud"]
statusstringYesAt least one of: branch 1
Current session state. See the Status schema for the meaning of each value. This field is the complete answer—there is no second state to reconcile with it.
updated_atstringYesAt least one of: branch 1
When the session record last changed. ISO 8601, in the same format as created_at.
$schemastringNoAt least one of: branch 2
URL of the JSON Schema for this object.
Format: "uri"
created_atstringYesAt least one of: branch 2
—
current_turn_idstring | nullYesAt least one of: branch 2
—
device_idstringYesAt least one of: branch 2
—
execution_context_availablebooleanYesAt least one of: branch 2
Whether the current turn and interaction context can be reliably recovered. false means unknown, not idle.
extra_dataobjectNoAt least one of: branch 2
Display-compatibility metadata confirmed as saved by the target desktop. Absent if the marker was not saved.
Additional fields: false
extra_data.eva_audio_streamobjectNoAt least one of: branch 2
Pass {} to set the EVA voice display-compatibility marker for the session. QwenWork hides background_hint blocks in requests and tts_summary blocks in responses. Omit for normal session display. Only an empty object is accepted, not null.
Additional fields: false
modestring | nullYesAt least one of: branch 2
—
namestring | nullYesAt least one of: branch 2
—
pending_requestsarray | nullYesAt least one of: branch 2
—
pending_requests[]objectNoAt least one of: branch 2
Additional fields: false
pending_requests[].answer_supportedbooleanYesAt least one of: branch 2
—
pending_requests[].requestobjectYesAt least one of: branch 2
Additional fields: true
pending_requests[].request.idstringYesAt least one of: branch 2
Minimum length: 1
pending_requests[].request.jsonrpcstringYesAt least one of: branch 2
Allowed values: ["2.0"]
pending_requests[].request.methodstringYesAt least one of: branch 2
Allowed values: ["session/request_permission"]
pending_requests[].request.paramsobjectYesAt least one of: branch 2
Additional fields: true
pending_requests[].request.params._metaobject | nullNoAt least one of: branch 2
Additional fields: "Constrained by Schema; see the full contract"
pending_requests[].request.params.optionsarrayYesAt least one of: branch 2
—
pending_requests[].request.params.options[]objectNoAt least one of: branch 2
Additional fields: true
pending_requests[].request.params.options[]._metaobject | nullNoAt least one of: branch 2
Additional fields: "Constrained by Schema; see the full contract"
pending_requests[].request.params.options[].kindstringYesAt least one of: branch 2
Allowed values: ["allow_once", "allow_always", "reject_once", "reject_always"]
pending_requests[].request.params.options[].namestringYesAt least one of: branch 2
—
pending_requests[].request.params.options[].optionIdstringYesAt least one of: branch 2
Minimum length: 1
pending_requests[].request.params.sessionIdstringYesAt least one of: branch 2
Minimum length: 1
pending_requests[].request.params.toolCallobjectYesAt least one of: branch 2
Additional fields: true
pending_requests[].request.params.toolCall._metaobject | nullNoAt least one of: branch 2
Additional fields: "Constrained by Schema; see the full contract"
pending_requests[].request.params.toolCall.contentarray | nullNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.content[]objectNoAt least one of: branch 2
Additional fields: true
pending_requests[].request.params.toolCall.content[].typestringYesAt least one of: branch 2
—
pending_requests[].request.params.toolCall.kindstringNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.locationsarrayNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.locations[]objectNoAt least one of: branch 2
Additional fields: true
pending_requests[].request.params.toolCall.locations[]._metaobject | nullNoAt least one of: branch 2
Additional fields: "Constrained by Schema; see the full contract"
pending_requests[].request.params.toolCall.locations[].lineintegerNoAt least one of: branch 2
Format: "int32"
Minimum (inclusive): 0
pending_requests[].request.params.toolCall.locations[].pathstringYesAt least one of: branch 2
—
pending_requests[].request.params.toolCall.rawInputobjectNoAt least one of: branch 2
Additional fields: true
pending_requests[].request.params.toolCall.rawInput.questionsarrayNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.rawInput.questions[]objectNoAt least one of: branch 2
Additional fields: false
pending_requests[].request.params.toolCall.rawInput.questions[].headerstringNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.rawInput.questions[].multiSelectbooleanNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.rawInput.questions[].optionsarrayNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.rawInput.questions[].options[]objectNoAt least one of: branch 2
Additional fields: false
pending_requests[].request.params.toolCall.rawInput.questions[].options[].descriptionstringNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.rawInput.questions[].options[].labelstringYesAt least one of: branch 2
—
pending_requests[].request.params.toolCall.rawInput.questions[].questionstringYesAt least one of: branch 2
—
pending_requests[].request.params.toolCall.rawOutputUnrestrictedNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.statusstringNoAt least one of: branch 2
Allowed values: ["pending", "in_progress", "completed", "failed", null]
pending_requests[].request.params.toolCall.titlestringNoAt least one of: branch 2
—
pending_requests[].request.params.toolCall.toolCallIdstringYesAt least one of: branch 2
Minimum length: 1
pending_requests[].turn_idstring | nullYesAt least one of: branch 2
—
pending_requests[].unsupported_reasonstring | nullYesAt least one of: branch 2
Allowed values: ["REQUIRES_FORM", "UNSUPPORTED_RESPONSE", "INSUFFICIENT_DISPLAY", "RESPONSE_IN_PROGRESS", null]
session_idstringYesAt least one of: branch 2
—
session_typestringYesAt least one of: branch 2
Allowed values: ["remote"]
statusstringYesAt least one of: branch 2
Desktop running state. An open set; callers must tolerate unknown values.
updated_atstringYesAt least one of: branch 2
—

Error responses

HTTPDescription and handling
defaultError. Branch on code, not just the HTTP status code—multiple conditions can share the same status code.
Retain the request ID and error fields in the response for troubleshooting. A write operation may already have taken effect after a timeout or disconnection. Do not automatically retry merely because no successful response was received.

Full field contract

The JSON below contains the complete request, response, and error schemas, nested constraints, and public extension definitions for this endpoint. Copy it for verification. Success examples not declared in the contract are not inferred.
{
  "components": {
    "schemas": {
      "SessionPublicAcpPermissionRequest": {
        "additionalProperties": true,
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string"
          },
          "jsonrpc": {
            "enum": [
              "2.0"
            ],
            "type": "string"
          },
          "method": {
            "enum": [
              "session/request_permission"
            ],
            "type": "string"
          },
          "params": {
            "$ref": "#/components/schemas/SessionPublicRequestPermissionRequest"
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "type": "object"
      },
      "SessionPublicAcpQuestion": {
        "additionalProperties": false,
        "properties": {
          "header": {
            "type": "string"
          },
          "multiSelect": {
            "type": "boolean"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/SessionPublicAcpQuestionOption"
            },
            "type": "array"
          },
          "question": {
            "type": "string"
          }
        },
        "required": [
          "question"
        ],
        "type": "object"
      },
      "SessionPublicAcpQuestionOption": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label"
        ],
        "type": "object"
      },
      "SessionPublicChildRef": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "Display name of the child session.",
            "examples": [
              "Analyse Q3 region east"
            ],
            "type": "string"
          },
          "session_id": {
            "description": "Child session id. Use GET /sessions/{session_id} for full details.",
            "examples": [
              "c1d4e7f0-9a2b-4c68-b135-7e0d2a961f8c"
            ],
            "type": "string"
          },
          "status": {
            "description": "Current status of the child session.",
            "examples": [
              "running"
            ],
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "name",
          "status"
        ],
        "type": "object"
      },
      "SessionPublicCreateSessionExtraData": {
        "additionalProperties": false,
        "properties": {
          "eva_audio_stream": {
            "$ref": "#/components/schemas/SessionPublicEvaAudioStream",
            "description": "Pass {} to set the EVA voice display-compatibility marker for the session. QwenWork hides background_hint blocks in requests and tts_summary blocks in responses. Omit for normal session display. Only an empty object is accepted, not null."
          }
        },
        "type": "object"
      },
      "SessionPublicErrorBody": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "Stable machine-readable error code. Branch on it rather than the HTTP status code, because different conditions can share the same status. New codes may be added; treat unrecognized values as unexpected errors in that HTTP status class.",
            "examples": [
              "VALIDATION_ERROR"
            ],
            "type": "string"
          },
          "detail": {
            "description": "Structured context whose shape depends on code—for example, the fields rejected by validation. null when no additional information is available."
          },
          "message": {
            "description": "Human-readable explanation for logs and error displays. The wording is not part of the contract and may change without a version increment.",
            "examples": [
              "Request validation failed"
            ],
            "type": "string"
          },
          "trace_id": {
            "description": "W3C trace id for this request. Include it when reporting problems—it locates the request in platform logs. If the request carried no trace context, this is 32 zero characters.",
            "examples": [
              "00000000000000000000000000000000"
            ],
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "detail",
          "trace_id"
        ],
        "type": "object"
      },
      "SessionPublicEvaAudioStream": {
        "additionalProperties": false,
        "type": "object"
      },
      "SessionPublicMultiAgentConfig": {
        "additionalProperties": false,
        "properties": {
          "child_mode": {
            "description": "Pin child sessions to a mode. If unset, they inherit the current session's mode—useful for running child sessions on a cheaper tier.",
            "type": "string"
          },
          "enabled": {
            "description": "Whether the agent can spawn child sessions. Each child occupies its own runtime, so enabling this increases compute consumption. Child sessions appear in the children array of GET /sessions/{id}.",
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "SessionPublicOperationControl": {
        "additionalProperties": false,
        "properties": {
          "owner_type": {
            "enum": [
              "personal_assistant",
              "user"
            ],
            "type": "string"
          },
          "release_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "string"
          },
          "session_status": {
            "type": "string"
          }
        },
        "required": [
          "owner_type",
          "session_status",
          "revision"
        ],
        "type": "object"
      },
      "SessionPublicPendingAction": {
        "additionalProperties": false,
        "properties": {
          "asked_at": {
            "description": "When the agent asked the question. ISO 8601, with microseconds and timezone. The turn has been consuming wall-clock time since then, so treat older values as urgent.",
            "type": "string"
          },
          "questions": {
            "description": "Questions to display, ready to render. Usually only one. Answer in the same order in the answers array.",
            "items": {
              "$ref": "#/components/schemas/SessionPublicQuestion"
            },
            "type": "array"
          },
          "tool_call_id": {
            "description": "Return this as tool_call_id in POST /sessions/{id}/question-response. It associates the answer with the question asked.",
            "type": "string"
          }
        },
        "required": [
          "tool_call_id",
          "asked_at",
          "questions"
        ],
        "type": "object"
      },
      "SessionPublicPermissionOption": {
        "additionalProperties": true,
        "properties": {
          "_meta": {
            "additionalProperties": {},
            "type": [
              "object",
              "null"
            ]
          },
          "kind": {
            "enum": [
              "allow_once",
              "allow_always",
              "reject_once",
              "reject_always"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "optionId": {
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "kind",
          "name",
          "optionId"
        ],
        "type": "object"
      },
      "SessionPublicQuestion": {
        "additionalProperties": false,
        "properties": {
          "header": {
            "description": "Optional short label for the question, suitable as a heading above it.",
            "type": "string"
          },
          "multi_select": {
            "description": "true means the agent requests multiple selections. ⚠️ The answer field **accepts only one string per question**, so multiple selections are written as text in that entry for the agent to interpret, not parsed—see `updated_input.answers` in `POST /question-response`. When false, return exactly one label.",
            "type": "boolean"
          },
          "options": {
            "description": "List of options. When empty, this is a free-text question and any text is a valid answer.",
            "items": {
              "$ref": "#/components/schemas/SessionPublicQuestionOption"
            },
            "type": "array"
          },
          "question": {
            "description": "Question text to display.",
            "type": "string"
          }
        },
        "required": [
          "question",
          "multi_select"
        ],
        "type": "object"
      },
      "SessionPublicQuestionOption": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "description": "Optional additional explanation of what selecting this option means.",
            "type": "string"
          },
          "label": {
            "description": "Return this string unchanged when answering. It identifies the option; it is not just display text.",
            "type": "string"
          }
        },
        "required": [
          "label"
        ],
        "type": "object"
      },
      "SessionPublicRemotePendingPermissionRequest": {
        "additionalProperties": false,
        "properties": {
          "answer_supported": {
            "type": "boolean"
          },
          "request": {
            "$ref": "#/components/schemas/SessionPublicAcpPermissionRequest"
          },
          "turn_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "unsupported_reason": {
            "enum": [
              "REQUIRES_FORM",
              "UNSUPPORTED_RESPONSE",
              "INSUFFICIENT_DISPLAY",
              "RESPONSE_IN_PROGRESS",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "turn_id",
          "request",
          "answer_supported",
          "unsupported_reason"
        ],
        "type": "object"
      },
      "SessionPublicRemoteSessionDetail": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/RemoteSessionDetail.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "current_turn_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "device_id": {
            "type": "string"
          },
          "execution_context_available": {
            "description": "Whether the current turn and interaction context can be reliably recovered. false means unknown, not idle.",
            "type": "boolean"
          },
          "extra_data": {
            "$ref": "#/components/schemas/SessionPublicCreateSessionExtraData",
            "description": "Display-compatibility metadata confirmed as saved by the target desktop. Absent if the marker was not saved."
          },
          "mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "pending_requests": {
            "items": {
              "$ref": "#/components/schemas/SessionPublicRemotePendingPermissionRequest"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "session_id": {
            "type": "string"
          },
          "session_type": {
            "enum": [
              "remote"
            ],
            "type": "string"
          },
          "status": {
            "description": "Desktop running state. An open set; callers must tolerate unknown values.",
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "current_turn_id",
          "pending_requests",
          "execution_context_available",
          "session_type",
          "session_id",
          "device_id",
          "name",
          "mode",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SessionPublicRequestPermissionRequest": {
        "additionalProperties": true,
        "properties": {
          "_meta": {
            "additionalProperties": {},
            "type": [
              "object",
              "null"
            ]
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/SessionPublicPermissionOption"
            },
            "type": "array"
          },
          "sessionId": {
            "minLength": 1,
            "type": "string"
          },
          "toolCall": {
            "$ref": "#/components/schemas/SessionPublicToolCallUpdate"
          }
        },
        "required": [
          "options",
          "sessionId",
          "toolCall"
        ],
        "type": "object"
      },
      "SessionPublicSessionDetail": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/SessionDetail.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "children": {
            "description": "Child sessions spawned by this session, up to 15. An empty array when none exist. Each child session is itself a session—call GET /sessions/{child_id} for full details.",
            "items": {
              "$ref": "#/components/schemas/SessionPublicChildRef"
            },
            "type": "array"
          },
          "client": {
            "description": "Immutable creation source; later prompts do not change it.",
            "type": "string"
          },
          "created_at": {
            "description": "When the session was created. ISO 8601, with microseconds and timezone, for example 2026-08-24T09:15:04.123456+00:00.",
            "examples": [
              "2026-08-24T09:15:04.123456+00:00"
            ],
            "type": "string"
          },
          "current_turn": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionPublicTurnRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "The turn in progress, or null if none. A turn blocked by a question **counts** as in progress—it continues after an answer, so this may be nonempty when `status` is `action_required`. Use its `turn_id` to correlate the `POST /prompt` response, event stream, and `GET /turns/{turn_id}`.\n\n⚠️ **At turn boundaries, this field and `status` may disagree for a few hundred milliseconds**, because they have **different writers**: a new turn appears here immediately when it starts, while `status` waits for the agent's own report (an observed 144ms window still showed `status` as `idle`). Treat **persistent**, not transient, inconsistencies as problems; use `current_turn` to determine whether anything can be cancelled."
          },
          "cursor": {
            "description": "The latest event's seq_id in this session. Pass it as ?cursor= to GET /events to read subsequent events, or persist it to resume after a restart. 0 means no cursor is available: either the session has no events yet, or this value could not be read for this request. Keep your existing cursor in that case; do not store 0 as a position.",
            "format": "int64",
            "type": "integer"
          },
          "end_reason": {
            "description": "Why the session ended, or null if it has not ended. Populated only when status is terminated. Open enum—treat unrecognized values as abnormal termination.",
            "examples": [
              "completed"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "ended_at": {
            "description": "When the session ended, or null while alive. ISO 8601, in the same format as created_at.",
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionPublicSessionError"
              },
              {
                "type": "null"
              }
            ],
            "description": "Structured failure details, or null if there is no failure. Present on abnormal termination."
          },
          "extra_data": {
            "description": "Public creation metadata. An opaque creation context string is not inherited by later prompts.",
            "type": "object"
          },
          "mode": {
            "description": "The capability tier this session runs on. Open enum; GET /session-modes returns available values.",
            "examples": [
              "flash"
            ],
            "type": "string"
          },
          "multi_agent": {
            "$ref": "#/components/schemas/SessionPublicMultiAgentConfig",
            "description": "Sub-agent configuration for this session."
          },
          "name": {
            "description": "Display name. Generated from the first prompt when omitted.",
            "examples": [
              "Summarise sales.csv"
            ],
            "type": "string"
          },
          "operation_control": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionPublicOperationControl"
              },
              {
                "type": "null"
              }
            ]
          },
          "parent_session_id": {
            "description": "The session that spawned this one; null for a top-level session.",
            "type": [
              "string",
              "null"
            ]
          },
          "pending_action": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionPublicPendingAction"
              },
              {
                "type": "null"
              }
            ],
            "description": "The question this session is waiting to have answered, or null if none. Non-null if and only if status is action_required. Includes the full question content and the tool_call_id required for POST /sessions/{id}/question-response."
          },
          "session_id": {
            "description": "Session id, as returned by POST /sessions.",
            "examples": [
              "0b9f2c14-6d3a-4f18-9c27-8ae5d1b47f30"
            ],
            "type": "string"
          },
          "session_type": {
            "enum": [
              "cloud"
            ],
            "type": "string"
          },
          "status": {
            "description": "Current session state. See the Status schema for the meaning of each value. This field is the complete answer—there is no second state to reconcile with it.",
            "examples": [
              "running"
            ],
            "type": "string"
          },
          "updated_at": {
            "description": "When the session record last changed. ISO 8601, in the same format as created_at.",
            "examples": [
              "2026-08-24T09:16:22.905311+00:00"
            ],
            "type": "string"
          }
        },
        "required": [
          "session_type",
          "session_id",
          "status",
          "name",
          "mode",
          "current_turn",
          "pending_action",
          "end_reason",
          "error",
          "cursor",
          "multi_agent",
          "parent_session_id",
          "children",
          "created_at",
          "updated_at",
          "ended_at"
        ],
        "type": "object"
      },
      "SessionPublicSessionError": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "description": "Problem category: quota, auth, permission, rate_limit, model_unavailable, timeout, content_rejected, input_too_large, input_invalid, limit_reached, service_error, or unknown. Open enum. For classification and statistics; branch on remedy instead, because the same category can require different actions. Treat unrecognized values as unknown.",
            "type": "string"
          },
          "code": {
            "description": "Machine-readable failure code. Open enum. Branch on known codes and handle the rest as generic failures.",
            "type": "string"
          },
          "message": {
            "description": "Human-readable explanation for logs and operational displays. The wording is not part of the contract and may change.",
            "type": "string"
          },
          "remedy": {
            "description": "Action required to resolve the error: retry, retry_after_backoff, switch_model, new_session, modify_input, reauthenticate, top_up_quota, contact_admin, refresh, or report. Open enum. Branch on this field. retry and retry_after_backoff mean the same request can be resent; all other values require a change first. new_session means the problem affects the entire session: create a new session instead of merely changing the prompt. Treat unrecognized values as requiring a change first.",
            "type": "string"
          },
          "trace_id": {
            "description": "Server trace id, identical to the X-Request-Id response header. Include it when reporting a problem—we use it to locate the request.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "SessionPublicToolCallLocation": {
        "additionalProperties": true,
        "properties": {
          "_meta": {
            "additionalProperties": {},
            "type": [
              "object",
              "null"
            ]
          },
          "line": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "path"
        ],
        "type": "object"
      },
      "SessionPublicToolCallUpdate": {
        "additionalProperties": true,
        "properties": {
          "_meta": {
            "additionalProperties": {},
            "type": [
              "object",
              "null"
            ]
          },
          "content": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "kind": {
            "type": "string"
          },
          "locations": {
            "items": {
              "$ref": "#/components/schemas/SessionPublicToolCallLocation"
            },
            "type": "array"
          },
          "rawInput": {
            "additionalProperties": true,
            "examples": [
              {
                "command": "pwd",
                "justification": "Read the working directory",
                "sandbox_permissions": "require_escalated"
              }
            ],
            "properties": {
              "questions": {
                "items": {
                  "$ref": "#/components/schemas/SessionPublicAcpQuestion"
                },
                "type": "array"
              }
            }
          },
          "rawOutput": {},
          "status": {
            "enum": [
              "pending",
              "in_progress",
              "completed",
              "failed",
              null
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "toolCallId": {
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "toolCallId"
        ],
        "type": "object"
      },
      "SessionPublicTurnRef": {
        "additionalProperties": false,
        "properties": {
          "started_at": {
            "description": "When this turn started. ISO 8601, with microseconds and timezone. **Always populated**: a turn appears in `current_turn` only after its start has been recorded. Prompts that are queued but not yet started appear in `GET /prompt-queue`, not here.",
            "examples": [
              "2026-08-24T09:15:04.123456+00:00"
            ],
            "type": "string"
          },
          "turn_id": {
            "description": "This turn's id. Pass it to GET /sessions/{id}/turns/{turn_id}, or correlate it with turn_id on events.",
            "examples": [
              "2f7a1e88-4c05-4b93-8d61-3ea90c5b7d24"
            ],
            "type": "string"
          }
        },
        "required": [
          "turn_id",
          "started_at"
        ],
        "type": "object"
      },
      "SessionRelayError": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "error_description",
          "error_code"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "OpenPlatformBearer": {
        "description": "Authorization: Bearer <access_token>; JSON Content-Type: application/json; charset=utf-8. The current CN Review temporarily allows access only for routing debugging.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/session/sessions/{session_id}": {
      "get": {
        "description": "Omitting session_type selects a cloud session. Every remote-control request must use session_type=remote and provide a nonempty device_id. Providing device_id for a cloud session, an empty or unknown type, or duplicate target parameters returns 422 VALIDATION_ERROR. Cross-device aggregated lists and automatic fallback to cloud are not provided. Both types use the same authentication chain; the open platform validates the corresponding Scope declared by each endpoint.\n\nCloud sessions:\nReturns the current session state:\n\n- `status`—one of `starting`, `idle`, `running`, `action_required`, or `terminated`\n- `pending_action`—a question awaiting an answer, including its content and the `tool_call_id` needed to answer. Non-null if and only if `status` is `action_required`\n- `current_turn`—the executing turn, used to correlate prompts and events\n- `cursor`—the latest event's `seq_id`, used to resume reading the event stream\n- `children`—summaries of child sessions, up to 15\n\n`status` is the authoritative value for what the session is doing; the other fields remain consistent with it.\n\nRemote-control sessions:\nShares public gateway authentication with cloud sessions; this endpoint requires the business Scope stated below. No controller device ID or pairing is required. The target remote-control master switch must be enabled. If explicitly disabled, returns 403 FORBIDDEN with detail.reason=ACP_HOST_DISABLED; rejected write requests return detail.acceptance=not_accepted. An explicitly nonexistent session returns 404 NOT_FOUND with detail.reason=SESSION_NOT_FOUND. Commands route only to target connections signed in to the currently authenticated account. Offline targets, unknown targets, and targets belonging to other accounts all return device unavailable. Unknown request body fields are rejected. Reads the desktop's current execution context without scanning history. pending_requests retains complete safe ACP requests, including options and tool input. Any pending permission request yields action_required, including requests answerable only on the desktop. execution_context_available=false means context is unknown, and both current_turn_id and pending_requests are null; when no pending requests are known to exist, pending_requests is []. No fallback to history scanning is provided for older desktops or unavailable capabilities. If the full context exceeds the response budget, treat it as unavailable rather than returning a partial pending set or an empty array. Prompt the user to handle it on the desktop; do not enter an automatic retry loop.\nCall through the open platform, retaining the existing oauth_app Token, identity resolution, application IP restrictions, and resource ownership checks. Cloud and remote-control parameters retain their actual contract semantics.",
        "operationId": "publishedGet-session",
        "parameters": [
          {
            "description": "Session identifier: a UUID for cloud sessions; an opaque identifier on the selected device for remote-control sessions.",
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Omitting session_type selects a cloud session. Every remote-control request must use session_type=remote and provide a nonempty device_id. Providing device_id for a cloud session, an empty or unknown type, or duplicate target parameters returns 422 VALIDATION_ERROR. Cross-device aggregated lists and automatic fallback to cloud are not provided. Both types use the same authentication chain; The upstream does not validate OAuth session scope; the open platform validates the corresponding Scope according to the manifest.",
            "in": "query",
            "name": "session_type",
            "schema": {
              "default": "cloud",
              "enum": [
                "cloud",
                "remote"
              ],
              "type": "string"
            }
          },
          {
            "description": "Required only for remote control. An opaque target device identifier from device discovery; it must be URL-encoded. The target connection must be signed in to the currently authenticated account.",
            "in": "query",
            "name": "device_id",
            "schema": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionPublicSessionDetail"
                    },
                    {
                      "$ref": "#/components/schemas/SessionPublicRemoteSessionDetail"
                    }
                  ]
                }
              }
            },
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, for log correlation and troubleshooting. Retries generate new IDs; this is not an idempotency key or distributed Trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open-platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if the sample was not retained.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionPublicErrorBody"
                    },
                    {
                      "$ref": "#/components/schemas/SessionRelayError"
                    }
                  ]
                }
              }
            },
            "description": "Error. Branch on `code`, not just the HTTP status code—multiple conditions can share the same status code.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, for log correlation and troubleshooting. Retries generate new IDs; this is not an idempotency key or distributed Trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open-platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if the sample was not retained.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "OpenPlatformBearer": []
          }
        ],
        "summary": "Get session status",
        "tags": [
          "会话管理"
        ],
        "x-session-variants": {
          "cloud": {
            "summary": "Get session status",
            "description": "Returns the current session state:\n\n- `status`—one of `starting`, `idle`, `running`, `action_required`, or `terminated`\n- `pending_action`—a question awaiting an answer, including its content and the `tool_call_id` needed to answer. Non-null if and only if `status` is `action_required`\n- `current_turn`—the executing turn, used to correlate prompts and events\n- `cursor`—the latest event's `seq_id`, used to resume reading the event stream\n- `children`—summaries of child sessions, up to 15\n\n`status` is the authoritative value for what the session is doing; the other fields remain consistent with it.",
            "parameters": [
              {
                "description": "Session ID returned by POST /sessions.",
                "in": "path",
                "name": "session_id",
                "required": true,
                "schema": {
                  "description": "Session ID returned by POST /sessions.",
                  "format": "uuid",
                  "type": "string"
                }
              }
            ],
            "requestBody": null,
            "responses": {
              "200": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicSessionDetail"
                    }
                  }
                },
                "description": "Success"
              }
            }
          },
          "remote": {
            "summary": "Get remote-control session status",
            "description": "Shares public gateway authentication with cloud sessions; this endpoint requires the business Scope stated below. No controller device ID or pairing is required. The target remote-control master switch must be enabled. If explicitly disabled, returns 403 FORBIDDEN with detail.reason=ACP_HOST_DISABLED; rejected write requests return detail.acceptance=not_accepted. An explicitly nonexistent session returns 404 NOT_FOUND with detail.reason=SESSION_NOT_FOUND. Commands route only to target connections signed in to the currently authenticated account. Offline targets, unknown targets, and targets belonging to other accounts all return device unavailable. Unknown request body fields are rejected. Reads the desktop's current execution context without scanning history. pending_requests retains complete safe ACP requests, including options and tool input. Any pending permission request yields action_required, including requests answerable only on the desktop. execution_context_available=false means context is unknown, and both current_turn_id and pending_requests are null; when no pending requests are known to exist, pending_requests is []. No fallback to history scanning is provided for older desktops or unavailable capabilities. If the full context exceeds the response budget, treat it as unavailable rather than returning a partial pending set or an empty array. Prompt the user to handle it on the desktop; do not enter an automatic retry loop.",
            "parameters": [
              {
                "description": "Opaque target device identifier, possibly including suffixes such as :dev. The target connection must belong to the currently authenticated account.",
                "explode": false,
                "in": "query",
                "name": "device_id",
                "required": true,
                "schema": {
                  "description": "Opaque target device identifier, possibly including suffixes such as :dev. The target connection must belong to the currently authenticated account.",
                  "maxLength": 256,
                  "type": "string"
                }
              },
              {
                "description": "Session identifier on the target device.",
                "in": "path",
                "name": "session_id",
                "required": true,
                "schema": {
                  "description": "Session identifier on the target device.",
                  "maxLength": 256,
                  "type": "string"
                }
              }
            ],
            "requestBody": null,
            "responses": {
              "200": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicRemoteSessionDetail"
                    }
                  }
                },
                "description": "Success"
              }
            }
          }
        },
        "x-supported-session-types": [
          "cloud",
          "remote"
        ]
      }
    }
  },
  "info": {
    "title": "Get session status",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.