Archive Agent

Updated at:

Soft archive: the agent is retained but no longer appears in list results by default and cannot be used for new sessions. Existing sessions are not affected.

Prerequisites

Endpoint and authentication configured. For details, see Overview and authentication.

Endpoint

POST /agents/{agent_id}/archive

Semantics

Soft archive: the response returns the full Agent object with the archived_at field populated with the archive timestamp. After archiving, the agent no longer appears in list results by default (unless include_archived=true), and cannot be used for new sessions. Existing sessions are not affected.

Request example

curl -X POST "$AGENTSTUDIO_URL/agents/agent_xxx/archive" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"
client.agents.archive("agent_xxx")
client.agents().archive("agent_xxx");

Response

The response is an Agent object with the same structure as the Create Agent response. The only difference is that the archived_at field is populated with the archive timestamp (no longer null). Fields:

Response fields

FieldTypeDescription
idstringAgent ID
typestringAlways agent
versionintCurrent version number (archiving does not change the version)
name / description / systemstringAgent name, description, and system prompt
model / tools / mcp_servers / skills / multiagent / metadataobject / arrayModel, toolkits, MCP references, skills, multi-agent collaboration, and business metadata
archived_atstringArchive timestamp, ISO 8601; this field is always non-null in the archive endpoint response
created_at / updated_atstringCreation / last update time
workspace_idstringWorkspace ID
request_idstringUnique identifier for this request