Delete a specific template. If the template still has running or paused instances, the operation returns 409 and refuses to delete it.
Prerequisites
Configure the endpoint and authentication first. See API overview and authentication.
Endpoint
DELETE /templates/{templateCode}
Delete a specific template. Deletion is blocked while active instances exist: if the template still has running or paused instances, the operation returns 409 and refuses to delete it. Release those instances first, then delete the template. No response body is returned on success.
Path parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
templateCode | Yes | string | Unique template code. |
Request example
BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/sandbox, and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API key.
Response
Returns 204 with no response body on success.
If the template still has active instances, the operation returns 409 and you must release the associated instances first. The error response body contains the following fields:
| Field | Type | Description |
|---|---|---|
code | integer | Error code. |
message | string | Error message, which retains sandboxId and sandboxInstanceId, for example template has running or paused sandbox instance, sandboxId=xxx, sandboxInstanceId=sbx-xxx. |
requestID | string | Request ID. |