Archive Environment

Updated at:

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

POST/environments/{environment_id}/archive

Semantics

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_idstringRequired

Environment ID, format env_<ULID>

Response fields

idstring

Environment ID

typestring

Fixed value environment

namestring

Environment name

descriptionstring

Environment description

scopestring

Scope. organization: visible to and reusable by all workspace members

configobject

Complete runtime configuration. Contains the following sub-fields:

config properties

typestring

cloud cloud container

packagesobject

Preinstalled 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

networkingobject

Network policy object with the structure {"type": "unrestricted"}

networking properties

typestring

Currently only unrestricted

metadataobject

Custom business key-value pairs that do not affect runtime behavior

archived_atstring

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

created_atstring

Creation time

updated_atstring

Last update time

requestIdstring

Unique 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: