All Products
Search
Document Center

Resource Management:EnableResourceDirectory

Last Updated:Sep 02, 2026

Enables a resource directory.

Operation description

You can enable a resource directory by using the current logon account or by creating a new management account. For more information, see Enable a resource directory.

This topic provides an example of how to enable a resource directory by using the current logon account.

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

resourcemanager:EnableResourceDirectory

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

MAName

string

No

The name of the new management account.

Format: <Prefix>@rdadmin.aliyunid.com. The prefix can contain letters, digits, and the special characters _.-. The prefix must start and end with a letter or digit and cannot contain consecutive special characters. The prefix must be 2 to 50 characters in length.

user01@rdadmin.aliyunid.com

MASecureMobilePhone

string

No

The secure phone number of the new management account.

If you leave this parameter empty, the secure phone number of the current logon account is used. The phone number must be the same as the one used to authenticate and obtain the verification code in SendVerificationCodeForEnableRD.

Format: <Country code>-<Phone number>.

Note

Phone numbers from the Chinese mainland in the format 86-<Phone number> are not supported.

xx-13900001234

VerificationCode

string

No

The verification code.

You can call SendVerificationCodeForEnableRD to obtain the verification code.

123456

EnableMode

string

Yes

The method used to enable the resource directory. Valid values:

  • CurrentAccount: enables the resource directory by using the current logon account.

  • NewManagementAccount: enables the resource directory by creating a new management account. If you select this method, you must configure MAName, MASecureMobilePhone, and VerificationCode.

CurrentAccount

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

The response parameters.

ResourceDirectory

object

The resource directory information.

ResourceDirectoryId

string

The ID of the resource directory.

rd-54****

MasterAccountId

string

The ID of the management account.

507408460615****

MasterAccountName

string

The name of the management account.

alice@example.com

RootFolderId

string

The ID of the Root folder.

r-G9****

CreateTime

string

The time when the resource directory was enabled. The time is displayed in UTC in RFC 3339 format, indicated by Z.

2021-12-08T02:15:31.744Z

RequestId

string

The request ID.

EC2FE94D-A4A2-51A1-A493-5C273A36C46A

Examples

Success response

JSON format

{
  "ResourceDirectory": {
    "ResourceDirectoryId": "rd-54****",
    "MasterAccountId": "507408460615****",
    "MasterAccountName": "alice@example.com",
    "RootFolderId": "r-G9****",
    "CreateTime": "2021-12-08T02:15:31.744Z"
  },
  "RequestId": "EC2FE94D-A4A2-51A1-A493-5C273A36C46A"
}

Error codes

HTTP status code

Error code

Error message

Description

409 NotSupport.AccountInAnotherResourceDirectory The specified account is an Alibaba Cloud account or already exists in another resource directory.
409 Invalid.EnterpriseName You must specify the enterprise name. You must specify the enterprise name.
409 EnterpriseRealNameVerificationError The specified account does not pass enterprise real-name verification. We recommend you first complete enterprise real-name verification for the account. The specified account does not pass enterprise real-name verification. We recommend you first complete enterprise real-name verification for the account.
409 EntityAlreadyExists.ResourceDirectory The resource directory for the account is already enabled. We recommend that you do not enable the resource directory again. The resource directory for the account is already enabled. We recommend that you do not enable the resource directory again.
409 InvalidParameter.ManagementAccountName.AlreadyUsed The ManagementAccountName has been used. The management account name already exists. You must specify a valid name.
409 Invalid.VerificationCode The verification code is invalid. The verification code is invalid.
409 InvalidParameter.ManagementAccountName The management account name is in the wrong format. The specified management account name is invalid.
409 InvalidParameter.ManagementAccountSecurityInfo The parameter management account secure mobile phone is invalid. The specified mobile number is invalid.
409 MissingSecureMobilePhone Secure mobile phone is missing. No phone number is specified.
409 MissingSecurityInfo Security info is missing.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.