Skip to main content

Answer a pending question

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

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

Header parameters

ParameterTypeRequiredDescription and constraints
Idempotency-KeystringNoRemote-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.
FieldTypeRequiredDescription and constraints
$schemastringNoAt least one of: branch 1
URL of the JSON Schema for this object.
Format: "uri"
option_idstringNoAt 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.
outcomestringNoAt 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_idstringYesAt 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_inputobjectNoAt 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.answersarrayNoAt 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[]stringNoAt least one of: branch 1
—
$schemastringNoAt least one of: branch 2
URL of the JSON Schema for this object.
Format: "uri"
option_idstringNoAt least one of: branch 2
The original optionId value from the request. Required for selected; prohibited for cancelled.
Minimum length: 1
outcomestringYesAt least one of: branch 2
Allowed values: ["selected", "cancelled"]
permission_request_idstringYesAt 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_inputobjectNoAt least one of: branch 2
Additional fields: false
updated_input.answersarrayYesAt 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[]stringNoAt least one of: branch 2
Minimum length: 1
$schemastringNoAt least one of: branch 2 Exactly one of: branch 1
URL of the JSON Schema for this object.
Format: "uri"
option_idstringYesAt 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
outcomestringYesAt least one of: branch 2 Exactly one of: branch 1
Allowed values: ["selected"]
permission_request_idstringYesAt 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_inputobjectNoAt least one of: branch 2 Exactly one of: branch 1
Additional fields: false
updated_input.answersarrayYesAt 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[]stringNoAt least one of: branch 2 Exactly one of: branch 1
Minimum length: 1
outcomestringYesAt least one of: branch 2 Exactly one of: branch 2
Allowed values: ["cancelled"]
permission_request_idstringYesAt 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
FieldTypeRequiredDescription and constraints
$schemastringNoURL of the JSON Schema for this object.
Format: "uri"
acceptedbooleanYes—
session_idstringYes—

HTTP 202

