Creating an IAM User
Function
This API is provided for the administrator to create an IAM user. An IAM user needs to change its password at the first login.
The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.
Restrictions
When you use this API to create an IAM user, you cannot specify a mobile number or email address for the IAM user. To specify a mobile number and email address, used the API described in Creating an IAM User (Recommended).
URI
POST /v3/users
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Content-Type |
Yes |
String |
Fill application/json;charset=utf8 in this field. |
|
X-Auth-Token |
Yes |
String |
Token with Security Administrator permissions. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Yes |
Object |
User information. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
IAM user name, which consists of 1 to 32 characters. It can contain letters, digits, spaces, hyphens (-), underscores (_), and periods (.) and cannot start with a digit. |
|
domain_id |
No |
String |
ID of the account to which the IAM user belongs. |
|
password |
No |
String |
Password of the user. The password must meet the following requirements:
|
|
enabled |
No |
Boolean |
Enabling status of the IAM user. true (default value) indicates that the user is enabled. false indicates that the user is disabled. |
|
description |
No |
String |
Description of the IAM user. |
Response Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
Object |
IAM user information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
enabled |
Boolean |
Enabling status of the IAM user. true (default value) indicates that the user is enabled. false indicates that the user is disabled. |
|
id |
String |
IAM user ID. |
|
domain_id |
String |
ID of the account to which the IAM user belongs. |
|
name |
String |
IAM user name. |
|
Object |
IAM user resource link information. |
|
|
password_expires_at |
String |
UTC time when the password will expire. null indicates that the password has unlimited validity. |
|
description |
String |
Description of the IAM user. |
Example Request
POST https://iam.myhuaweicloud.com/v3/users
{
"user": {
"name": "IAMUser",
"domain_id": "d78cbac186b744899480f25bd02...",
"enabled": true,
"password": "IAMPassword@",
"description": "IAMDescription"
}
}
Example Response
Status code: 201
The IAM user is created successfully.
{
"user": {
"description": "IAMDescription",
"name": "IAMUser",
"enabled": true,
"links": {
"self": "https://iam.myhuaweicloud.com/v3/users/076598a17b0010e21fdec003f3a2aa45"
},
"domain_id": "d78cbac186b744899480f25b...",
"id": "076598a17b0010e21fdec003f3a2a..."
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
The IAM user is created successfully. |
|
400 |
Invalid parameters. |
|
401 |
Authentication failed. |
|
403 |
Access denied. |
|
404 |
The requested resource cannot be found. |
|
405 |
The method specified in the request is not allowed for the requested resource. |
|
409 |
A resource conflict occurs. |
|
413 |
The request entity is too large. |
|
500 |
Internal server error. |
|
503 |
Service unavailable. |
Error Codes
For details, see Error Codes.
Last Article: Creating an IAM User (Recommended)
Next Article: Changing the Login Password
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.