You need to enable JavaScript to run this app.
Document Database for MongoDB

Document Database for MongoDB

Copy page
Download PDF
Account management
ResetDBAccount
Copy page
Download PDF
ResetDBAccount
Call the ResetDBAccount API to modify password of specified account or reset the permissions of the root account to its initial state for target MongoDB instance.​
Request type​
Synchronous request.​
Precautions​
  • Different account types support modifying different information via the ResetDBAccount API. Among them:​
  • Super accounts (i.e., AccountType is UserAdmin) and normal accounts (i.e., AccountType is Normal)​
  • This API supports modifying the passwords of super or normal accounts. For more details about different account types, see Account type.​
  • Super administrator account (i.e., when AccountType is Super):​
  • Through this API, you can modify the super administrator's password or reset permissions to their initial state (i.e., grant all permissions allowed for the super administrator account). For details on the complete permissions that can be granted to a super administrator account, see Database and account permissions.​
  • Modifying the password may cause the database connection using the current account to be interrupted. Operate with caution.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
InstanceId String required Sample value: mongo-replica-e405f8e2f8e2​
Instance ID.​
tip​
You can call the DescribeDBInstances API to query the basic information of all MongoDB instances in the target region, including the instance ID.​
​
AccountName String required Sample value: testacc​
The name of the database account.​
tip​
You can call the DescribeDBAccounts API to query account information under the target instance, including the account name.​
​
AuthDB String Optional Sample value: testdb​
The database to which the account belongs.​
tip​
If this parameter is not set, the account whose password needs to be changed defaults to the admin database.​
​
AccountPassword String required Sample value: Test@123456​
The password of the database account. The password must meet the following requirements:​
  • Can only contain uppercase and lowercase letters, numbers, and the following special characters _#!@$%^&*()+=-.​
  • The length is 8 to 32 characters.​
  • Must contain at least three of the following: uppercase letters, lowercase letters, numbers, or special characters.​
  • Weak passwords that are easily cracked are not allowed (such as Admin@123).​
tip​
  • Modifying the password may interrupt database connections currently using this account. Proceed with caution.​
​
ResetDBAccount Boolean Optional Sample value: false​
Resets the root account's permissions to their initial state (i.e., grants all permissions allowed for a super administrator account). The value range is as follows:​
  • false (Default value): Does not reset.​
  • true: Resets.​
tip​
  • This parameter only applies to the root account in the admin database (i.e., where AuthDB is admin and AccountName is root).​
​
​
Response parameters​
The current API has no specified response parameters. For more information, see Response structure.​
Example​
Request example 1​
Change the password for the testacc account in testdb to Test@12****.​
​
POST https://mongodb.cn-beijing.volcengineapi.com/?Action=ResetDBAccount&Version=2022-01-01 HTTP/1.1​
Host: mongodb.cn-beijing.volcengineapi.com​
Content-Type: application/json; charset=utf-8​
X-Date: 20201103T104027Z​
Authorization: HMAC-SHA256 Credential=AK****/20201103/cn-beijing/mongodb/request,SignedHeaders=content-type;host;x-date,Signature=****​
{​
"InstanceId":"mongo-replica-e405f8e2f8e2",​
"AccountName":"testacc",​
"AuthDB":"testdb",​
"AccountPassword":"Test@123456"​
}​
​
Response example 1​
​
{​
"ResponseMetadata": {​
"RequestId": "202203091439160102121681030B0B****",​
"Action": "ResetDBAccount",​
"Version": "2022-01-01",​
"Service": "mongodb",​
"Region": "cn-beijing"​
},​
"Result": null​
}​
​
Request example 2​
Change the password for the root account in the admin database to Pwd@12**** and reset its permissions to the initial state.​
​
POST https://mongodb.cn-beijing.volcengineapi.com/?Action=ResetDBAccount&Version=2022-01-01 HTTP/1.1​
Host: mongodb.cn-beijing.volcengineapi.com​
Content-Type: application/json; charset=utf-8​
X-Date: 20201103T104027Z​
Authorization: HMAC-SHA256 Credential=AK****/20201103/cn-beijing/mongodb/request,SignedHeaders=content-type;host;x-date,Signature=****​
{​
"InstanceId":"mongo-replica-e405f8e2f8e2",​
"AccountName":"root",​
"AuthDB":"admin",​
"AccountPassword":"Pwd@123456",​
"ResetDBAccount": true ​
}​
​
Sample response 2​
​
{​
"ResponseMetadata": {​
"RequestId": "202203091439160102121681030B0B****",​
"Action": "ResetDBAccount",​
"Version": "2022-01-01",​
"Service": "mongodb",​
"Region": "cn-beijing"​
},​
"Result": null​
}​
​
Error code​
For more details, see Error code.​
Last updated: 2026.07.23 14:28:27