Archive Environment
Soft archive: the environment is retained but excluded from list results by default; it can still be retrieved. Sessions already bound to this environment continue to work.
Prerequisites
Endpoint and authentication are configured. See Overview and authentication.
Endpoint
/environments/{environment_id}/archiveSemantics
Soft archive: the response returns the full environment object with the archived_at field populated with the archive time. Once archived, the environment is excluded from list results by default (unless include_archived=true), but can still be retrieved via GET. Sessions already bound to this environment continue to work.
Path parameters
environment_idstringRequiredEnvironment ID, format env_<ULID>
Response fields
idstringEnvironment ID
typestringFixed value environment
namestringEnvironment name
descriptionstringEnvironment description
scopestringScope. organization: visible to and reusable by all workspace members
configobjectComplete runtime configuration. Contains the following sub-fields:
config properties
typestringcloud cloud container
packagesobjectPreinstalled dependencies grouped by package manager. Keys are apt / pip / npm; values are package name arrays
packages properties
aptarray<string>Debian/Ubuntu package names
piparray<string>Python package names
npmarray<string>Node.js package names
networkingobjectNetwork policy object with the structure {"type": "unrestricted"}
networking properties
typestringCurrently only unrestricted
metadataobjectCustom business key-value pairs that do not affect runtime behavior
archived_atstringArchive time, ISO 8601; this field is always non-null in the response from the archive endpoint
created_atstringCreation time
updated_atstringLast update time
requestIdstringUnique identifier for this request
Request example
curl -X POST "$AGENTSTUDIO_URL/environments/env_xxx/archive" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
client.environments.archive("env_xxx")
client.environments().archive("env_xxx");
Response example
{
"id": "env_xxx",
"type": "environment",
"name": "data-sandbox",
"description": "Data analysis sandbox",
"config": {
"type": "cloud",
"packages": {"apt": ["ffmpeg"], "pip": ["pandas", "numpy", "matplotlib"]},
"networking": {"type": "unrestricted"}
},
"metadata": {"team": "infra"},
"scope": "organization",
"archived_at": "2026-06-16T13:47:18+08:00",
"created_at": "2026-06-16T12:45:34+08:00",
"updated_at": "2026-06-16T13:47:18+08:00",
"requestId": "xxx"
}
The response is an Environment object with the archived_at field populated with the archive time. Fields are as follows: