Modifying User Information
Function
This API is provided for the administrator to modify IAM user information.
The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.
Restrictions
This API cannot be used to change the mobile number and email address of an IAM user. To change the mobile number and email address, use the API described in Modifying IAM User Information (Recommended).
URI
PATCH /v3/users/{user_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
user_id |
Yes |
String |
IAM user ID. For details about how to obtain a user ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information. |
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 |
IAM user information. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
domain_id |
No |
String |
ID of the account to which the IAM user belongs. |
|
name |
No |
String |
New 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. |
|
password |
No |
String |
New password, which 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. |
|
pwd_status |
No |
Boolean |
Password status. true means that the password needs to be changed, and false means that the password is normal. |
Response Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
Object |
IAM user information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
IAM user name. |
|
domain_id |
String |
ID of the account to which the IAM user belongs. |
|
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. |
|
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. |
|
pwd_status |
Boolean |
Password status. true means that the password needs to be changed, and false means that the password is normal. |
|
last_project_id |
String |
ID of the project that the IAM user lastly accessed before exiting the system. |
|
Object |
Other information about the IAM user. |
|
|
Object |
IAM user resource link information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
description |
String |
Description of the IAM user. |
|
pwd_status |
Boolean |
Password status. true means that the password needs to be changed, and false means that the password is normal. |
|
last_project_id |
String |
ID of the project that the IAM user lastly accessed before exiting the system. |
Example Request
PATCH https://iam.myhuaweicloud.com/v3/users/{user_id}
{
"user": {
"domain_id": "d78cbac186b744899480f25bd02...",
"name": "IAMUser",
"password": "IAMPassword@",
"enabled": true,
"pwd_status": false,
"description": "IAMDescription"
}
}
Example Response
Status code: 200
The request is successful.
{
"user": {
"pwd_status": false,
"description": "IAMDescription",
"name": "IAMUser",
"extra": {
"pwd_status": false,
"description": "IAMDescription",
},
"enabled": true,
"links": {
"self": "https://iam.myhuaweicloud.com/v3/users/07609fb9358010e21f7bc003751c7..."
},
"id": "07609fb9358010e21f7bc003751c7...",
"domain_id": "d78cbac186b744899480f25bd02..."
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The request is successful. |
|
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: Modifying IAM User Information (Recommended)
Next Article: Deleting an IAM User
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.