Creates a Resource Access Management (RAM) user.

This topic provides an example on how to create a RAM user named alice.

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 CreateUser

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

UserName String Yes alice

The username of the RAM user.

The username must be 1 to 64 characters in length, and can contain letters, digits, periods (.), hyphens (-), and underscores (_).

DisplayName String No alice

The display name of the RAM user.

The display name must be 1 to 128 characters in length.

MobilePhone String No 86-1868888****

The mobile phone number of the RAM user.

Format: Country code-Mobile phone number.

Note This parameter applies only to the China site (aliyun.com).
Email String No alice@example.com

The email address of the RAM user.

Note This parameter applies only to the China site (aliyun.com).
Comments String No This is a cloud computing engineer.

The description of the RAM user.

The description must be 1 to 128 characters in length.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
User Object

The information about the RAM user.

DisplayName String alice

The display name of the RAM user.

Email String alice@example.com

The email address of the RAM user.

Note This parameter can be returned only on the China site (aliyun.com).
MobilePhone String 86-1868888****

The mobile phone number of the RAM user.

Note This parameter can be returned only on the China site (aliyun.com).
UserId String 122748924538****

The ID of the RAM user.

Comments String This is a cloud computing engineer.

The description of the RAM user.

CreateDate String 2015-01-23T12:33:18Z

The point in time when the RAM user was created. The time is displayed in UTC.

UserName String alice

The username of the RAM user.

RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

Examples

Sample requests

https://ram.aliyuncs.com/?Action=CreateUser
&UserName=alice
&DisplayName=alice
&MobilePhone=86-1868888****
&Email=alice@example.com
&Comments=This is a cloud computing engineer.
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateUserResponse>
    <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
    <User>
        <UserId>122748924538****</UserId>
        <UserName>alice</UserName>
        <DisplayName>alice</DisplayName>
        <MobilePhone>86-1868888****</MobilePhone>
        <Email>alice@example.com</Email>
        <Comments>This is a cloud computing engineer.</Comments>
        <CreateDate>2015-01-23T12:33:18Z</CreateDate>
    </User>
</CreateUserResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "04F0F334-1335-436C-A1D7-6C044FE73368",
  "User" : {
    "UserId" : "122748924538****",
    "UserName" : "alice",
    "DisplayName" : "alice",
    "MobilePhone" : "86-1868888****",
    "Email" : "alice@example.com",
    "Comments" : "This is a cloud computing engineer.",
    "CreateDate" : "2015-01-23T12:33:18Z"
  }
}

After a RAM user is created, you can perform the following operations:

  • Call the CreateLoginProfile operation to allow the RAM user to log on to the Alibaba Cloud Management Console. You can also configure settings such as logon passwords for the RAM user. For more information, see CreateLoginProfile.
  • Call the CreateAccessKey operation to create an AccessKey pair for the RAM user. For more information, see CreateAccessKey.