List Agent Versions

Updated at:

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

ParameterRequiredTypeDescription
limitNointNumber of items per page. Default: 20, maximum: 100
pageNostringPagination cursor. Omit for the first request; pass the next_page value from the previous response to fetch the next page

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

FieldTypeDescription
idstringAgent ID (same across all versions)
typestringAlways agent
versionintVersion number; returned in descending order
name / description / systemstringName, description, and system prompt in this version snapshot
model / tools / mcp_servers / skills / multiagent / metadataobject / arrayModel, toolkits, MCP references, skills, multi-agent collaboration, and business metadata in this version snapshot
archived_atstring | nullArchive timestamp; null if not archived
created_at / updated_atstringCreation / update time of this version
workspace_idstringWorkspace ID