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 ofstarting,idle,running,action_required, orterminatedpending_action—a question awaiting an answer, including its content and thetool_call_idneeded to answer. Non-null if and only ifstatusisaction_requiredcurrent_turn—the executing turn, used to correlate prompts and eventscursor—the latest event'sseq_id, used to resume reading the event streamchildren—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
| Parameter | Type | Required | Description and constraints |
|---|---|---|---|
session_id | string | Yes | Session 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
| Parameter | Type | Required | Description and constraints |
|---|---|---|---|
session_type | string | No | 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. Default: "cloud" Allowed values: ["cloud", "remote"] |
device_id | string | No | 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. 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
| Field | Type | Required | Description and constraints |
|---|---|---|---|
$schema | string | No | At least one of: branch 1 URL of the JSON Schema for this object. Format: "uri" |
children | array | Yes | At 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[] | object | No | At least one of: branch 1 Additional fields: false |
children[].name | string | Yes | At least one of: branch 1 Display name of the child session. |
children[].session_id | string | Yes | At least one of: branch 1 Child session id. Use GET /sessions/{session_id} for full details. |
children[].status | string | Yes | At least one of: branch 1 Current status of the child session. |
client | string | No | At least one of: branch 1 Immutable creation source; later prompts do not change it. |
created_at | string | Yes | At 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_turn | object | null | Yes | At 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/{turn_id}.⚠️ 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_turn | object | Yes | At least one of: branch 1 At least one of: branch 1 Additional fields: false |
current_turn.started_at | string | Yes | At 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_id | string | Yes | At 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_turn | null | Yes | At least one of: branch 1 At least one of: branch 2 — |
cursor | integer | Yes | At 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_reason | string | null | Yes | At 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_at | string | null | Yes | At least one of: branch 1 When the session ended, or null while alive. ISO 8601, in the same format as created_at. |
error | object | null | Yes | At least one of: branch 1 Structured failure details, or null if there is no failure. Present on abnormal termination. |
error | object | Yes | At least one of: branch 1 At least one of: branch 1 Additional fields: false |
error.category | string | No | At 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.code | string | Yes | At 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.message | string | Yes | At 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.remedy | string | No | At 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_id | string | No | At 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. |
error | null | Yes | At least one of: branch 1 At least one of: branch 2 — |
extra_data | object | No | At least one of: branch 1 Public creation metadata. An opaque creation context string is not inherited by later prompts. |
mode | string | Yes | At least one of: branch 1 The capability tier this session runs on. Open enum; GET /session-modes returns available values. |
multi_agent | object | Yes | At least one of: branch 1 Sub-agent configuration for this session. Additional fields: false |
multi_agent.child_mode | string | No | At 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.enabled | boolean | null | Yes | At 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}. |
name | string | Yes | At least one of: branch 1 Display name. Generated from the first prompt when omitted. |
operation_control | object | null | No | At least one of: branch 1 — |
operation_control | object | No | At least one of: branch 1 At least one of: branch 1 Additional fields: false |
operation_control.owner_type | string | Yes | At least one of: branch 1 At least one of: branch 1 Allowed values: ["personal_assistant", "user"] |
operation_control.release_at | string | null | No | At least one of: branch 1 At least one of: branch 1 — |
operation_control.revision | string | Yes | At least one of: branch 1 At least one of: branch 1 — |
operation_control.session_status | string | Yes | At least one of: branch 1 At least one of: branch 1 — |
operation_control | null | No | At least one of: branch 1 At least one of: branch 2 — |
parent_session_id | string | null | Yes | At least one of: branch 1 The session that spawned this one; null for a top-level session. |
pending_action | object | null | Yes | At 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_action | object | Yes | At least one of: branch 1 At least one of: branch 1 Additional fields: false |
pending_action.asked_at | string | Yes | At 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.questions | array | Yes | At 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[] | object | No | At least one of: branch 1 At least one of: branch 1 Additional fields: false |
pending_action.questions[].header | string | No | At 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_select | boolean | Yes | At 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[].options | array | No | At 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[] | object | No | At least one of: branch 1 At least one of: branch 1 Additional fields: false |
pending_action.questions[].options[].description | string | No | At least one of: branch 1 At least one of: branch 1 Optional additional explanation of what selecting this option means. |
pending_action.questions[].options[].label | string | Yes | At 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[].question | string | Yes | At least one of: branch 1 At least one of: branch 1 Question text to display. |
pending_action.tool_call_id | string | Yes | At 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_action | null | Yes | At least one of: branch 1 At least one of: branch 2 — |
session_id | string | Yes | At least one of: branch 1 Session id, as returned by POST /sessions. |
session_type | string | Yes | At least one of: branch 1 Allowed values: ["cloud"] |
status | string | Yes | At 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_at | string | Yes | At least one of: branch 1 When the session record last changed. ISO 8601, in the same format as created_at. |
$schema | string | No | At least one of: branch 2 URL of the JSON Schema for this object. Format: "uri" |
created_at | string | Yes | At least one of: branch 2 — |
current_turn_id | string | null | Yes | At least one of: branch 2 — |
device_id | string | Yes | At least one of: branch 2 — |
execution_context_available | boolean | Yes | At least one of: branch 2 Whether the current turn and interaction context can be reliably recovered. false means unknown, not idle. |
extra_data | object | No | At 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_stream | object | No | At 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 |
mode | string | null | Yes | At least one of: branch 2 — |
name | string | null | Yes | At least one of: branch 2 — |
pending_requests | array | null | Yes | At least one of: branch 2 — |
pending_requests[] | object | No | At least one of: branch 2 Additional fields: false |
pending_requests[].answer_supported | boolean | Yes | At least one of: branch 2 — |
pending_requests[].request | object | Yes | At least one of: branch 2 Additional fields: true |
pending_requests[].request.id | string | Yes | At least one of: branch 2 Minimum length: 1 |
pending_requests[].request.jsonrpc | string | Yes | At least one of: branch 2 Allowed values: ["2.0"] |
pending_requests[].request.method | string | Yes | At least one of: branch 2 Allowed values: ["session/request_permission"] |
pending_requests[].request.params | object | Yes | At least one of: branch 2 Additional fields: true |
pending_requests[].request.params._meta | object | null | No | At least one of: branch 2 Additional fields: "Constrained by Schema; see the full contract" |
pending_requests[].request.params.options | array | Yes | At least one of: branch 2 — |
pending_requests[].request.params.options[] | object | No | At least one of: branch 2 Additional fields: true |
pending_requests[].request.params.options[]._meta | object | null | No | At least one of: branch 2 Additional fields: "Constrained by Schema; see the full contract" |
pending_requests[].request.params.options[].kind | string | Yes | At least one of: branch 2 Allowed values: ["allow_once", "allow_always", "reject_once", "reject_always"] |
pending_requests[].request.params.options[].name | string | Yes | At least one of: branch 2 — |
pending_requests[].request.params.options[].optionId | string | Yes | At least one of: branch 2 Minimum length: 1 |
pending_requests[].request.params.sessionId | string | Yes | At least one of: branch 2 Minimum length: 1 |
pending_requests[].request.params.toolCall | object | Yes | At least one of: branch 2 Additional fields: true |
pending_requests[].request.params.toolCall._meta | object | null | No | At least one of: branch 2 Additional fields: "Constrained by Schema; see the full contract" |
pending_requests[].request.params.toolCall.content | array | null | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.content[] | object | No | At least one of: branch 2 Additional fields: true |
pending_requests[].request.params.toolCall.content[].type | string | Yes | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.kind | string | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.locations | array | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.locations[] | object | No | At least one of: branch 2 Additional fields: true |
pending_requests[].request.params.toolCall.locations[]._meta | object | null | No | At least one of: branch 2 Additional fields: "Constrained by Schema; see the full contract" |
pending_requests[].request.params.toolCall.locations[].line | integer | No | At least one of: branch 2 Format: "int32" Minimum (inclusive): 0 |
pending_requests[].request.params.toolCall.locations[].path | string | Yes | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.rawInput | object | No | At least one of: branch 2 Additional fields: true |
pending_requests[].request.params.toolCall.rawInput.questions | array | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.rawInput.questions[] | object | No | At least one of: branch 2 Additional fields: false |
pending_requests[].request.params.toolCall.rawInput.questions[].header | string | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.rawInput.questions[].multiSelect | boolean | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.rawInput.questions[].options | array | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.rawInput.questions[].options[] | object | No | At least one of: branch 2 Additional fields: false |
pending_requests[].request.params.toolCall.rawInput.questions[].options[].description | string | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.rawInput.questions[].options[].label | string | Yes | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.rawInput.questions[].question | string | Yes | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.rawOutput | Unrestricted | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.status | string | No | At least one of: branch 2 Allowed values: ["pending", "in_progress", "completed", "failed", null] |
pending_requests[].request.params.toolCall.title | string | No | At least one of: branch 2 — |
pending_requests[].request.params.toolCall.toolCallId | string | Yes | At least one of: branch 2 Minimum length: 1 |
pending_requests[].turn_id | string | null | Yes | At least one of: branch 2 — |
pending_requests[].unsupported_reason | string | null | Yes | At least one of: branch 2 Allowed values: ["REQUIRES_FORM", "UNSUPPORTED_RESPONSE", "INSUFFICIENT_DISPLAY", "RESPONSE_IN_PROGRESS", null] |
session_id | string | Yes | At least one of: branch 2 — |
session_type | string | Yes | At least one of: branch 2 Allowed values: ["remote"] |
status | string | Yes | At least one of: branch 2 Desktop running state. An open set; callers must tolerate unknown values. |
updated_at | string | Yes | At least one of: branch 2 — |
Error responses
| HTTP | Description and handling |
|---|---|
default | Error. Branch on code, not just the HTTP status code—multiple conditions can share the same status code. |
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.
Full OpenAPI JSON
Full OpenAPI JSON