ListDatasets
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
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
agentloop:ListDatasets |
list |
*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.