All Products
Search
Document Center

Identity as a Service:CreateUser

Last Updated:Mar 31, 2026

Create an EIAM account in a specific 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 ID of the instance.

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. The maximum length is 128 characters.

name_001

Password

string

No

The password. The format must comply with the password policy.

123456

PhoneRegion

string

No

The country code. It must contain 1 to 6 digits and must not include the plus sign (+).

86

PhoneNumber

string

No

The phone number. It must be 6 to 15 digits long.

12345678901

PhoneNumberVerified

boolean

No

Indicates whether the phone number is verified. A verified number is considered trusted. This parameter is required if you specify the PhoneNumber parameter. For typical use, set this to true.

true

Email

string

No

The email address. The local part of the address can contain uppercase letters, lowercase letters, digits, periods (.), underscores (_), or hyphens (-). The maximum length is 128 characters.

example@example.com

EmailVerified

boolean

No

Indicates whether the email address is verified. A verified address is considered trusted. This parameter is required if you specify the Email parameter. For typical use, set this to true.

true

UserExternalId

string

No

The external ID for associating the user with an external system. The maximum length is 128 characters. If this parameter is not specified, its value defaults to the system-generated user ID.

user_d6sbsuumeta4h66ec3il7yxxxx

PrimaryOrganizationalUnitId

string

Yes

The ID of the primary organizational unit.

ou_wovwffm62xifdziem7an7xxxxx

OrganizationalUnitIds

array

No

A list of subordinate organizational unit IDs. A user can belong to multiple organizational units.

string

No

The ID of the organizational unit.

ou_adz2vmgiwpo4tu6jtss3mynjji

Description

string

No

The description. The maximum length is 256 characters.

description text

CustomFields

array<object>

No

The list of custom fields.

description

object

No

The custom field object.

FieldName

string

No

The identifier of the custom field. You must create this field in the console before you can use it in a request. For more information, see the Custom Fields module in the console.

age

FieldValue

string

No

The value of the custom field. This value must comply with the constraints defined for the corresponding custom field.

10

PasswordInitializationConfig

object

No

The settings for the password initialization policy.

PasswordInitializationPolicyPriority

string

No

The priority of the password initialization policy. This setting is disabled by default. Valid values:

  • global: The service uses the instance-level password initialization policy and ignores the policy specified in this request. For more information, see the password initialization policy settings.

  • custom: The service uses the password initialization policy defined in this request. This includes the forced password update setting, the password initialization method, and the notification channels.

global

PasswordForcedUpdateStatus

string

No

The status of forced password update. This setting is disabled by default. Valid values:

  • enabled: Enables forced password updates.

  • disabled: Disables forced password updates.

enabled

UserNotificationChannels

array

No

The list of password notification channels.

sms

string

No

The password notification channel. Valid values:

  • email: The notification is sent by email.

  • sms: The notification is sent by SMS message.

sms

PasswordInitializationType

string

No

The password initialization type. Valid values:

  • random: The system generates a random password.

random

ClientToken

string

No

A client-provided token to ensure the idempotence of the request. This value must be unique for each request. The token can contain only ASCII characters and must be no more than 64 characters long. For more information, see 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 user 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

403 ResourceDuplicated.Username The specified resource: Username already exist. Duplicate user name

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.