Retrieve environment template
Updated at:
Return the complete environment template configuration for a template ID.
Endpoint
Returns 200 and the complete environment template.
GET
/agents/environments/templates/{template_id}Path parameters
template_idstringRequiredEnvironment template ID
Request example
curl -sS "$BASE_URL/agents/environments/templates/envtmpl_xxx" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "OpenAI-Beta: agents=v1"
template = client.beta.agents.environments.templates.retrieve("envtmpl_xxx")
print(template.id, template.name)
Response fields
idstringEnvironment template ID
objectstringEnvironment template object type, fixed as agent.environment.template
namestring / nullTemplate name
created_atintegerCreation time in Unix seconds
updated_atintegerLast update time in Unix seconds
packagesobjectPackages with python, system, and npm
networkobjectNetwork policy with access and allowed_domains
desktopobjectDesktop settings with enabled
capability_directoriesarray<string>Capability discovery directories
skillsarraySkill configuration with type, skill_id, and version
pluginsarraySafe plugin metadata. Contains type, name, and description; currently an empty array
filesarrayInitial file configuration; each item contains type, path, and file_id
Responses do not return env or setup_commands.
Response example
{
"id": "envtmpl_xxx",
"name": "example-template",
"object": "agent.environment.template",
"created_at": 1794319007,
"updated_at": 1794319007,
"packages": {"python": [], "system": [], "npm": []},
"network": {"access": "disabled", "allowed_domains": []},
"desktop": {"enabled": false},
"capability_directories": ["/workspace/skills"],
"skills": [],
"plugins": [],
"files": []
}
Error codes
| HTTP status | Error type / code | Solution |
|---|---|---|
401 | authentication_error / invalid_api_key | Send a valid Authorization: Bearer $DASHSCOPE_API_KEY header |
404 | not_found_error / not_found_error | Use an environment template ID that exists in the current workspace |
500 | server_error / server_error | Retry later. If it keeps failing, submit a ticket with x-request-id |
Is this page helpful?