Skip to main content

Retrieve environment template

Return the complete environment template configuration for a template ID.

Endpoint

GET /agents/environments/templates/{template_id} Returns 200 and the complete environment template.

Path parameters

template_id string (required)Environment template ID

Request example

curl -sS "$BASE_URL/agents/environments/templates/envtmpl_xxx" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "OpenAI-Beta: agents=v1"

Response fields

id stringEnvironment 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

{
  "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 statusError type / codeSolution
401authentication_error / invalid_api_keySend a valid Authorization: Bearer $DASHSCOPE_API_KEY header
404not_found_error / not_found_errorUse an environment template ID that exists in the current workspace
500server_error / server_errorRetry later. If it keeps failing, submit a ticket with x-request-id