Skip to main content

Cloud only: List turns and how they ended

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

Request and permissions

GET https://openapi.qwenwork.ai/v1/session/sessions/{session_id}/turns 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: One entry per turn, newest first. A turn appears here after execution starts; prompts still waiting appear in GET /sessions/{session_id}/prompt-queue.

Turn status

statusMeaning
runningExecuting
action_requiredExecuting, waiting for an answer—see pending_action
completedThe agent finished normally on its own
interruptedEnded by something outside the agent—see interrupt_reason
failedUnsuccessful—see stop_reason and error
ended_at is null if and only if status is running or action_required. pending_action is non-null if and only if status is action_required. It contains the question and the tool_call_id needed to answer via POST /sessions/{session_id}/question-response. Answering returns the turn to running rather than ending it; the agent continues and reports its conclusion later. cancelled is deprecated and no longer emitted. It covered both caller cancellation and runtime failure; these are now distinguished by interrupted plus interrupt_reason.

Retryability

status alone is insufficient: whether an interrupted turn is worth retrying depends on what interrupted it. interrupt_reason distinguishes these cases:
interrupt_reasonReasonRetryable
user_requestedThe caller cancelled the turnNo
runtime_restartedThe turn lost contact with its runtime, or its conclusion could not be deliveredYes
runtime_unavailableThe runtime became unavailableYes, after a delay
session_endedThe session ended while this turn was executingNo
action_required_timeoutThe pending question remained unansweredYes, also provide an answer
For failed, distinguish by stop_reason: refusal, max_tokens, and max_turn_requests are properties of the prompt itself, so retrying unchanged yields the same result. Other values can be retried after a delay. For upstream failures, error.category and error.remedy describe the required action. retry and retry_after_backoff mean the same request can be resent; other remedies require a change first. new_session means the problem affects every subsequent turn in this session. stop_reason alone does not indicate success: abnormal termination also reports end_turn. Use status. final_message in this response is truncated to 50000 characters; final_message_truncated indicates whether truncation occurred. Obtain the full text from GET /sessions/{session_id}/turns/{turn_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

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
cursorintegerNoOpaque pagination cursor; omit for the first page.
Opaque pagination cursor; omit for the first page.
Format: "int64"
Minimum (inclusive): 0
limitintegerNoNumber of entries per page.
Number of entries per page.
Default: 20
Format: "int64"
Minimum (inclusive): 1
Maximum (inclusive): 100
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
$schemastringNoURL of the JSON Schema for this object.
Format: "uri"
has_morebooleanYestrue means another page exists. Check this rather than inferring from a full page.
itemsarrayYesOne row per turn, newest first. An empty array, never null, when the session has no turns.
items[]objectNoAdditional fields: false
items[].channelstring | nullNoSource of this turn initiating prompt; null for unattributed historical turns.
items[].ended_atstring | nullYesWhen the turn ended, or null while still running. ISO 8601.
items[].errorobject | nullYesStructured failure details. null unless status is failed.
items[].errorobjectYesAt least one of: branch 1
Additional fields: false
items[].error.categorystringNoAt 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.
items[].error.codestringYesAt least one of: branch 1
Machine-readable failure code. Open enum. Branch on known codes and handle the rest as generic failures.
items[].error.messagestringYesAt least one of: branch 1
Human-readable explanation for logs and operational displays. The wording is not part of the contract and may change.
items[].error.remedystringNoAt 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.
items[].error.trace_idstringNoAt 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.
items[].errornullYesAt least one of: branch 2
—
items[].final_messagestring | nullYesThe agent's closing text for this turn, truncated in the list view. null when the turn ends with a tool call that has no user-facing output. This is the last contiguous text segment, not the full response; assemble the full response from agent_message_chunk events.
items[].final_message_truncatedbooleanYestrue means final_message in this response was truncated. Obtain the full text from GET /sessions/{id}/turns/{turn_id}.
items[].interrupt_reasonstring | nullYesWhat ended this turn. Non-null only when status is interrupted. Values: "user_requested", "runtime_restarted", "runtime_unavailable", "session_ended", or "action_required_timeout". Open enum; treat unrecognized values as non-retryable.
items[].metaobjectNoPublic metadata of the initiating prompt, when recorded.
Additional fields: false
items[].meta.pa_strstringNo—
items[].output_countinteger | nullYesNumber of output items from this turn. 0 means the turn's items array is empty. null means the count is unknown, not zero; read the turn details endpoint to obtain the list in that case.
Format: "int64"
items[].pending_actionobject | nullYesThe question blocking this turn, or null if none. Non-null if and only if status is action_required. Inlined in the list, not just the details, so identifying which entries need attention takes one request rather than N. Same shape as in GET /sessions/{id}.
items[].pending_actionobjectYesAt least one of: branch 1
Additional fields: false
items[].pending_action.asked_atstringYesAt 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.
items[].pending_action.questionsarrayYesAt least one of: branch 1
Questions to display, ready to render. Usually only one. Answer in the same order in the answers array.
items[].pending_action.questions[]objectNoAt least one of: branch 1
Additional fields: false
items[].pending_action.questions[].headerstringNoAt least one of: branch 1
Optional short label for the question, suitable as a heading above it.
items[].pending_action.questions[].multi_selectbooleanYesAt 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.
items[].pending_action.questions[].optionsarrayNoAt least one of: branch 1
List of options. When empty, this is a free-text question and any text is a valid answer.
items[].pending_action.questions[].options[]objectNoAt least one of: branch 1
Additional fields: false
items[].pending_action.questions[].options[].descriptionstringNoAt least one of: branch 1
Optional additional explanation of what selecting this option means.
items[].pending_action.questions[].options[].labelstringYesAt least one of: branch 1
Return this string unchanged when answering. It identifies the option; it is not just display text.
items[].pending_action.questions[].questionstringYesAt least one of: branch 1
Question text to display.
items[].pending_action.tool_call_idstringYesAt 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.
items[].pending_actionnullYesAt least one of: branch 2
—
items[].started_atstringYesWhen the turn started. ISO 8601, with microseconds and timezone.
items[].statusstringYesHow this turn ended, or whether it has not ended yet. See the TurnStatus schema—use this field, not stop_reason, to distinguish successful from abnormal termination.
items[].stop_reasonstring | nullYesThe agent's stop reason, for example end_turn or max_tokens. null while executing or if the turn ended before reporting. This value does not indicate success: abnormal termination also reports end_turn. Use status.
items[].turn_idstringYesThis turn's id. Pass to GET /sessions/{id}/turns/{turn_id} for the full version, including untruncated text and output items.
next_cursorintegerYesPass back as ?cursor= to get the next page. 0 when there is no next page.
Format: "int64"

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": {
      "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"
      },
      "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"
      },
      "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"
      },
      "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"
      },
      "SessionPublicTurnListResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/TurnListResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "has_more": {
            "description": "true means another page exists. Check this rather than inferring from a full page.",
            "type": "boolean"
          },
          "items": {
            "description": "One row per turn, newest first. An empty array, never null, when the session has no turns.",
            "items": {
              "$ref": "#/components/schemas/SessionPublicTurnSummary"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass back as ?cursor= to get the next page. 0 when there is no next page.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "next_cursor",
          "has_more"
        ],
        "type": "object"
      },
      "SessionPublicTurnSummary": {
        "additionalProperties": false,
        "properties": {
          "channel": {
            "description": "Source of this turn initiating prompt; null for unattributed historical turns.",
            "type": [
              "string",
              "null"
            ]
          },
          "ended_at": {
            "description": "When the turn ended, or null while still running. ISO 8601.",
            "examples": [
              "2026-08-24T09:16:22.905311+00:00"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionPublicSessionError"
              },
              {
                "type": "null"
              }
            ],
            "description": "Structured failure details. null unless status is failed."
          },
          "final_message": {
            "description": "The agent's closing text for this turn, truncated in the list view. null when the turn ends with a tool call that has no user-facing output. This is the last contiguous text segment, not the full response; assemble the full response from agent_message_chunk events.",
            "type": [
              "string",
              "null"
            ]
          },
          "final_message_truncated": {
            "description": "true means final_message in this response was truncated. Obtain the full text from GET /sessions/{id}/turns/{turn_id}.",
            "type": "boolean"
          },
          "interrupt_reason": {
            "description": "What ended this turn. Non-null only when status is interrupted. Values: \"user_requested\", \"runtime_restarted\", \"runtime_unavailable\", \"session_ended\", or \"action_required_timeout\". Open enum; treat unrecognized values as non-retryable.",
            "type": [
              "string",
              "null"
            ]
          },
          "meta": {
            "additionalProperties": false,
            "description": "Public metadata of the initiating prompt, when recorded.",
            "properties": {
              "pa_str": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "output_count": {
            "description": "Number of output items from this turn. 0 means the turn's items array is empty. null means the count is unknown, not zero; read the turn details endpoint to obtain the list in that case.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "pending_action": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionPublicPendingAction"
              },
              {
                "type": "null"
              }
            ],
            "description": "The question blocking this turn, or null if none. Non-null if and only if status is action_required. Inlined in the list, not just the details, so identifying which entries need attention takes one request rather than N. Same shape as in GET /sessions/{id}."
          },
          "started_at": {
            "description": "When the turn started. ISO 8601, with microseconds and timezone.",
            "examples": [
              "2026-08-24T09:15:04.123456+00:00"
            ],
            "type": "string"
          },
          "status": {
            "description": "How this turn ended, or whether it has not ended yet. See the TurnStatus schema—use this field, not stop_reason, to distinguish successful from abnormal termination.",
            "type": "string"
          },
          "stop_reason": {
            "description": "The agent's stop reason, for example end_turn or max_tokens. null while executing or if the turn ended before reporting. This value does not indicate success: abnormal termination also reports end_turn. Use status.",
            "examples": [
              "end_turn"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "turn_id": {
            "description": "This turn's id. Pass to GET /sessions/{id}/turns/{turn_id} for the full version, including untruncated text and output items.",
            "examples": [
              "2f7a1e88-4c05-4b93-8d61-3ea90c5b7d24"
            ],
            "type": "string"
          }
        },
        "required": [
          "turn_id",
          "status",
          "stop_reason",
          "interrupt_reason",
          "final_message",
          "final_message_truncated",
          "error",
          "output_count",
          "pending_action",
          "started_at",
          "ended_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}/turns": {
      "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:\nOne entry per turn, newest first. A turn appears here after execution starts; prompts still waiting appear in `GET /sessions/{session_id}/prompt-queue`.\n\n### Turn status\n\n| `status` | Meaning |\n|---|---|\n| `running` | Executing |\n| `action_required` | Executing, waiting for an answer—see `pending_action` |\n| `completed` | The agent finished normally on its own |\n| `interrupted` | Ended by something outside the agent—see `interrupt_reason` |\n| `failed` | Unsuccessful—see `stop_reason` and `error` |\n\n`ended_at` is null if and only if `status` is `running` or `action_required`.\n\n`pending_action` is non-null if and only if `status` is `action_required`. It contains the question and the `tool_call_id` needed to answer via `POST /sessions/{session_id}/question-response`. Answering returns the turn to `running` rather than ending it; the agent continues and reports its conclusion later.\n\n`cancelled` is deprecated and no longer emitted. It covered both caller cancellation and runtime failure; these are now distinguished by `interrupted` plus `interrupt_reason`.\n\n### Retryability\n\n`status` alone is insufficient: whether an interrupted turn is worth retrying depends on what interrupted it. `interrupt_reason` distinguishes these cases:\n\n| `interrupt_reason` | Reason | Retryable |\n|---|---|---|\n| `user_requested` | The caller cancelled the turn | No |\n| `runtime_restarted` | The turn lost contact with its runtime, or its conclusion could not be delivered | Yes |\n| `runtime_unavailable` | The runtime became unavailable | Yes, after a delay |\n| `session_ended` | The session ended while this turn was executing | No |\n| `action_required_timeout` | The pending question remained unanswered | Yes, also provide an answer |\n\nFor `failed`, distinguish by `stop_reason`: `refusal`, `max_tokens`, and `max_turn_requests` are properties of the prompt itself, so retrying unchanged yields the same result. Other values can be retried after a delay.\n\nFor upstream failures, `error.category` and `error.remedy` describe the required action. `retry` and `retry_after_backoff` mean the same request can be resent; other remedies require a change first. `new_session` means the problem affects every subsequent turn in this session.\n\n`stop_reason` alone does not indicate success: abnormal termination also reports `end_turn`. Use `status`.\n\n`final_message` in this response is truncated to 50000 characters; `final_message_truncated` indicates whether truncation occurred. Obtain the full text from `GET /sessions/{session_id}/turns/{turn_id}`.\n\nRemote-control sessions: This operation returns 422 OPERATION_NOT_SUPPORTED without contacting the target device.\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": "publishedList-turns",
        "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": "Opaque pagination cursor; omit for the first page.",
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "Opaque pagination cursor; omit for the first page.",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Number of entries per page.",
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 20,
              "description": "Number of entries per page.",
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "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": {
                  "$ref": "#/components/schemas/SessionPublicTurnListResponse"
                }
              }
            },
            "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": "Cloud only: List turns and how they ended",
        "tags": [
          "会话轮次"
        ],
        "x-session-variants": {
          "cloud": {
            "summary": "List turns and how they ended",
            "description": "One entry per turn, newest first. A turn appears here after execution starts; prompts still waiting appear in `GET /sessions/{session_id}/prompt-queue`.\n\n### Turn status\n\n| `status` | Meaning |\n|---|---|\n| `running` | Executing |\n| `action_required` | Executing, waiting for an answer—see `pending_action` |\n| `completed` | The agent finished normally on its own |\n| `interrupted` | Ended by something outside the agent—see `interrupt_reason` |\n| `failed` | Unsuccessful—see `stop_reason` and `error` |\n\n`ended_at` is null if and only if `status` is `running` or `action_required`.\n\n`pending_action` is non-null if and only if `status` is `action_required`. It contains the question and the `tool_call_id` needed to answer via `POST /sessions/{session_id}/question-response`. Answering returns the turn to `running` rather than ending it; the agent continues and reports its conclusion later.\n\n`cancelled` is deprecated and no longer emitted. It covered both caller cancellation and runtime failure; these are now distinguished by `interrupted` plus `interrupt_reason`.\n\n### Retryability\n\n`status` alone is insufficient: whether an interrupted turn is worth retrying depends on what interrupted it. `interrupt_reason` distinguishes these cases:\n\n| `interrupt_reason` | Reason | Retryable |\n|---|---|---|\n| `user_requested` | The caller cancelled the turn | No |\n| `runtime_restarted` | The turn lost contact with its runtime, or its conclusion could not be delivered | Yes |\n| `runtime_unavailable` | The runtime became unavailable | Yes, after a delay |\n| `session_ended` | The session ended while this turn was executing | No |\n| `action_required_timeout` | The pending question remained unanswered | Yes, also provide an answer |\n\nFor `failed`, distinguish by `stop_reason`: `refusal`, `max_tokens`, and `max_turn_requests` are properties of the prompt itself, so retrying unchanged yields the same result. Other values can be retried after a delay.\n\nFor upstream failures, `error.category` and `error.remedy` describe the required action. `retry` and `retry_after_backoff` mean the same request can be resent; other remedies require a change first. `new_session` means the problem affects every subsequent turn in this session.\n\n`stop_reason` alone does not indicate success: abnormal termination also reports `end_turn`. Use `status`.\n\n`final_message` in this response is truncated to 50000 characters; `final_message_truncated` indicates whether truncation occurred. Obtain the full text from `GET /sessions/{session_id}/turns/{turn_id}`.",
            "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"
                }
              },
              {
                "description": "Opaque pagination cursor; omit for the first page.",
                "explode": false,
                "in": "query",
                "name": "cursor",
                "schema": {
                  "description": "Opaque pagination cursor; omit for the first page.",
                  "format": "int64",
                  "minimum": 0,
                  "type": "integer"
                }
              },
              {
                "description": "Number of entries per page.",
                "explode": false,
                "in": "query",
                "name": "limit",
                "schema": {
                  "default": 20,
                  "description": "Number of entries per page.",
                  "format": "int64",
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                }
              }
            ],
            "requestBody": null,
            "responses": {
              "200": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicTurnListResponse"
                    }
                  }
                },
                "description": "Success"
              }
            }
          }
        },
        "x-supported-session-types": [
          "cloud"
        ]
      }
    }
  },
  "info": {
    "title": "Cloud only: List turns and how they ended",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.