Release instances in batch
Updated at:2025-10-20
This API enables batch release of pay-as-you-go (postpaid) BCC instances.
- Once released, the physical resources utilized by the instances are reclaimed, and all associated data is permanently lost with no recovery options.
- By default, only the instances and their system disks are released. Users can optionally choose to also release EIPs and data disks attached to the instances.
Request structure
Plain Text
1POST /v{version}/instance/batchDelete HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "relatedReleaseFlag" : relatedReleaseFlag,
6 "deleteCdsSnapshotFlag" : deleteCdsSnapshotFlag,
7 "bccRecycleFlag" : bccRecycleFlag,
8 "deleteRelatedEnisFlag" : deleteRelatedEnisFlag,
9 "instanceIds" : [
10 instanceId
11 ]
12}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number |
| instanceIds | Yes | RequestBody | List of instance IDs, with no more than 100 elements in the list | |
| relatedReleaseFlag | boolean | Yes | RequestBody | Whether to release the EIPs and data disks currently attached on the instance at the same time (the deleteCdsSnapshotFlag field will only be valid if this field is true. If this field is false, the value of the deleteCdsSnapshotFlag field is invalid) |
| deleteCdsSnapshotFlag | boolean | Yes | RequestBody | Whether to release cloud disk server snapshots |
| bccRecycleFlag | boolean | No | RequestBody | Whether to move the instance to the recycle bin upon release |
| deleteRelatedEnisFlag | boolean | No | RequestBody | Whether to delete the associated ENI upon instance release |
Response headers
There are no special headers required beyond the common headers.
Response parameters
There are no special response parameters
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| Instance.DeleteServerFailException | Instance can not release if not postpay. | 403 | Only postpaid instances can be released. |
Request example
Plain Text
1 POST /v2/instance/batchDelete HTTP/1.1
2 Host: bcc.bj.baidubce.com
3 ContentType: application/json
4 Authorization: bce-auth-v1/f81d3b34e48048f**
5
6 {
7 "relatedReleaseFlag": true,
8 "deleteCdsSnapshotFlag": true,
9 "bccRecycleFlag": true,
10 "deleteRelatedEnisFlag": true,
11 "instanceIds": [
12 "i-YufwpQAe"
13 ]
14}
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1e9f9fc4-25d5-450b-9720-29fe66ddf840
3Date: Mar, 22 Dec 2023 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
