Skip to main content

Cloud only: Get session output

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

Request and permissions

GET https://openapi.qwenwork.ai/v1/session/sessions/{session_id}/output 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: Session-level output: files in the output directory, pages it has published, and a live view of what it is running. This is session-level, not turn-level. Files the agent presented during a turn are listed in items from GET /sessions/{session_id}/turns/{turn_id}.

Field lifetimes

FieldLifetime
files[]Outlives the session; path is stable, download URLs are not
pageOutlives the session; page.url is a persistent address
liveShort-lived; read again whenever you need the view
live.url can expire without notice. Request it again the next time you need the view rather than storing it. live.available: true requires both a reachable view and a viewable application provided by this session. A session that only produced files reports available: false with reason: nothing_to_preview, because there is nothing to view live; its output is in files and page. live.kind identifies the type of view at live.url. Currently, the only emitted type is web_app—a page served by this session. This is an open enum: treat unrecognized values as opaque embeddable views, not errors. live.available: false is returned with 200, not an error status. live.reason specifies the situation: starting, nothing_to_preview, preview_released, or session_ended. A terminated session reports available: false, while its files and page remain valid. Files have no turn_id: they are collected asynchronously and cannot be attributed to a specific turn. degraded lists the sections that could not be read for this request, such as ["files"] when object storage is unreachable. Other sections are returned normally. cursor and limit paginate only files. page and live are single values returned in full on every page. 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 for the file list; omit it for the first page.
Opaque pagination cursor for the file list; omit it for the first page.
Format: "int64"
Minimum (inclusive): 0
limitintegerNoNumber of entries per page in the file list.
Number of entries per page in the file list.
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"
degradedarrayYesSections that could not be read in this response, such as ["files"] when object storage is unreachable; otherwise an empty array. This is a partial result rather than a 500. An empty files array with files listed here means the value is unknown, not empty.
degraded[]stringNo—
filesarrayYesFiles in the session's output directory, newest first. An empty array, never null, when no files have been written. These files have no turn attribution. Files explicitly presented by the agent during a turn are listed in that turn's details.
files[]objectNoAdditional fields: false
files[].created_atstringYesWhen storage last observed a change to this entry. ISO 8601, with microseconds and timezone.
files[].mime_typestringNoContent type, present only when reported by storage. Absent for directories.
files[].namestringYesName without the directory portion—the final segment of path.
files[].pathstringYesStorage path, not a URL. For files, exchange it for a download link when you need the bytes. Presigned URLs expire, so download links are issued on demand rather than listed here. For directories, this is the path to use to list their contents.
files[].sizeintegerNoSize in bytes. Absent or 0 for directories.
Format: "int64"
files[].typestringYes"file" or "directory". A directory is returned as one entry, not expanded—use its path to list its contents. Open enum: treat unrecognized values as opaque entries, not errors.
has_morebooleanYestrue means more files are available. Applies only to files.
liveobject | nullYesLive preview of a running application. Always an object, never null: live.available indicates whether a preview exists; otherwise live.reason explains why not.
liveobjectYesAt least one of: branch 1
Additional fields: false
live.availablebooleanYesAt least one of: branch 1
Whether a live view can be displayed now. true requires both a reachable view and a viewable application provided by this session. A session that only produced files reports false because there is nothing to view live. false is a normal state for a healthy session, not an error, so the response is still 200. Read reason when false.
live.kindstringNoAt least one of: branch 1
The type of view at url. "web_app": a page served by this session. Open enum—treat unrecognized values as opaque embeddable views, not errors; new types may be added. Absent when unavailable.
live.reasonstringNoAt least one of: branch 1
Why no preview is available; present only when available is false. "starting": the preview is still starting. "nothing_to_preview": the session has nothing to display live—it has not provided a viewable application, or the application it provided is no longer being served. Other output is unaffected and appears in files and page in the same response. "preview_released": the live preview has been released and its url is no longer usable, but page may still contain a published page. "session_ended": the session has ended. Open enum.
live.urlstringNoAt least one of: branch 1
Short-lived address. Request this endpoint again when you need a preview rather than storing it—a saved address can expire without notice.
livenullYesAt least one of: branch 2
—
next_cursorintegerYesCursor for the next page of files. 0 when there is no next page. Paginates only files—page and live are single values returned in full on every page.
Format: "int64"
pageobject | nullYesThe published page, or null if none has been published. A single value, not a list: each publication allocates a new version, while the URL always points to the latest version.
pageobjectYesAt least one of: branch 1
Additional fields: false
page.domainstringNoAt least one of: branch 1
Domain hosting this page.
page.published_atstringYesAt least one of: branch 1
When this version went live. ISO 8601, with microseconds and timezone.
page.urlstringYesAt least one of: branch 1
Page address. Persistent—safe to store and share, unlike live preview URLs or presigned file links. Always points to the latest published version.
page.versionstringNoAt least one of: branch 1
The published version currently served at this URL. Publishing again allocates a new version number.
pagenullYesAt least one of: branch 2
—

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"
      },
      "SessionPublicLivePreview": {
        "additionalProperties": false,
        "properties": {
          "available": {
            "description": "Whether a live view can be displayed now. true requires both a reachable view and a viewable application provided by this session. A session that only produced files reports false because there is nothing to view live. false is a **normal** state for a healthy session, not an error, so the response is still 200. Read reason when false.",
            "type": "boolean"
          },
          "kind": {
            "description": "The type of view at url. \"web_app\": a page served by this session. Open enum—treat unrecognized values as opaque embeddable views, not errors; new types may be added. Absent when unavailable.",
            "type": "string"
          },
          "reason": {
            "description": "Why no preview is available; present only when available is false. \"starting\": the preview is still starting. \"nothing_to_preview\": the session has nothing to display live—it has not provided a viewable application, or the application it provided is no longer being served. Other output is unaffected and appears in files and page in the same response. \"preview_released\": the live preview has been released and its url is no longer usable, but page may still contain a published page. \"session_ended\": the session has ended. Open enum.",
            "type": "string"
          },
          "url": {
            "description": "Short-lived address. Request this endpoint again when you need a preview rather than storing it—a saved address can expire without notice.",
            "type": "string"
          }
        },
        "required": [
          "available"
        ],
        "type": "object"
      },
      "SessionPublicOutputFile": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "description": "When storage last observed a change to this entry. ISO 8601, with microseconds and timezone.",
            "type": "string"
          },
          "mime_type": {
            "description": "Content type, present only when reported by storage. Absent for directories.",
            "type": "string"
          },
          "name": {
            "description": "Name without the directory portion—the final segment of path.",
            "type": "string"
          },
          "path": {
            "description": "Storage path, not a URL. For files, exchange it for a download link when you need the bytes. Presigned URLs expire, so download links are issued on demand rather than listed here. For directories, this is the path to use to list their contents.",
            "type": "string"
          },
          "size": {
            "description": "Size in bytes. Absent or 0 for directories.",
            "format": "int64",
            "type": "integer"
          },
          "type": {
            "description": "\"file\" or \"directory\". A directory is returned as one entry, not expanded—use its path to list its contents. Open enum: treat unrecognized values as opaque entries, not errors.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "path",
          "type",
          "created_at"
        ],
        "type": "object"
      },
      "SessionPublicOutputPage": {
        "additionalProperties": false,
        "properties": {
          "domain": {
            "description": "Domain hosting this page.",
            "type": "string"
          },
          "published_at": {
            "description": "When this version went live. ISO 8601, with microseconds and timezone.",
            "type": "string"
          },
          "url": {
            "description": "Page address. Persistent—safe to store and share, unlike live preview URLs or presigned file links. Always points to the latest published version.",
            "type": "string"
          },
          "version": {
            "description": "The published version currently served at this URL. Publishing again allocates a new version number.",
            "type": "string"
          }
        },
        "required": [
          "url",
          "published_at"
        ],
        "type": "object"
      },
      "SessionPublicSessionOutput": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/SessionOutput.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "degraded": {
            "description": "Sections that could not be read in this response, such as [\"files\"] when object storage is unreachable; otherwise an empty array. This is a partial result rather than a 500. An empty files array with files listed here means the value is unknown, not empty.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "files": {
            "description": "Files in the session's output directory, newest first. An empty array, never null, when no files have been written. These files have no turn attribution. Files explicitly presented by the agent during a turn are listed in that turn's details.",
            "items": {
              "$ref": "#/components/schemas/SessionPublicOutputFile"
            },
            "type": "array"
          },
          "has_more": {
            "description": "true means more files are available. Applies only to files.",
            "type": "boolean"
          },
          "live": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionPublicLivePreview"
              },
              {
                "type": "null"
              }
            ],
            "description": "Live preview of a running application. Always an object, never null: live.available indicates whether a preview exists; otherwise live.reason explains why not."
          },
          "next_cursor": {
            "description": "Cursor for the next page of files. 0 when there is no next page. Paginates only files—page and live are single values returned in full on every page.",
            "format": "int64",
            "type": "integer"
          },
          "page": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionPublicOutputPage"
              },
              {
                "type": "null"
              }
            ],
            "description": "The published page, or null if none has been published. A single value, not a list: each publication allocates a new version, while the URL always points to the latest version."
          }
        },
        "required": [
          "files",
          "page",
          "live",
          "degraded",
          "next_cursor",
          "has_more"
        ],
        "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}/output": {
      "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:\nSession-level output: files in the output directory, pages it has published, and a live view of what it is running.\n\nThis is session-level, not turn-level. Files the agent presented during a turn are listed in `items` from `GET /sessions/{session_id}/turns/{turn_id}`.\n\n### Field lifetimes\n\n| Field | Lifetime |\n|---|---|\n| `files[]` | Outlives the session; `path` is stable, download URLs are not |\n| `page` | Outlives the session; `page.url` is a persistent address |\n| `live` | Short-lived; read again whenever you need the view |\n\n`live.url` can expire without notice. Request it again the next time you need the view rather than storing it.\n\n`live.available: true` requires both a reachable view and a viewable application provided by this session. A session that only produced files reports `available: false` with `reason: nothing_to_preview`, because there is nothing to view live; its output is in `files` and `page`.\n\n`live.kind` identifies the type of view at `live.url`. Currently, the only emitted type is `web_app`—a page served by this session. This is an open enum: treat unrecognized values as opaque embeddable views, not errors.\n\n`live.available: false` is returned with 200, not an error status. `live.reason` specifies the situation: `starting`, `nothing_to_preview`, `preview_released`, or `session_ended`. A terminated session reports `available: false`, while its `files` and `page` remain valid.\n\nFiles have no `turn_id`: they are collected asynchronously and cannot be attributed to a specific turn.\n\n`degraded` lists the sections that could not be read for this request, such as `[\"files\"]` when object storage is unreachable. Other sections are returned normally.\n\n`cursor` and `limit` paginate only `files`. `page` and `live` are single values returned in full on every page.\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": "publishedGet-session-output",
        "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 for the file list; omit it for the first page.",
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "Opaque pagination cursor for the file list; omit it for the first page.",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Number of entries per page in the file list.",
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 20,
              "description": "Number of entries per page in the file list.",
              "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/SessionPublicSessionOutput"
                }
              }
            },
            "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: Get session output",
        "tags": [
          "会话产物"
        ],
        "x-session-variants": {
          "cloud": {
            "summary": "Get session output",
            "description": "Session-level output: files in the output directory, pages it has published, and a live view of what it is running.\n\nThis is session-level, not turn-level. Files the agent presented during a turn are listed in `items` from `GET /sessions/{session_id}/turns/{turn_id}`.\n\n### Field lifetimes\n\n| Field | Lifetime |\n|---|---|\n| `files[]` | Outlives the session; `path` is stable, download URLs are not |\n| `page` | Outlives the session; `page.url` is a persistent address |\n| `live` | Short-lived; read again whenever you need the view |\n\n`live.url` can expire without notice. Request it again the next time you need the view rather than storing it.\n\n`live.available: true` requires both a reachable view and a viewable application provided by this session. A session that only produced files reports `available: false` with `reason: nothing_to_preview`, because there is nothing to view live; its output is in `files` and `page`.\n\n`live.kind` identifies the type of view at `live.url`. Currently, the only emitted type is `web_app`—a page served by this session. This is an open enum: treat unrecognized values as opaque embeddable views, not errors.\n\n`live.available: false` is returned with 200, not an error status. `live.reason` specifies the situation: `starting`, `nothing_to_preview`, `preview_released`, or `session_ended`. A terminated session reports `available: false`, while its `files` and `page` remain valid.\n\nFiles have no `turn_id`: they are collected asynchronously and cannot be attributed to a specific turn.\n\n`degraded` lists the sections that could not be read for this request, such as `[\"files\"]` when object storage is unreachable. Other sections are returned normally.\n\n`cursor` and `limit` paginate only `files`. `page` and `live` are single values returned in full on every page.",
            "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 for the file list; omit it for the first page.",
                "explode": false,
                "in": "query",
                "name": "cursor",
                "schema": {
                  "description": "Opaque pagination cursor for the file list; omit it for the first page.",
                  "format": "int64",
                  "minimum": 0,
                  "type": "integer"
                }
              },
              {
                "description": "Number of entries per page in the file list.",
                "explode": false,
                "in": "query",
                "name": "limit",
                "schema": {
                  "default": 20,
                  "description": "Number of entries per page in the file list.",
                  "format": "int64",
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                }
              }
            ],
            "requestBody": null,
            "responses": {
              "200": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicSessionOutput"
                    }
                  }
                },
                "description": "Success"
              }
            }
          }
        },
        "x-supported-session-types": [
          "cloud"
        ]
      }
    }
  },
  "info": {
    "title": "Cloud only: Get session output",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.