ListDatasets

Updated at:

Performs a paged query for datasets in a specified AgentSpace.

Operation description

You can filter datasets by a substring of the dataset name and by labels. The results prioritize favorited datasets and are sorted in descending order of creation time. Do not pass nextToken in the first request. For subsequent requests, use the nextToken returned in the response and keep the filter conditions and page size consistent. Pagination ends when an empty token is returned.

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

agentloop:ListDatasets

list

*Dataset

acs:agentloop:{#regionId}:{#accountId}:agentspace/{#AgentSpaceName}/dataset/*

None None

Request syntax

GET /agentspace/{agentSpace}/dataset HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

agentSpace

string

Yes

The name of the AgentSpace.

sop-agent

Request parameters

Parameter

Type

Required

Description

Example

datasetName

string

No

Filters datasets by a substring of the dataset name. If omitted, no name filtering is applied. Wildcards are treated as literal characters.

product_faq_dataset

maxResults

integer

No

The maximum number of entries to return per page. Valid values: 1 to 100. Default value: 100.

100

nextToken

string

No

The pagination token. You do not need to specify this parameter in the first request. For subsequent requests, pass the nextToken returned in the previous response.

RsfoUqpOJd5nd0F1e4OquY/7dKNGp1JMgsKtvCagmtY=

labels

object

No

Filters datasets by labels.

{ "Agent": ["Member Marketing"] }

array

No

The list of filter values for the same label key.

["Member Marketing"]

string

No

The label filter value.

Member Marketing

Response elements

Element

Type

Description

Example

object

The response of the API operation.

nextToken

string

The token for the next page of query results. If the total number of returned entries exceeds the maxResults limit, the data is truncated. You can use nextToken to query the next page of data.

umaQfI7x758Ns4TgWrj8yA3fYlnk7dJgsfhMrSViRY8=

maxResults

integer

The maximum number of entries to return for this request.

100

requestId

string

The request ID.

90F52F93-8800-5A71-8737-18F34BA90166

total

integer

The total number of records.

33

datasets

array<object>

The list of datasets on the current page.

array<object>

The properties of a dataset.

description

string

The description of the dataset.

Product FAQ dataset for semantic search

createTime

string

The time when the resource was created, in RFC 3339 format.

2026-01-19T02:11:02Z

updateTime

string

The time when the resource was last updated, in RFC 3339 format.

2026-05-18T02:21:32Z

datasetName

string

The name of the dataset.

product_faq_dataset

agentSpace

string

The name of the AgentSpace.

sop-agent

regionId

string

The region ID.

cn-shanghai

isFavorite

boolean

Indicates whether the dataset is favorited.

labels

object

The labels of the dataset.

{ "Agent": ["Member Marketing"] }

array

The list of label values for the same label key.

["Member Marketing"]

string

The label value.

Member Marketing

ttlDays

integer

The data retention period in days.

7

Examples

Success response

JSON format

{
  "nextToken": "umaQfI7x758Ns4TgWrj8yA3fYlnk7dJgsfhMrSViRY8=",
  "maxResults": 100,
  "requestId": "90F52F93-8800-5A71-8737-18F34BA90166",
  "total": 33,
  "datasets": [
    {
      "description": "Product FAQ dataset for semantic search",
      "createTime": "2026-01-19T02:11:02Z",
      "updateTime": "2026-05-18T02:21:32Z",
      "datasetName": "product_faq_dataset",
      "agentSpace": "sop-agent",
      "regionId": "cn-shanghai",
      "isFavorite": false,
      "labels": {
        "key": [
          "Member Marketing"
        ]
      },
      "ttlDays": 7
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.