Call requirements, permissions, request fields, response fields, and error handling.
Request and permissions
GET https://openapi.qwenwork.ai/v1/session/sessions/{session_id}/prompt-queue
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 prompts queued after the current turn, in execution order. Excludes the executing prompt, which appears in current_turn from GET /sessions/{session_id}.
Remote-control sessions: This operation returns 422 OPERATION_NOT_SUPPORTED without contacting the target device.
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
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 | URL of the JSON Schema for this object. Format: "uri" |
items | array | Yes | Prompts waiting to execute, in execution order. An empty array, never null, when the queue is empty. The executing prompt appears in current_turn from GET /sessions/{id}. |
items[] | object | No | Additional fields: false |
items[].created_at | string | null | Yes | When queued. ISO 8601, with microseconds and timezone. null when the queue entry has no timestamp—the queue is an ordered list, so use position, not this field, to determine order. |
items[].position | integer | Yes | Queue position; 1 means next to execute. Position 1 is not currently running—it starts after the current turn ends. Format: "int64" |
items[].prompt_id | string | Yes | While this prompt is still waiting, pass this to DELETE /sessions/{id}/prompt-queue/{prompt_id} to withdraw it. |
items[].text | string | Yes | Original prompt text as submitted. |
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