- Documentation
Elastic Compute Service
Elastic Compute Service
API Reference
Instances
DeleteInstances - Deletes instances
Instances
DeleteInstances - Deletes instances
DeleteInstances - Deletes instances
Call the DeleteInstances operation to delete one or more instances.
Usage notes
- Only pay-as-you-go instances (including spot instances and Elastic Scheduled Instances) or subscription instances that have expired or been unsubscribed can be deleted.
- A subscription instance cannot be deleted before it expires or is unsubscribed. You can convert the instance to a pay-as-you-go instance and manually delete it, or manually delete it within the resource retention period after the instance expires or is unsubscribed. If an instance is not renewed after expiration or unsubscription, it will be automatically released.
Debugging
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
Request parameters
Only the request parameters specific to this operation and some common parameters are listed below. For more information, please refer to Common parameters. Action string Sample value: DeleteInstances
The operation that you want to perform. Valid value: DeleteInstances.
Version string Sample value: 2020-04-01
The API version. Valid value: 2020-04-01.
ClientToken string Optional Sample value: 333456899ff****
The ClientToken is used to ensure the request idempotency. You can use the client to automatically generate a token, but you must make sure that the token is unique among different requests. This prevents repeated actions due to multiple client retries when the call of the API action times out or an internal server error occurs.
Value: Only ASCII characters are supported. The length is no more than 64 ASCII characters.
InstanceIds.N string[] Sample value: InstanceIds.1=i-ybo349sxoncm9t******&InstanceIds.2=i-ybo349sxolcm9t******
The instance ID. A maximum of 100 instance IDs are supported.
- Argument - N: specifies the serial number of the instance.
- Separate multiple instance IDs with ampersands (&).
Response parameters
Only the response parameters specific to this operation are listed below. For more information, refer to Response structure. tip
The following error code for the operation is displayed only when an invalid value is specified for a request parameter. If valid values are specified for the request parameters, no error code is displayed, and a status code of 200 is returned. However, this does not mean that the operation on all instances is successful. To view the operation result on a single instance, see the information in the following response parameters. OperationDetails object[] Sample value: --
The operation details.
Error object Sample value: --
The error message for the instance being operated on.
Code string Sample value: InvalidInstance.NotFound
The error code for the failure of a specific request during batch operations. Value:
- InvalidInstance.NotFound: The specified instance does not exist.
- MissingParameter.InstanceId: The instance ID cannot be empty.
- InvalidInstanceStatus: The current status of the instance does not support this operation.
- InvalidChargeType: The specified instance billing method is invalid.
- OperationDenied.ResourceLocked: The specified operation is rejected because your resource has been locked by another operation.
- OperationDenied.ResourceCreatedByOtherService: The specified operation is rejected because your resource has been created by another service. You can query the corresponding service based on the system tag of the resource.
- OperationDenied.InstanceIsCreatingImage: The specified operation is rejected because the instance is being used to create a custom image.
- FlowLimitExceeded: You have exceeded the rate limit for resource requests.
- InternalError: An internal error occurred. Try again. If multiple attempts fail, submit a ticket.
- InvalidOperation.DeletionProtection: This operation is not supported because the instance release protection is enabled.
tip
Each Code corresponds to a Message in sequence.
Message string Sample value: The specified instance does not exist.
The error information for the failure of a specific request during batch operations. Value:
- The specified instance does not exist.
- The required parameter InstanceId is not supplied.
- The status of the specified instance does not support this request.
- The specified ChargeType is not valid, is unsupported, or cannot be used.
- The specified operation is denied as your resource is locked for another operation.
- The specified operation is denied as your resource is created by other service. You can check system tags to find the service.
- The specified operation is denied as your instance is creating image.
- You've reached the limit on request rate of resources.
- An internal error has occurred.
- The operation is not allowed due to deletion protection.
tip
Each Code corresponds to a Message in sequence.
InstanceId string Sample value: i-ybo349sxoncm9t******
The ID of the instance on which the operation is performed.
Sample request
Sample response
Error codes
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.
Last updated: 2026.06.18 17:48:24