Last updated: 2019-12-14 11:23:07


1. API Description

API domain name:

This API adds a sub-user.

Default API request rate limit: 20 requests/sec.

2. Input Parameters

The following parameters are required for requesting this API, including action-specific parameters and common parameters. For more information about common parameters for all requests, see Common Request Parameters.

Parameter name Required Type Description
Action Yes String Common parameter; the name of this API: AddUser
Version Yes String Common parameter; the version of this API: 2019-01-16
Region No String Common parameter; optional for this API.
Name Yes String Sub-user name
Remark No String Sub-user remarks
ConsoleLogin No Integer Whether the sub-user can log in to the console
UseApi No Integer Whether to generate a sub-user key
Password No String Console login password for the sub-user. This is valid only if the sub-user is allowed to log in to the console. If a blank parameter is passed in and it has been specified that the sub-user can log in to the console, a random password is generated
NeedResetPassword No Integer Whether the sub-user should reset the password during next login
PhoneNum No String Mobile number
CountryCode No String Country code
Email No String Email address

3. Output Parameters

Parameter name Type Description
Uin Integer Sub-user UIN
Name String Sub-user name
Password String If the combination of input parameters indicates to automatically generate a random password, the generated password is returned.
SecretId String Sub-user secret ID
SecretKey String Sub-user secrete key
Uid Integer Sub-user UID
RequestId String The ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Sample

Sample 1. Adding a Sub-user

Input Sample Code
&<Common request parameter>

Output Sample Code

  "Response": {
    "Uid": 5648765,
    "Uin": 100000546533,
    "Name": "test124",
    "Password": "test123456",
    "SecretId": "faweffewagwaegawe",
    "SecretKey": "fawef23rjhiuaefhuaifhiuawef",
    "RequestId": "b46d2afe-6893-4529-bc96-2c82d9214957"

5. Developer Resources

API Explorer

This tool provides various capabilities such as online call, signature verification, SDK code generation, and quick API retrieval that significantly reduce the difficulty of using TencentCloud API.

6. Error Codes

The following error codes are API business logic-related. For other error codes, see Common Error Codes.

Error Code Description
InvalidParameter.SubUserFull The number of sub-accounts has reached the upper limit.
InvalidParameter.SubUserNameInUse The name of the sub-user already exists.