Archive Agent

更新时间:
复制 MD 格式

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

Field

Type

Description

id

string

Agent ID

type

string

Always agent

version

int

Current version number (archiving does not change the version)

name / description / system

string

Agent name, description, and system prompt

model / tools / mcp_servers / skills / metadata

object / array

Model, toolkits, MCP references, skills, and business metadata

archived_at

string

Archive timestamp, ISO 8601; this field is always non-null in the archive endpoint response

created_at / updated_at

string

Creation / last update time

workspace_id

string

Workspace ID

request_id

string

Unique identifier for this request