All Products
Search
Document Center

Resource Management:DeleteResourceGroup

Last Updated:Aug 28, 2026

Deletes a resource group.

Operation description

Note

Before you delete a resource group, you must delete all the resources in it.

In this example, the resource group rg-9gLOoK**** is deleted.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

ResourceGroupId

string

Yes

The ID of the resource group.

Call the ListResourceGroups operation to obtain the ID.

rg-9gLOoK****

For common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

1C488B66-B819-4D14-8711-C4EAAA13AC01

ResourceGroup

object

The resource group information.

AccountId

string

The Alibaba Cloud account ID that owns the resource group.

123456789****

CreateDate

string

The time when the resource group was created, in UTC.

2015-01-23T12:33:18Z

DisplayName

string

The display name of the resource group.

my-project

Id

string

The ID of the resource group.

rg-9gLOoK****

Name

string

The unique identifier of the resource group.

my-project

RegionStatuses

object

RegionStatus

array<object>

The status of the resource group in all regions.

object

RegionId

string

The region ID.

cn-qingdao

Status

string

The status of the resource group. Valid values:

  • Creating: The resource group is being created.

  • OK: The resource group is created.

  • PendingDelete: The resource group is waiting to be deleted.

  • Deleting: The resource group is being deleted.

PendingDelete

Status

string

The status of the resource group. Valid values:

  • Creating: The resource group is being created.

  • OK: The resource group is created.

  • PendingDelete: The resource group is waiting to be deleted.

PendingDelete

Examples

Success response

JSON format

{
  "RequestId": "1C488B66-B819-4D14-8711-C4EAAA13AC01",
  "ResourceGroup": {
    "AccountId": "123456789****",
    "CreateDate": "2015-01-23T12:33:18Z",
    "DisplayName": "my-project",
    "Id": "rg-9gLOoK****",
    "Name": "my-project",
    "RegionStatuses": {
      "RegionStatus": [
        {
          "RegionId": "cn-qingdao",
          "Status": "PendingDelete"
        }
      ]
    },
    "Status": "PendingDelete"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.ResourceGroupId The ResourceGroupId is invalid. The resource group ID is invalid.
404 EntityNotExists.ResourceGroup The specified resource group does not exist. You must first create a resource group. The specified resource group does not exist. You must first create a resource group.
409 DeleteConflict.ResourceGroup.Resource Failed to delete the resource group because one or more cloud resources exist in the resource group. Try again later after you release the cloud resources. Failed to delete the resource group because one or more cloud resources exist in the resource group. Try again later after you release the cloud resources.
409 DeleteConflict.ResourceGroup.ResourceCenterResource The resource group cannot be deleted while it contains cloud resources detected by the Resource Center. Please release these resources and try again.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.