Modifying User Information (Including Email Address and Mobile Number) as the Administrator

Function

This API is provided for the administrator to modify user information.

URI

PUT /v3.0/OS-USER/users/{user_id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

user_id

Yes

String

User ID.

Request Parameters

Table 2 Parameters in the request header

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.

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

user

Yes

Object

IAM user information.

Table 4 user

Parameter

Mandatory

Type

Description

name

No

String

New username with 1 to 255 characters

password

No

String

New password of the user. The password must meet the following requirements:

  • Can contain 6 to 32 characters. The default minimum password length is 6 characters.

  • Must contain at least two of the following character types: uppercase letters, lowercase letters, digits, and special characters.

  • Must meet the requirements of the password policy configured on the account settings page.

  • Must be different from the old password.

email

No

String

Email address, which can contain not more than 255 characters.

areacode

No

String

Country code. The country code must be used together with a mobile number.

phone

No

String

New mobile number, which can contain a maximum of 32 digits. The mobile number must be used together with a country code.

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.

pwd_status

No

Boolean

Indicates whether the user must change their password at the first login. true (default value) indicates that the user must change their password at the first login. false indicates that the user does not need to change their password at the first login.

xuser_type

No

String

Type of the user in the external system. The user type can contain a maximum of 64 characters. xuser_type must be used together with xuser_id and will be verified based on xaccount_type and xdomain_type of the same account.

Note

An external system refers to an enterprise management system connected to cloud system. Parameters xaccount_type, xaccount_id, xdomain_type, xdomain_id, xuser_type, and xuser_id cannot be obtained from the cloud system. Please contact the enterprise administrator.

xuser_id

No

String

ID of the user in the external system. The user ID can contain a maximum of 128 characters, and must be used together with xuser_type.

Note

An external system refers to an enterprise management system connected to cloud system. Parameters xaccount_type, xaccount_id, xdomain_type, xdomain_id, xuser_type, and xuser_id cannot be obtained from the cloud system. Please contact the enterprise administrator.

access_mode

No

String

Access type of the IAM user.

  • default: programmatic access and management console access. This option is the default access type.

  • programmatic: programmatic access

  • console: management console access

description

No

String

Description of the IAM user.

Response Parameters

Table 5 Parameters in the response body

Parameter

Type

Description

user

Object

IAM user information.

Table 6 user

Parameter

Type

Description

pwd_status

Boolean

Whether password reset is required at first login.

xuser_id

String

ID of the user in the external system.

Note

An external system refers to an enterprise management system connected to cloud system. Parameters xaccount_type, xaccount_id, xdomain_type, xdomain_id, xuser_type, and xuser_id cannot be obtained from the cloud system. Please contact the enterprise administrator.

xuser_type

String

Type of the user in the external system.

Note

An external system refers to an enterprise management system connected to cloud system. Parameters xaccount_type, xaccount_id, xdomain_type, xdomain_id, xuser_type, and xuser_id cannot be obtained from the cloud system. Please contact the enterprise administrator.

description

String

Description of the IAM user.

name

String

New IAM user name with 5 to 32 characters. The username can contain special characters, but only hyphens (-), underscores (_), and spaces are allowed. It cannot start with a digit.

phone

String

New mobile number, which can contain a maximum of 32 digits. The mobile number must be used together with a country code.

domain_id

String

ID of the account which the user belongs to.

enabled

Boolean

Enabling status of the IAM user. true (default value) indicates that the user is enabled. false indicates that the user is disabled.

pwd_status

Boolean

Indicates whether the user must change their password at the first login. true (default value) indicates that the user must change their password at the first login. false indicates that the user does not need to change their password at the first login.

areacode

String

Country code.

email

String

New email address.

id

String

IAM user ID.

links

Object

User resource link information.

password_expires_at

String

UTC time when the password will expire. null indicates that the password has unlimited validity.

Table 7 user.links

Parameter

Type

Description

self

String

Resource link.

Example Request

PUT https://sample.domain.com/v3.0/OS-USER/users/{user_id}
{
    "user": {
        "email": "IAMEmail@123.com",
        "areacode": "0086",
        "phone": "12345678910",
        "enabled": true,
        "name": "IAMUser",
        "password": "IAMPassword@",
        "pwd_status": false,
        "xuser_type": "",
        "xuser_id": "",
        "description": "IAMDescription"
    }
}

Example Response

Status code: 200

The request is successful.

{
    "user": {
        "description": "IAMDescription",
        "areacode": "0086",
        "enabled": true,
        "pwd_status": false,
        "xuser_id": "",
        "domain_id": "d78cbac186b744899480f25bd0...",
        "phone": "12345678910",
        "name": "IAMUser",
        "links": {
            "self": "https://sample.domain.com/3.0/OS-USER/users/076934ff9f0010cd1f0bc003..."
        },
        "id": "076934ff9f0010cd1f0bc0031019...",
        "xuser_type": "",
        "email": "IAMEmail@123.com"
    }
}

Status Codes

Status Code

Description

200

The request is successful.

400

The server failed to process the request.

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

Status Code

Error Code

Error Message

400

1100

Mandatory parameters are missing.

400

1101

Invalid username.

400

1102

Invalid email address.

400

1103

Incorrect password.

400

1104

Invalid mobile number.

400

1105

The value of xuser_type must be the same as that of xdomain_type.

400

1106

The country code and mobile number must be set at the same time.

400

1107

The account administrator cannot be deleted.

400

1108

The new password must be different from the old password.

400

1109

The username already exists.

400

1110

The email address has already been used.

400

1111

The mobile number has already been used.

400

1113

The user ID or user type already exists.

400

1115

The number of IAM users has reached the maximum allowed limit.

400

1117

Invalid user description.