CreateUser

Updated at:

Creates an EIAM account under a specified EIAM instance.

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

eiam:CreateUser

create

*User

acs:eiam:{#regionId}:{#accountId}:instance/{#InstanceId}/user/*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

idaas_ue2jvisn35ea5lmthk267xxxxx

Username

string

Yes

The username. It can contain letters, digits, and the following special characters: underscores (_), periods (.), at signs (@), and hyphens (-). The maximum length is 256 characters.

user_001

DisplayName

string

No

The display name of the account. The maximum length is 128 characters.

name_001

Password

string

No

The password. For specific format requirements, see the password policy.

123456

PhoneRegion

string

No

The region code of the mobile phone number. It must be 1 to 6 digits in length and cannot contain a plus sign (+). For example, the region code for the Chinese mainland is 86, without 00 or +. This parameter is required if the mobile phone number is specified.

86

PhoneNumber

string

No

The mobile phone number. It must be 6 to 15 digits in length.

12345678901

PhoneNumberVerified

boolean

No

Specifies whether the mobile phone number is verified and trusted. If the mobile phone number is specified, this parameter is required. If no special business requirements exist, set this parameter to true.

true

Email

string

No

The email address. The prefix can contain uppercase and lowercase letters, digits, periods (.), underscores (_), and hyphens (-). The maximum length is 128 characters.

example@example.com

EmailVerified

boolean

No

Specifies whether the email address is verified and trusted. If the email address is specified, this parameter is required. If no special business requirements exist, set this parameter to true.

true

UserExternalId

string

No

The external ID of the account, which is used to associate the account with an external system. The maximum length is 128 characters. If this parameter is not specified, the account ID is used by default.

user_d6sbsuumeta4h66ec3il7yxxxx

PrimaryOrganizationalUnitId

string

Yes

The ID of the primary organizational unit.

ou_wovwffm62xifdziem7an7xxxxx

OrganizationalUnitIds

array

No

The IDs of the organizational units to which the account belongs. An account can belong to multiple organizational units.

string

No

The organizational unit ID.

ou_adz2vmgiwpo4tu6jtss3mynjji

Description

string

No

The description. The maximum length is 256 characters.

description text

CustomFields

array<object>

No

The list of custom fields.

[{"FieldName":"age","FieldValue":"10"}]

object

No

The custom field object.

FieldName

string

No

The identifier of the custom field. You must create the custom field in advance. For more information, see the Custom Fields module in the console.

age

FieldValue

string

No

The value of the custom field. The value must comply with the attribute limits of the corresponding custom field.

10

PasswordInitializationConfig

object

No

The password initialization configuration.

PasswordForcedUpdateStatus

string

No

Specifies whether to force the user to update the password. By default, this feature is disabled. Valid values:

  • enabled: enables the feature.

  • disabled: disables the feature.

enabled

PasswordInitializationPolicyPriority

string

No

The password initialization policy priority. By default, this parameter does not take effect. Valid values:

  • global: global priority. The instance-level password initialization policy is used, and the password initialization Settings in this request are all invalid. For more information, see the password initialization Settings in the password policies.

  • custom: custom priority. The currently defined password initialization Settings prevail, including whether to force password updates, the password initialization method, and the notification channels.

global

PasswordInitializationType

string

No

The password initialization method. Valid values:

  • random: generates a random password.

random

UserNotificationChannels

array

No

The list of password notification channels.

["sms"]

string

No

The password notification channel. Valid values:

  • email: email.

  • sms: text message.

sms

ClientToken

string

No

Ensures the idempotence of the request. You can generate a parameter value from your client to ensure that the parameter value is unique among different requests. ClientToken supports only ASCII characters and cannot exceed 64 characters in length. For more information, see References: How to ensure idempotence.

client-token-example

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

0441BD79-92F3-53AA-8657-F8CE4A2B912A

UserId

string

The account ID.

user_d6sbsuumeta4h66ec3il7yxxxx

Examples

Success response

JSON format

{
  "RequestId": "0441BD79-92F3-53AA-8657-F8CE4A2B912A",
  "UserId": "user_d6sbsuumeta4h66ec3il7yxxxx"
}

Error codes

HTTP status code

Error code

Error message

Description

400 MissingParameter.CustomField.%s The specified parameter:CustomField.%s is required. Extension field is required
400 InvalidParameter.CustomField.%s The custom field:%s is invalid: %s. The extension field is malformed
403 ResourceDuplicated.Username The specified resource: Username already exist. Duplicate user name
403 ResourceDuplicated.CustomField.%s The specified CustomField.%s resource: %s already exist. The value of this extension field cannot be repeated.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.