Accepted Response type: application/json
FieldTypeRequiredDescription and constraints
$schemastringNoURL of the JSON Schema for this object.
Format: "uri"
statusstringYesAlways "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_idstringYesThe tool_call_id against which this answer was recorded, echoed for confirmation.

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": {
      "SessionPublicAnswerPayload": {
        "additionalProperties": false,
        "properties": {
          "answers": {
            "description": "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.\n\n⚠️ **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.**",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "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"
      },
      "SessionPublicQuestionResponseAck": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/QuestionResponseAck.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "status": {
            "description": "Always \"accepted\". The answer has been delivered and the turn resumes on its own. Poll GET /sessions/{id} to see it leave action_required.",
            "examples": [
              "accepted"
            ],
            "type": "string"
          },
          "tool_call_id": {
            "description": "The tool_call_id against which this answer was recorded, echoed for confirmation.",
            "type": "string"
          }
        },
        "required": [
          "tool_call_id",
          "status"
        ],
        "type": "object"
      },
      "SessionPublicQuestionResponseRequest": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/QuestionResponseRequest.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "option_id": {
            "description": "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.",
            "type": "string"
          },
          "outcome": {
            "description": "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\".",
            "enum": [
              "selected",
              "cancelled"
            ],
            "type": "string"
          },
          "tool_call_id": {
            "description": "Identifies the question being answered. Obtain it from pending_action.tool_call_id in GET /sessions/{id}.",
            "minLength": 1,
            "type": "string"
          },
          "updated_input": {
            "$ref": "#/components/schemas/SessionPublicAnswerPayload",
            "description": "The answer itself. Use this field for AskUserQuestion: include one answers entry per question, in the order listed in pending_action.questions."
          }
        },
        "required": [
          "tool_call_id"
        ],
        "type": "object"
      },
      "SessionPublicRemoteQuestionAnswerInput": {
        "additionalProperties": false,
        "properties": {
          "answers": {
            "description": "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.",
            "items": {
              "minLength": 1,
              "type": "string"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "answers"
        ],
        "type": "object"
      },
      "SessionPublicRemoteQuestionResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/RemoteQuestionResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "accepted": {
            "type": "boolean"
          },
          "session_id": {
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "accepted"
        ],
        "type": "object"
      },
      "SessionPublicRemoteQuestionResponseRequest": {
        "additionalProperties": false,
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "$schema": {
                "description": "URL of the JSON Schema for this object.",
                "examples": [
                  "https://example.com/schemas/RemoteQuestionResponseRequest.json"
                ],
                "format": "uri",
                "readOnly": true,
                "type": "string"
              },
              "option_id": {
                "description": "The original optionId value from the request. Required for selected; prohibited for cancelled.",
                "minLength": 1,
                "type": "string"
              },
              "outcome": {
                "enum": [
                  "selected"
                ],
                "type": "string"
              },
              "permission_request_id": {
                "description": "The top-level id of the original session/request_permission, not toolCallId or the SSE event id.",
                "minLength": 1,
                "type": "string"
              },
              "updated_input": {
                "$ref": "#/components/schemas/SessionPublicRemoteQuestionAnswerInput"
              }
            },
            "required": [
              "permission_request_id",
              "outcome",
              "option_id"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "outcome": {
                "enum": [
                  "cancelled"
                ],
                "type": "string"
              },
              "permission_request_id": {
                "description": "The top-level id of the original session/request_permission, not toolCallId or the SSE event id.",
                "minLength": 1,
                "type": "string"
              }
            },
            "required": [
              "permission_request_id",
              "outcome"
            ],
            "type": "object"
          }
        ],
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/RemoteQuestionResponseRequest.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "option_id": {
            "description": "The original optionId value from the request. Required for selected; prohibited for cancelled.",
            "minLength": 1,
            "type": "string"
          },
          "outcome": {
            "enum": [
              "selected",
              "cancelled"
            ],
            "type": "string"
          },
          "permission_request_id": {
            "description": "The top-level id of the original session/request_permission, not toolCallId or the SSE event id.",
            "minLength": 1,
            "type": "string"
          },
          "updated_input": {
            "$ref": "#/components/schemas/SessionPublicRemoteQuestionAnswerInput"
          }
        },
        "required": [
          "permission_request_id",
          "outcome"
        ],
        "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}/question-response": {
      "post": {
        "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:\nSubmit an answer when `status` is `action_required`. This applies to both agent questions and tool permission requests.\n\nObtain `tool_call_id` from `pending_action.tool_call_id` in `GET /sessions/{session_id}`.\n\n**Returns 202**, meaning the answer has been forwarded to the runtime, but the runtime may not have consumed it yet.\n\n202 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`.\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. 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.\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": "publishedAnswer-question",
        "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"
            }
          },
          {
            "description": "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.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "description": "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.",
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "cloud-answer": {
                  "value": {
                    "outcome": "selected",
                    "tool_call_id": "<tool-call-id>",
                    "updated_input": {
                      "answers": [
                        "Yes"
                      ]
                    }
                  }
                },
                "remote-answer": {
                  "value": {
                    "option_id": "allow",
                    "outcome": "selected",
                    "permission_request_id": "ask:session:question",
                    "updated_input": {
                      "answers": [
                        "Yes"
                      ]
                    }
                  }
                },
                "remote-cancelled": {
                  "value": {
                    "outcome": "cancelled",
                    "permission_request_id": "ask:session:question"
                  }
                },
                "remote-permission": {
                  "value": {
                    "option_id": "allow_once",
                    "outcome": "selected",
                    "permission_request_id": "perm:session:tool"
                  }
                }
              },
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SessionPublicQuestionResponseRequest"
                  },
                  {
                    "$ref": "#/components/schemas/SessionPublicRemoteQuestionResponseRequest"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionPublicRemoteQuestionResponse"
                }
              }
            },
            "description": "Remote-control sessions: 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"
                }
              }
            }
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionPublicQuestionResponseAck"
                }
              }
            },
            "description": "Accepted",
            "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": "Answer a pending question",
        "tags": [
          "会话管理"
        ],
        "x-session-variants": {
          "cloud": {
            "summary": "Answer a pending question",
            "description": "Submit an answer when `status` is `action_required`. This applies to both agent questions and tool permission requests.\n\nObtain `tool_call_id` from `pending_action.tool_call_id` in `GET /sessions/{session_id}`.\n\n**Returns 202**, meaning the answer has been forwarded to the runtime, but the runtime may not have consumed it yet.\n\n202 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`.",
            "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": {
              "content": {
                "application/json": {
                  "examples": {
                    "cloud-answer": {
                      "value": {
                        "outcome": "selected",
                        "tool_call_id": "<tool-call-id>",
                        "updated_input": {
                          "answers": [
                            "Yes"
                          ]
                        }
                      }
                    }
                  },
                  "schema": {
                    "$ref": "#/components/schemas/SessionPublicQuestionResponseRequest"
                  }
                }
              },
              "required": true
            },
            "responses": {
              "202": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicQuestionResponseAck"
                    }
                  }
                },
                "description": "Accepted"
              }
            }
          },
          "remote": {
            "summary": "Answer a pending permission request in a remote-control session",
            "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. 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.",
            "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"
                }
              },
              {
                "description": "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.",
                "in": "header",
                "name": "Idempotency-Key",
                "required": true,
                "schema": {
                  "description": "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.",
                  "maxLength": 128,
                  "minLength": 1,
                  "type": "string"
                }
              }
            ],
            "requestBody": {
              "content": {
                "application/json": {
                  "examples": {
                    "remote-answer": {
                      "value": {
                        "option_id": "allow",
                        "outcome": "selected",
                        "permission_request_id": "ask:session:question",
                        "updated_input": {
                          "answers": [
                            "Yes"
                          ]
                        }
                      }
                    },
                    "remote-cancelled": {
                      "value": {
                        "outcome": "cancelled",
                        "permission_request_id": "ask:session:question"
                      }
                    },
                    "remote-permission": {
                      "value": {
                        "option_id": "allow_once",
                        "outcome": "selected",
                        "permission_request_id": "perm:session:tool"
                      }
                    }
                  },
                  "schema": {
                    "$ref": "#/components/schemas/SessionPublicRemoteQuestionResponseRequest"
                  }
                }
              },
              "required": true
            },
            "responses": {
              "200": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicRemoteQuestionResponse"
                    }
                  }
                },
                "description": "Success"
              }
            }
          }
        },
        "x-supported-session-types": [
          "cloud",
          "remote"
        ]
      }
    }
  },
  "info": {
    "title": "Answer a pending question",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.