Delete environment template

Updated at:

Delete the specified environment template.

Endpoint

Returns 200 and a delete envelope. After deletion, retrieving or deleting the same template returns 404.

DELETE/agents/environments/templates/{template_id}

Path parameters

template_idstringRequired

Environment template ID

This endpoint has no request body or query parameters.

Request example

curl -sS -X DELETE "$BASE_URL/agents/environments/templates/envtmpl_xxx" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "OpenAI-Beta: agents=v1"
client.beta.agents.environments.templates.delete("envtmpl_xxx")

Response fields

idstring

Deleted environment template ID

objectstring

Environment template deletion result object type, fixed as agent.environment.template.deleted

deletedboolean

Whether deletion succeeded, true when deletion succeeds

Response example

{
  "id": "envtmpl_xxx",
  "object": "agent.environment.template.deleted",
  "deleted": true
}

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