ListChatSessions

Updated at:

Queries the ROS Agent V2 sessions for the current user with paging.

Operation description

Request description

  • When you call the V2 service, set AgentVersion to V2.

  • This operation returns only the sessions of the current user. By default, sessions are sorted by UpdatedAt in descending order.

  • You can use the Mode parameter to filter sessions by mode. Valid values: IaCCodeNormal and IaCCodePipeline.

  • Do not reuse the previous NextToken after you change the Mode.

  • Use the CreatedAt and UpdatedAt fields for time information. The UpdatedTime field in metadata is a compatibility field and is not returned in the current response.

  • The number of entries to return is specified by the MaxResults request parameter. Valid values: 1 to 100.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ros:ListChatSessions

list

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

MaxResults

integer

No

The number of sessions to return per page. Valid values: 1 to 100. Default value: 20.

20

NextToken

string

No

The pagination token returned from the previous response. Do not specify this parameter for the first request. Do not reuse the previous token after you change the Mode.

CAES...

AgentVersion

string

No

The version of the Agent service. Set this parameter to V2 to route the request to the ROS Agent V2 backend.

V2

Mode

string

No

Filters sessions by mode. Valid values: IaCCodeNormal and IaCCodePipeline.

Valid values:

  • IaCCodePipeline :

    Pipeline session mode.

  • IaCCodeNormal :

    Normal session mode.

IaCCodePipeline

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request.

4C68F7A5-2D16-5C8F-A4B1-01E9C6A9B0D2

Sessions

array<object>

The list of sessions for the current user, sorted by update time in descending order.

[]

object

The session object.

{}

SessionId

string

The ID of the session. You can use this ID for StartChat re-entry, StopChat, and ListChatMessages.

7f4e2a8c6d9b4a1f8e3c5b7d2a6f9012

Summary

string

The summary of the session. This field currently shares the same source as Title and may be empty.

Create VPC template

UpdatedTime

string

The compatibility field. This field is not returned in the current V2 response. Use UpdatedAt instead. The time is in ISO 8601 format in UTC, accurate to seconds, and ends with Z.

2026-08-26T10:00:00Z

Title

string

The title of the session. This field may be empty.

Create VPC template

Mode

string

The mode of the session. Valid values: IaCCodeNormal and IaCCodePipeline.

IaCCodePipeline

PipelineName

string

The name of the pipeline. Valid values: EvaluationFirstSelling and SolutionFirstSelling.

SolutionFirstSelling

HistoryReadiness

string

The readability status of session history messages. History can be loaded only when the status is READY. History cannot be loaded when the status is STARTING, RUNNING, STOPPING, FINALIZING (processing), NOT_READY (not ready), RECOVERY_REQUIRED (recovery required), or UNKNOWN (unknown).

STARTING

ClientReferenceId

string

The client-defined session identifier. This identifier is used only for the client to identify its own sessions. The server does not provide uniqueness verification or list filtering based on this identifier.

07484e4b81708f7586

FirstCursor

string

The cursor value of the first Server-Sent Events (SSE) event in the replayable SSE stream of the most recent StartChat call for the current session. You can use this value to replay the complete SSE stream of the most recent StartChat call from the beginning.

v1.xsssaa.0

NextToken

string

The token for the next page. This field may not be returned or may be null on the last page.

CAES...

MaxResults

integer

The compatibility field. This field is not returned in the current V2 response. Refer to the MaxResults request parameter instead.

20

Examples

Success response

JSON format

{
  "RequestId": "4C68F7A5-2D16-5C8F-A4B1-01E9C6A9B0D2",
  "Sessions": [
    {
      "SessionId": "7f4e2a8c6d9b4a1f8e3c5b7d2a6f9012",
      "Summary": "Create a VPC template",
      "UpdatedTime": "2026-08-26T10:00:00Z",
      "Title": "Create a VPC template",
      "Mode": "IaCCodePipeline",
      "PipelineName": "SolutionFirstSelling",
      "HistoryReadiness": "STARTING",
      "ClientReferenceId": "07484e4b81708f7586",
      "FirstCursor": "v1.xsssaa.0"
    }
  ],
  "NextToken": "CAES...",
  "MaxResults": 20
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.