Retrieve Environment
Returns the full configuration of an environment by ID, including sandbox type, pre-installed dependencies, and networking policy.
Prerequisites
Endpoint and authentication are configured. See Overview and authentication.
Endpoint
/environments/{environment_id}Path parameters
environment_idstringRequiredEnvironment ID, format env_<ULID>
Response fields
idstringEnvironment ID, format: env_<ULID>
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_atstring | nullArchive time; null when not archived
created_atstringCreation time (ISO 8601)
updated_atstringLast update time (ISO 8601)
request_idstringUnique identifier for this request
Request example
curl "$AGENTSTUDIO_URL/environments/env_xxx" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
env = client.environments.retrieve("env_xxx")
Environment env = client.environments().retrieve("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": null,
"created_at": "2026-06-16T12:45:34+08:00",
"updated_at": "2026-06-16T12:45:34+08:00",
"request_id": "xxx"
}
The response is an Environment object. Fields are as follows: