Call requirements, permissions, request fields, response fields, and error handling.
Request and permissions
POST https://openapi.qwenwork.ai/v1/session/sessions/{session_id}/question-response
Authentication: Authorization: Bearer <access_token>; use an access token obtained through user OAuth authorization.
Required business Scope: session.session.execute
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:
Submit an answer when status is action_required. This applies to both agent questions and tool permission requests.
Obtain tool_call_id from pending_action.tool_call_id in GET /sessions/{session_id}.
Returns 202, meaning the answer has been forwarded to the runtime, but the runtime may not have consumed it yet.
202 does not mean that tool_call_id is valid. If a different question is currently pending, this endpoint returns 409. If no question appears to be pending—including when the id has never existed—the answer is forwarded and 202 is returned. Read GET /sessions/{session_id} again to confirm that status has left action_required.
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. All write operations require Idempotency-Key. Do not retry automatically after a timeout or disconnection, even with the same key: acceptance may be unknown, desktop deduplication is bounded, and persistence across restarts is not guaranteed. Errors include detail.acceptance (not_accepted or unknown). No queuing, offline execution, or automatic fallback to cloud is provided. Obtain permission_request_id from the original ACP request.id in details or SSE, and option_id from params.options[].optionId. selected requires option_id; cancelled prohibits option_id and updated_input. Question answering uses ordered updated_input.answers. The desktop validates ownership of the current request, options, answer count, and supported interaction types. Complex forms are unsupported. Reading details or history first is not required. Returns 200 only after explicitly receiving accepted:true; returns service unavailable if the desktop lacks the capability.
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 |
Header parameters
| Parameter | Type | Required | Description and constraints |
|---|---|---|---|
Idempotency-Key | string | No | Remote-control sessions only: a stable key scoped to the account, device, session, and operation. Slashes, backslashes, whitespace, and control characters are not allowed. Credentials and controller IDs are not part of the key. A stable key scoped to the account, device, session, and operation. Slashes, backslashes, whitespace, and control characters are not allowed. Credentials and controller IDs are not part of the key. Minimum length: 1 Maximum length: 128 |
Request body
The request body is required.
application/json
A child field is required only when its containing object exists. Union branches are listed separately; this does not mean that fields from all branches are required simultaneously.
| 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" |
option_id | string | No | At least one of: branch 1 Usually unnecessary. Answers go in updated_input.answers—send the option label from pending_action.questions[].options[].label. This field is reserved for authorization prompts with option identifiers. Questions returned by this endpoint do not carry option ids, so leave it unset unless a response explicitly provides a value. |
outcome | string | No | At least one of: branch 1 Use "selected" to answer and "cancelled" to decline. cancelled also unblocks the turn: the agent continues without an answer rather than stopping. Defaults to "selected". Allowed values: ["selected", "cancelled"] |
tool_call_id | string | Yes | At least one of: branch 1 Identifies the question being answered. Obtain it from pending_action.tool_call_id in GET /sessions/{id}. Minimum length: 1 |
updated_input | object | No | At least one of: branch 1 The answer itself. Use this field for AskUserQuestion: include one answers entry per question, in the order listed in pending_action.questions. Additional fields: false |
updated_input.answers | array | No | At least one of: branch 1 One answer per question, in the order given by pending_action.questions. For questions with options, return the option label exactly as provided; for free-text questions, return any text.⚠️ Each entry is a string, so the structure cannot directly represent answers to multi_select questions. Put the selected labels in the same entry (for example, "春, 夏")—this text is sent unchanged to the agent for interpretation, so the result depends on the agent rather than this API. If the selection must be applied reliably, prefer single-select questions. |
updated_input.answers[] | string | No | At least one of: branch 1 — |
$schema | string | No | At least one of: branch 2 URL of the JSON Schema for this object. Format: "uri" |
option_id | string | No | At least one of: branch 2 The original optionId value from the request. Required for selected; prohibited for cancelled. Minimum length: 1 |
outcome | string | Yes | At least one of: branch 2 Allowed values: ["selected", "cancelled"] |
permission_request_id | string | Yes | At least one of: branch 2 The top-level id of the original session/request_permission, not toolCallId or the SSE event id. Minimum length: 1 |
updated_input | object | No | At least one of: branch 2 Additional fields: false |
updated_input.answers | array | Yes | At least one of: branch 2 Answers in the original question order: one nonempty string per question, with at most 8000 UTF-16 code units per question. The desktop validates the number of answers and whether this operation permits answers. Minimum items: 1 |
updated_input.answers[] | string | No | At least one of: branch 2 Minimum length: 1 |
$schema | string | No | At least one of: branch 2 Exactly one of: branch 1 URL of the JSON Schema for this object. Format: "uri" |
option_id | string | Yes | At least one of: branch 2 Exactly one of: branch 1 The original optionId value from the request. Required for selected; prohibited for cancelled. Minimum length: 1 |
outcome | string | Yes | At least one of: branch 2 Exactly one of: branch 1 Allowed values: ["selected"] |
permission_request_id | string | Yes | At least one of: branch 2 Exactly one of: branch 1 The top-level id of the original session/request_permission, not toolCallId or the SSE event id. Minimum length: 1 |
updated_input | object | No | At least one of: branch 2 Exactly one of: branch 1 Additional fields: false |
updated_input.answers | array | Yes | At least one of: branch 2 Exactly one of: branch 1 Answers in the original question order: one nonempty string per question, with at most 8000 UTF-16 code units per question. The desktop validates the number of answers and whether this operation permits answers. Minimum items: 1 |
updated_input.answers[] | string | No | At least one of: branch 2 Exactly one of: branch 1 Minimum length: 1 |
outcome | string | Yes | At least one of: branch 2 Exactly one of: branch 2 Allowed values: ["cancelled"] |
permission_request_id | string | Yes | At least one of: branch 2 Exactly one of: branch 2 The top-level id of the original session/request_permission, not toolCallId or the SSE event id. Minimum length: 1 |
Successful responses
Preserve the original response structure of each business endpoint; do not add a common code/msg/data wrapper.
HTTP 200
Remote-control sessions: Success
Response type: application/json
| Field | Type | Required | Description and constraints |
|---|---|---|---|
$schema | string | No | URL of the JSON Schema for this object. Format: "uri" |
accepted | boolean | Yes | — |
session_id | string | Yes | — |
HTTP 202
Accepted
Response type: application/json
| Field | Type | Required | Description and constraints |
|---|---|---|---|
$schema | string | No | URL of the JSON Schema for this object. Format: "uri" |
status | string | Yes | Always "accepted". The answer has been delivered and the turn resumes on its own. Poll GET /sessions/{id} to see it leave action_required. |
tool_call_id | string | Yes | The tool_call_id against which this answer was recorded, echoed for confirmation. |
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