You need to enable JavaScript to run this app.
RDS for PostgreSQL

RDS for PostgreSQL

Copy page
Download PDF
Managing accounts
CreateDBAccount
Copy page
Download PDF
CreateDBAccount
Call the CreateDBAccount API to create an account.​
Request type​
Synchronous request.​
Debug​
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​
​
Parameter​
Type​
Required?​
Example​
Description​
InstanceId​
String​
Yes​
postgres-ca7b7019****​
Instance ID.​
AccountName​
String​
Yes​
testuser1​
Database account name. The rules for setting the account name are as follows:​
  • The name length is limited to 2–63 characters.​
  • Consists of letters, digits, underscores (_), or hyphens (-).​
  • Must start with a letter and end with a letter or a digit.​
  • Cannot start the name with pg_.​
  • Reserved words cannot be used. For the list of all disabled keywords, refer to Disabled keywords.​
AccountPassword​
String​
Yes​
Test@123456​
Database account password. The rules for setting the database account password are as follows:​
  • The password length is limited to 8~32 characters.​
  • The password consists of any three types of characters as follows: uppercase letters, lowercase letters, digits, and special characters.​
  • Special characters include !@#$%^*&()_+-=.​
AccountType​
String​
Yes​
Normal​
Database account type, with the following values:​
  • Super: super account.​
  • Normal: normal account.​
  • InstanceReadOnly: instance read-only account.​
AccountPrivileges​
String​
No​
Inherit,Login,CreateRole,CreateDB​
Account privileges information. Separate multiple privileges with commas (,). Values:​
  • Login: login privileges.​
  • Inherit: inherit privileges.​
  • CreateRole: role creation privileges.​
  • CreateDB: database creation privileges.​
tip​
  • When the account type is a super account, this parameter is not required, and all privileges are enabled by default.​
  • When the account type is a normal account, this parameter can be provided. The default value is Login and Inherit.​
  • When the account type is an instance read-only account, that is, AccountType is set to InstanceReadOnly, this parameter is not supported.​
NotAllowPrivileges​
Array of String​
No​
DDL​
Disabled permissions for the account. Currently, it only supports the value DDL.​
tip​
This field only supports input for super account or normal account, that is, when AccountType values are Super or Normal.​
​
Response parameter​
null​
Sample​
Sample request​
​
POST /?Action=CreateDBAccount&Version=2022-01-01 HTTP/1.1​
Content-Type: application/json​
Host: rds-postgresql.cn-beijing.volcengineapi.com​
X-Date: 20231002T101010Z​
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_postgresql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****​
{​
"InstanceId": "postgres-ca7b7019****",​
"AccountName": "test_user",​
"AccountType": "Super",​
"AccountPassword": "Root123@",​
"AccountPrivileges": "CreateDB,CreateRole,Inherit,Login",​
"NotAllowPrivileges": [​
"DDL"​
]​
}​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "2023080216414436E7C5AAAC0F06F41091",​
"Action": "CreateDBAccount",​
"Version": "2022-01-01",​
"Service": "rds_postgresql",​
"Region": "cn-beijing"​
},​
"Result": null​
}​
​
Last updated: 2026.03.31 10:45:18