Lists all historical versions of an agent with pagination. When a session is created, it locks to the current version; the session detail also embeds a full agent snapshot for that version.
Prerequisites
Endpoint and authentication configured. For details, see Overview and authentication.
Endpoint
GET /agents/{agent_id}/versions
Query parameters
|
Parameter |
Required |
Type |
Description |
|
|
No |
int |
Number of items per page. Default: 20, maximum: 100 |
|
|
No |
string |
Pagination cursor. Omit for the first request; pass the |
Request example
curl "$AGENTSTUDIO_URL/agents/agent_xxx/versions" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"for version in client.agents.list_versions("agent_xxx", limit=10):
print(version.version, version.created_at)CursorPage<AgentVersion> versions = client.agents().listVersions(
"agent_xxx", AgentListParam.builder().limit(10).build());Response
The response contains data (an array of Agent objects, each representing a historical version snapshot, sorted by version number in descending order), next_page (cursor for the next page; null when no more data), and request_id. Each Agent object has the same fields as the Create Agent response. Field descriptions:
Agent object fields
|
Field |
Type |
Description |
|
|
string |
Agent ID (same across all versions) |
|
|
string |
Always |
|
|
int |
Version number; returned in descending order |
|
|
string |
Name, description, and system prompt in this version snapshot |
|
|
object / array |
Model, toolkits, MCP references, skills, and business metadata in this version snapshot |
|
|
string | null |
Archive timestamp; |
|
|
string |
Creation / update time of this version |
|
|
string |
Workspace ID |