Interface description

Creates a RAM user.

Request parameters

Action
  • Type: String
  • Required: Yes
  • Description: Operation name. It is a required parameter and its value is CreateUser.
UserName
  • Type: String
  • Required: Yes
  • Description: User name, which can contain a maximum of 64 characters
  • Format:
    ^[a-zA-Z0-9\. @\\-_]+$
DisplayName
  • Type: String
  • Required: No
  • Description: Display name, which can contain a maximum of 128 characters
  • Format:
    ^[a-zA-Z0-9\.@\-\u4e00-\u9fa5]+$
MobilePhone
  • Type: String
  • Required: No
  • Description: A RAM user's mobile phone number
  • Format: International area code-mobile phone number, for example, 86-18600008888
E-mail
  • Type: String
  • Required: No
  • Description: A RAM user's email address
Comments
  • Type: String
  • Required: No
  • Description: Remarks, which can contain a maximum of 128 characters

Required permissions

Action
ram:CreateUser
Resource
acs:ram:*:${AccountId}:user/*

Return parameters

User
  • Type: User
  • Description: User information

Error messages

InvalidParameter.UserName.InvalidChars
  • HTTP Status: 400
  • Error Message: The parameter - "UserName" contains invalid chars.
InvalidParameter.UserName.Length
  • HTTP status: 400
  • Error Message: The parameter - "UserName" beyond the length limit.
InvalidParameter.DisplayName.InvalidChars
  • HTTP Status: 400
  • Error Message: The parameter - "DisplayName" contains invalid chars.
InvalidParameter.DisplayName.Length
  • HTTP Status: 400
  • Error Message: The parameter - "DisplayName" beyond the length limit.
InvalidParameter.Comments.Length
  • HTTP Status: 400
  • Error Message: The parameter - "Comments" beyond the length limit.
InvalidParameter.MobilePhone.Format
  • HTTP Status: 400
  • Error Message: The format of the parameter - "MobilePhone" is incorrect.
InvalidParameter.Email.Format
  • HTTP Status: 400
  • Error Message: The format of the parameter - "Email" is incorrect.
EntityAlreadyExists.User
  • HTTP Status: 409
  • Error Message: The user does already EXIST.
LimitExceeded.User
  • HTTP Status: 409
  • Error Message: The count of users beyond the current limits.

Examples

Request example
Note To facilitate readability, parameters are not encoded in the following request examples (Percent Encode):
https://ram.aliyuncs.com/?Action=CreateUser
&UserName=zhangqiang
&DisplayName=zhangqiang
&MobilePhone=86-18688888888
&Email=zhangqiang@example.com
&Comments=This is a cloud computing engineer.
&<Public request parameters>
Response examples
  • XML format
    <CreateUserResponse>
     <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
     <User>
    <UserId>1227489245380721</UserId>
    <UserName>zhangqiang</UserName>
    <DisplayName>zhangqiang</DisplayName>
    <MobilePhone>86-18600008888</MobilePhone>
      <Email>zhangqiang@example.com</Email>
       <Comments>This is a cloud computing engineer.</Comments>
       <CreateDate>2015-01-23T12:33:18Z</CreateDate>
       </User>
      </CreateUserResponse>
  • JSON format
    {
        "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
        "User": {
            "UserId": "1227489245380721",
            "UserName": "zhangqiang",
            "DisplayName": "zhangqiang",
            "MobilePhone": "86-18600008888",
            "Email": "maid ",
            "Comments": "This is a cloud computing engineer".
            "CreateDate": "2015-01-23T12:33:18Z"
        }
    }