Updated on 2025-12-09 GMT+08:00

Batch Deleting DB Instances

Function

This API is used to batch delete pay-per-use DB instances.

To delete DB instances and read replicas billed in the yearly/monthly mode, unsubscribe from the order first. For details, see Unsubscribing from a Yearly/Monthly Instance.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

rds:instance:deleteInstance

write

-

-

rds:instance:delete

-

Constraints

  • This API is supported for the MySQL DB engine only.
  • A maximum of 50 pay-per-use DB instances can be deleted at a time.

URI

  • URI format

    POST /v3/{project_id}/instances/batch-delete

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    The value cannot be empty.

    Range

    N/A

    Default Value

    N/A

Request Parameters

Table 2 Parameters

Parameter

Mandatory

Description

instance_ids

Yes

Definition

Instance IDs.

Constraints

N/A

Range

N/A

Default Value

N/A

Example Request

Batch delete DB instances.

POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/batch-delete

{
     "instance_ids" : [ 
        "347288b745f9455faa700e88c17ca276in01",
        "230e3f38495e437097dbef6266e208fdin01" 
    ]
}

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    records

    Object

    Definition

    Records of instance deletion tasks. If an instance fails to be deleted, no record will be returned.

    For details about the data structure, see Table 4.

    Table 4 records data structure

    Parameter

    Type

    Description

    instance_id

    String

    Definition

    Instance ID.

    Range

    N/A

    job_id

    String

    Definition

    Deletion workflow ID.

    Range

    N/A

  • Example normal response
    { 
      "records" : [ { 
        "instance_id" : "347288b745f9455faa700e88c17ca276in01", 
        "job_id" : "3508dff1-7d4d-41d6-833d-1f38f93e02da" 
      } ] 
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.