All Products
Search
Document Center

Cloud Governance Center:EnrollAccount

Last Updated:Mar 30, 2026

Creates a new resource account or enrolls an existing resource account in Account Factory.

Operation description

Creates a new resource account or enrolls an existing resource account, and applies the account factory baseline to the account.

Account enrollment is an asynchronous process. After an account is created, the account factory baseline is applied to the account. To query the enrollment details and check the baseline application result, call GetEnrolledAccount.

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

governance:EnrollAccount

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

AccountNamePrefix

string

No

The prefix for the account name.

  • If you are creating a new resource account, this parameter is required.

  • If you are enrolling an existing account, this parameter is not required.

test-account

DisplayName

string

No

The display name of the account.

  • If you are creating a new resource account, this parameter is required.

  • If you are enrolling an existing account, this parameter is not required.

test-account

FolderId

string

No

The ID of the parent folder.

  • If you are creating a new resource account and do not specify this parameter, the account is created in the Root folder.

  • If you are enrolling an existing account, this parameter is not required.

fd-5ESoku****

PayerAccountUid

integer

No

The ID of the billing account.

  • If you are creating a new resource account and do not specify this parameter, the self-pay settlement method is used.

  • If you are enrolling an existing account, this parameter is not required.

19534534552****

AccountUid

integer

No

The ID of the account to enroll.

  • If you are creating a new resource account, this parameter is not required.

  • If you are enrolling an existing account, this parameter is required.

12868156179****

BaselineItems

array<object>

No

The baseline items.

If you specify this parameter, the baseline item configurations are merged with the configurations of the baseline specified by BaselineId. For duplicate baseline items, the configurations in this parameter take precedence. We recommend that you leave this parameter empty and use BaselineId to apply baseline configurations.

object

No

The configurations of the baseline item.

Config

string

No

The configurations of the baseline item.

{\"Notifications\":[{\"GroupKey\":\"account_msg\",\"Contacts\":[{\"Name\":\"aa\"}],\"PmsgStatus\":1,\"EmailStatus\":1,\"SmsStatus\":1}]}

Name

string

No

The name of the baseline item.

ACS-BP_ACCOUNT_FACTORY_VPC

Skip

boolean

No

Specifies whether to skip the baseline item. Valid values:

  • false (default): does not skip the baseline item.

  • true: skips the baseline item.

false

Version

string

No

The version of the baseline item.

1.0

BaselineId

string

No

The ID of the baseline. If you leave this parameter empty, the default baseline is used.

afb-bp1durvn3lgqe28v****

ResellAccountType

string

No

The identity type of the member. Valid values:

  • resell (default): The member is a reseller account. A reseller relationship is automatically established between the member and the reseller. The management account of the resource directory is used as the billing account of the member.

  • non_resell: The member is a non-reseller account. The member is not associated with a reseller and can directly purchase Alibaba Cloud resources. The member is used as its own billing account.

Note

This parameter is available only for resellers at the international site (alibabacloud.com).

resell

RegionId

string

No

The region ID.

cn-hangzhou

Tag

array<object>

No

The tags. You can specify up to 20 tags.

object

No

The tag.

Key

string

No

The tag key.

tagKey

Value

string

No

The tag value.

tagValue

Response elements

Element

Type

Description

Example

object

The returned result.

AccountUid

integer

The ID of the enrolled account.

colspan="1" rowspan="1">

143165363236****

RequestId

string

The request ID.

7071E5FA-515E-5F53-B335-B87D619C6A66

Examples

Success response

JSON format

{
  "AccountUid": 0,
  "RequestId": "7071E5FA-515E-5F53-B335-B87D619C6A66"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The specified parameter %s is not valid. The specified parameter %s is invalid.
400 DeployConflict.Blueprint The %s blueprint is being deployed. Please wait for its deployment to complete and try again. A blueprint is being implemented. Try again later after the blueprint is implemented.
400 DependencyViolation.Blueprint The %s blueprint has not been deployed. Please deploy the resource structure first. You have not deployed a dependent blueprint. You must deploy the dependent blueprint.
400 DependencyViolation.BaselineItem The dependency of %s baseline item has not been configured. Please config %s first. No dependency baseline items are configured. Before you can proceed, you must configure a dependency baseline item.
400 IncorrectBlueprintStatus The current status of the blueprint does not support this operation. The current status of the blueprint does not support this operation.
500 InternalError A system error occurred. A system error occurred.
403 InvalidUser.NotResourceDirectoryMaster The specified account is not a master account of resource directory. The specified account is not a master account of resource directory.
404 InvalidUser.NotFound The specified user does not exist. The user does not exist.
404 InvalidBlueprint.NotFound The specified blueprint does not exist. The specified blueprint does not exist.
404 InvalidBaselineItem.NotFound The specified baseline item named %s does not exist. The specified baseline item does not exist.
404 InvalidEnterpriseRealName.NotFound The specified account has not passed enterprise real name verification. Please complete the verification for the account first. The specified account has not passed enterprise real-name verification. Please complete the verification for the account first.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.