All Products
Search
Document Center

Resource Management:UpdateAccount

Last Updated:Feb 28, 2025

Changes the display name of a member, or switches the type of a member.

Operation description

  • To ensure that the system can record the operators of management operations, you must use a RAM user or RAM role to which the AliyunResourceDirectoryFullAccess policy is attached within the management account of your resource directory to call this operation.
  • Before you switch the type of a member from resource account to cloud account, make sure that specific conditions are met. For more information about the conditions, see Switch a resource account to a cloud account.
  • Before you switch the type of a member from cloud account to resource account, make sure that specific conditions are met. For more information about the conditions, see Switch a cloud account to a resource account.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
resourcemanager:UpdateAccountupdate
*Account
acs:resourcemanager::{#accountId}:account/{#ResourceDirectoryPath}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NewDisplayNamestringNo

The new display name of the member.

Note You can specify either NewDisplayName or NewAccountType.
admin
NewAccountTypestringNo

The new type of the member. Valid values:

  • ResourceAccount: resource account
  • CloudAccount: cloud account
Note You can specify either NewDisplayName or NewAccountType.
ResourceAccount
AccountIdstringYes

The Alibaba Cloud account ID of the member.

12323344****
DryRunbooleanNo

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks items such as whether the member status can be modified and whether security information is configured for the member. If the request does not pass the dry run, an error code is returned.
  • false (default): performs a dry run and performs the actual request.
false

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

Accountobject

The information of the member.

Statusstring

The status of the member. Valid values:

  • CreateSuccess: The member is created.
  • InviteSuccess: The member accepts the invitation.
  • Removed: The member is removed.
  • SwitchSuccess: The type of the member is switched.
CreateSuccess
Typestring

The type of the member. Valid values:

  • CloudAccount: cloud account
  • ResourceAccount: resource account
ResourceAccount
DisplayNamestring

The display name of the member.

admin
FolderIdstring

The ID of the folder.

fd-bVaRIG****
ResourceDirectoryIdstring

The ID of the resource directory.

rd-k3****
JoinTimestring

The time when the member joined the resource directory. The time is displayed in UTC.

2015-01-23T12:33:18Z
AccountIdstring

The Alibaba Cloud account ID of the member.

12323344****
JoinMethodstring

The way in which the member joins the resource directory. Valid values:

  • invited: The member is invited to join the resource directory.
  • created: The member is directly created in the resource directory.
created
ModifyTimestring

The time when the member was modified. The time is displayed in UTC.

2015-01-23T12:33:18Z
AccountNamestring

The Alibaba Cloud account name of the member.

ecs-manager@aliyun.com
RequestIdstring

The ID of the request.

9B34724D-54B0-4A51-B34D-4512372FE1BE

Examples

Sample success responses

JSONformat

{
  "Account": {
    "Status": "CreateSuccess",
    "Type": "ResourceAccount",
    "DisplayName": "admin",
    "FolderId": "fd-bVaRIG****",
    "ResourceDirectoryId": "rd-k3****",
    "JoinTime": "2015-01-23T12:33:18Z",
    "AccountId": "12323344****",
    "JoinMethod": "created",
    "ModifyTime": "2015-01-23T12:33:18Z",
    "AccountName": "ecs-manager@aliyun.com"
  },
  "RequestId": "9B34724D-54B0-4A51-B34D-4512372FE1BE"
}

Error codes

HTTP status codeError codeError messageDescription
404EntityNotExists.ResourceDirectoryThe resource directory for the account is not enabled. We recommend that you first enable the resource directory for the account.The account is not used to enable a resource directory. Use the account to enable a resource directory first.
404EntityNotExists.AccountThis resource directory account does not exist.The member does not exist. Create such a member first.
409InvalidParameter.Account.DisplayName.AlreadyUsedThe displayname of account has been used.The display name already exists. Specify a valid display name.
409MissingDisplayNameOrAccountTypeEither display name or account type must be specified.You must specify either the display name or type of the member.
409AccountTypeMismatchThe type or status of the member account cannot satisfy the current operation.The type or status of the member account cannot satisfy the current operation.
409PrimaryAkInUseThe account has the primary AK in use.-
409MissingSecurityInfoSecurity information is missing.-
409LegalEntityDifferentThe account legal entity is different from the one of the Management Account.The legal entity of the account is inconsistent with that of the management account.
409CallerIdentityErrorPlease use the RAM user or role of the Management Account.Only a RAM user or RAM role within the management account can be used to perform this operation.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-03-14The Error code has changed. The request parameters of the API has changedView Change Details