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.
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 |
Access token issued to a user to bear its identity and permissions. For details about the permissions required by the token, see Actions. |
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 or space. |
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 |
Password expiration time. If this parameter is set to null, the password will never expire.
NOTE:
The value is a UTC time in the YYYY-MM-DDTHH:mm:ss.ssssssZ format, for example, 2023-06-28T08:56:33.710000Z. For details about the date and timestamp formats, see ISO-8601. |
description |
String |
Description of the IAM user. |
Example Request
Request for an administrator to create an IAM user named IAMUser
POST https://iam.myhuaweicloud.eu/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.eu/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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.