ListThreads

Updated at:

Lists the sessions under a specified DataAgent, supports filtering by status and session ID, and returns paginated results.

Operation description

A session (thread) is a continuous conversation context for a DataAgent. A DataAgent can have multiple sessions. This operation queries the list of sessions under a specific DataAgent. You can use it to resume historical sessions, continue unfinished conversations, or clean up unnecessary sessions. Each returned session includes information such as the creation time, update time, status, and version number. To obtain the session content, call GetThreadData.

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

log:ListThreads

list

*DataAgent

acs:log:{#regionId}:{#accountId}:dataagent/{#name}/thread/*

None None

Request syntax

GET /dataagents/{name}/threads HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

name

string

No

The name of the DataAgent. This parameter is passed in the request path to specify the DataAgent whose sessions you want to list.

order-analysis-agent

Request parameters

Parameter

Type

Required

Description

Example

nextToken

string

No

The pagination cursor. Pass the nextToken value returned in the previous response to retrieve the next page. You do not need to specify this parameter for the first query.

e81493d42a7d212810e0ac****

maxResults

integer

No

The maximum number of sessions to return per page. Maximum value: 200.

20

status

string

No

Filters the sessions by status. The valid values are the same as the status values in the response, such as active.

active

threadId

string

No

Filters the sessions by session ID. Use this parameter to query a specific session.

thread-tiirv9-irwdoal8t4rm

includeMission

boolean

No

Specifies whether sessions automatically created by missions are included.

false

To paginate results, use the nextToken cursor. Pass the nextToken value returned in the previous response as is to retrieve the next page. If the response does not contain nextToken, all results have been returned. The status parameter uses exact matching. For case-insensitive values, refer to the actual returned values.

Response elements

Element

Type

Description

Example

object

The response body. Returns the list of sessions that meet the filter conditions and the pagination information.

maxResults

integer

The actual number of sessions returned per page in this query. This value is the same as the maxResults value in the request.

20

nextToken

string

The pagination cursor for the next page. This field is not returned if no more results are available.

e81493d42a7d212810e0ac****

requestId

string

The ID of the request. You can use this ID to locate the call during troubleshooting.

5B0A6B60BB6EE39764D458B5

threadId

string

A reserved field for compatibility. This field is typically not returned. To obtain the session list, read the threads field.

thread-tiirv9-irwdoal8t4rm

threads

array<object>

The list of sessions returned in this response. The list contains a maximum of maxResults sessions. An empty array is returned if no sessions meet the filter conditions.

array<object>

The information about a session.

attributes

object

The custom attributes of the session. Both keys and values are strings.

{"date":"2026-08"}

string

The attribute value, which is a string.

2026-08

createTime

string

The time when the session was created. The time is in the ISO 8601 format with a time zone.

2026-08-14T10:00:03+08:00

status

string

The status of the session. Common values: active (the conversation can be continued), archived (the session is archived), suspended (the session is paused and waiting for additional input), failed (the execution failed), and cancelled (the session is cancelled).

active

threadId

string

The ID of the session. You can use this ID to initiate a conversation, or query, modify, or delete the session.

thread-tiirv9-irwdoal8t4rm

title

string

The title of the session. The title is generated by the service based on the conversation content. You can modify the title by calling UpdateThread.

Troubleshooting abnormal order volume

updateTime

string

The time when the session was last updated. The format is the same as that of createTime.

2026-08-14T11:20:35+08:00

variables

object

The context variables of the session.

project

string

The name of the Simple Log Service project associated with the session.

etl-dev

workspace

string

The name of the workspace associated with the session.

order-workspace

version

integer

The version number of the session. This number indicates the sequence in which the session was modified.

3

total

integer

The total number of sessions that meet the filter conditions.

12

This operation returns only the basic information about sessions. To obtain the message content in a session, call GetThreadData by specifying the threadId.

Examples

Success response

JSON format

{
  "maxResults": 20,
  "nextToken": "e81493d42a7d212810e0ac****",
  "requestId": "5B0A6B60BB6EE39764D458B5",
  "threadId": "thread-tiirv9-irwdoal8t4rm",
  "threads": [
    {
      "attributes": {
        "key": "2026-08"
      },
      "createTime": "2026-08-14T10:00:03+08:00",
      "status": "active",
      "threadId": "thread-tiirv9-irwdoal8t4rm",
      "title": "Troubleshooting abnormal order volume",
      "updateTime": "2026-08-14T11:20:35+08:00",
      "variables": {
        "project": "etl-dev",
        "workspace": "order-workspace"
      },
      "version": 3
    }
  ],
  "total": 12
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.