Creates a cloud account.

A resource directory supports two types of member accounts: resource accounts and cloud accounts.

  • Resource account (recommended): A resource account is only used as a resource container and fully depends on a resource directory. Such member accounts are secure and easy-to-create. For more information about how to create a resource account, see CreateResourceAccount.
Note A resource account can be upgraded to a cloud account. For more information, see PromoteResourceAccount.
  • Cloud account: A cloud account has all the features of an Alibaba Cloud account, including root permissions.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateCloudAccount

The operation that you want to perform. Set the value to CreateCloudAccount.

DisplayName String Yes admin-****

The display name of the member account.

The name must be 2 to 50 characters in length and can contain letters, digits, underscores (_), periods (.), and hyphens (-).

The name must be unique in the current resource directory.

Email String Yes someone@example.com

The email address used to log on to the cloud account.

ParentFolderId String Yes fd-bVaRIG****

The ID of the parent folder.

PayerAccountId String No 12323344****

The ID of the settlement account. If you do not specify this parameter, the current account is used for settlement.

Response parameters

Parameter Type Example Description
Account Struct

The information of the member account.

AccountId String 12323344****

The ID of the member account.

AccountName String someone@example.com

The name of the member account.

DisplayName String admin-****

The display name of the member account.

FolderId String fd-bVaRIG****

The ID of the folder.

JoinMethod String created

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

  • invited: The member account is invited to join the resource directory.
  • created: The member account is directly created in the resource directory.
ModifyTime String 2015-01-23T12:33:18Z

The time when the member account was modified.

RecordId String 06950264-3f0d-4ca9-82dd-6ee7a3d3****

The account record ID.

ResourceDirectoryId String rd-k3****

The ID of the resource directory.

Status String CreateVerifying

The status of the member account. Valid values:

  • CreateSuccess: The member account is created.
  • CreateVerifying: The creation of the member account is under confirmation.
  • CreateFailed: The member account failed to be created.
  • CreateExpired: The creation of the member account expired.
  • CreateCancelled: The creation of the member account is canceled.
  • PromoteVerifying: The upgrade of the member account is under confirmation.
  • PromoteFailed: The member account failed to be upgraded.
  • PromoteExpired: The upgrade of the member account expired.
  • PromoteCancelled: The upgrade of the member account is canceled.
  • PromoteSuccess: The member account is upgraded.
  • InviteSuccess: The owner of the member account accepted the invitation.
  • Removed: The member account is removed from the resource directory.
Type String CloudAccount

The type of the member account. The value CloudAccount indicates that the member account is a cloud account.

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

The ID of the request.

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=CreateCloudAccount
&DisplayName=admin-****
&Email=someone@example.com
&ParentFolderId=fd-bVaRIG****
&<Common request parameters>

Sample success responses

XML format

<CreateCloudAccountResponse>
      <RequestId>9B34724D-54B0-4A51-B34D-4512372FE1BE</RequestId>
      <Account>
            <ResourceDirectoryId>rd-k3****</ResourceDirectoryId>
            <AccountId>12323344****</AccountId>
            <AccountName>someone@example.com</AccountName>
            <DisplayName>admin-****</DisplayName>
            <FolderId>fd-bVaRIG****</FolderId>
            <JoinMethod>created</JoinMethod>
            <Type>CloudAccount</Type>
            <Status>CreateVerifying</Status>
            <RecordId>06950264-3f0d-4ca9-82dd-6ee7a3d3****</RecordId>
            <ModifyTime>2015-01-23T12:33:18Z</ModifyTime>
      </Account>
</CreateCloudAccountResponse>

JSON format

{
    "RequestId": "9B34724D-54B0-4A51-B34D-4512372FE1BE",
    "Account": {
        "ResourceDirectoryId":"rd-k3****",
        "AccountId": "12323344****",
        "AccountName": "someone@example.com",
        "DisplayName": "admin-****",
        "FolderId": "fd-bVaRIG****",
        "JoinMethod": "created",
        "Type":"CloudAccount",
        "Status":"CreateVerifying",
        "RecordId":"06950264-3f0d-4ca9-82dd-6ee7a3d3****",
        "ModifyTime":"2015-01-23T12:33:18Z"
    }
}

Error codes

HTTP status code Error code Error message Description
400 MissingParameter.Account.DisplayName You must specify DisplayName. The error message returned because the DisplayName parameter is not specified. Specify this parameter.
400 InvalidParameter.Account.DisplayName The DisplayName of account is invalid. The error message returned because the value of the DisplayName parameter is invalid. The value can contain only letters, digits, underscores (_), periods (.), and hyphens (-).
400 InvalidParameter.Account.DisplayName.Length The DisplayName of the account exceeds the length limit. The error message returned because the length of the value specified for the DisplayName parameter has exceeded the upper limit. The value must be 2 to 50 characters in length.
400 InvalidParameter.ParentFolderId The ParentFolderId is invalid. The error message returned because the value of the ParentFolderId parameter is invalid. The value must start with r- followed by 6 characters or start with fd- followed by 10 characters. Valid characters are letters and digits.
400 MissingParameter.Email You must specify Email. The error message returned because the Email parameter is not specified. Specify this parameter.
400 InvalidParameter.Email The Email is invalid. The error message returned because the format of the value specified for the Email parameter is invalid.
409 LimitExceeded.Account The maximum number of member accounts in a resource directory exceeds the limit. The error message returned because the maximum number of member accounts in the resource directory has been reached.
409 InvalidParameter.Account.DisplayName.AlreadyUsed The displayname of account has been used. The error message returned because the name already exists. Change the name.
409 EntityAlreadyExists.ResourceDirectory.Account The email address that the system generates when you create a member account already exists. Try again later. The error message returned because the email address that the system generated already exists. Try again later.
409 InvalidParameter.Email.AlreadyUsed The email has been used. The error message returned because the email address is in use. Enter another email address.
404 EntityNotExists.ResourceDirectory The resource directory for the account is not enabled. We recommend that you first enable the resource directory for the account. The error message returned because the resource directory for the account is not enabled. Enable the resource directory for the account.
404 EntityNotExists.Folder The resource directory folder does not exist. The error message returned because the folder does not exist. Create the folder first.
409 Invalid.PayRelation Failed to create a member. The specified billing account is unavailable. Please change to another billing account and try again. The error message returned because the member account has failed to be created. The specified settlement account is unavailable. Specify a valid account and try again.
409 NotSupport.PayerAccountInAnotherResourceDirectory The specified settlement account does not exist in the resource directory. You must specify a valid settlement account. The error message returned because the settlement account is not in the resource directory. Specify a valid settlement account.

For a list of error codes, visit the API Error Center.