Update an environment template; omitted fields keep their current values.
Endpoint
POST /agents/environments/templates/{template_id}
Returns 200 and the complete updated environment template. Omitted fields keep their current values.
Path parameterstemplate_idstring (required)Environment template IDRequest bodynamestring / null (optional)Template namepackages object (optional)Packages grouped by npm, python, and systemenv object<string,string> (optional)Environment variables; the same name and value limits apply as at template creationsetup_commands array (optional)Setup commands executed in ordernetwork object (optional)Network policy with access and allowed_domains; blocked_domains is not accepteddesktop object (optional)Desktop settings; only enabled=false is accepted, and enabled=true returns 400capability_directories array<string> (optional)Capability discovery directoriesskills array (optional)Skill configuration, fixed as skill_referenceplugins array (optional)Plugin configuration; only an empty array is supported, and non-empty arrays return 400files array (optional)Initial file configuration, fixed as file_idWhen only name is provided, existing network, capability_directories, and other configuration remain unchanged.An explicit null resets the field: name is cleared, network returns to the default policy, desktop returns to enabled=false, and array fields are cleared. | Request example |
Response fieldsidstringEnvironment template IDobject stringEnvironment template object type, fixed as agent.environment.templatename string / nullTemplate namecreated_at integerCreation time in Unix secondsupdated_at integerLast update time in Unix secondspackages objectPackages with python, system, and npmnetwork objectNetwork policy with access and allowed_domainsdesktop objectDesktop settings with enabledcapability_directories array<string>Capability discovery directoriesskills arraySkill configuration with type, skill_id, and versionplugins arraySafe plugin metadata. Contains type, name, and description; currently an empty arrayfiles arrayInitial file configuration; each item contains type, path, and file_idResponses do not return env or setup_commands. | Response example |
Error codes
| HTTP status | Error type / code | Solution |
|---|---|---|
400 | invalid_request_error / invalid_request_error | Fix the request body as described for each field |
400 | invalid_request_error / invalid_request_error | desktop.enabled=true, non-empty plugins, and network.blocked_domains are rejected; adjust the field accordingly |
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 |