UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
This function lists an account's PostgreSQL® database users.
Important:
When you disable the PostgreSQL role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Postgresql/list_users
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Postgresql/list_users
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Postgresql/list_users{ "apiversion": 3, "func": "list_users", "module": "Postgresql", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function renames a PostgreSQL® database user.
Important:
When you disable the PostgreSQL role, the system disables this function.
The database user's new name.
Note:
If database prefixing is enabled, this parameter must include the database prefix for the account.
The database user's current name.
Note:
If database prefixing is enabled, this parameter must include the database prefix for the account.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Postgresql/rename_user
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Postgresql/rename_user
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Postgresql/rename_user?newname=dbuser2&oldname=dbuser&password=123456luggage'{ "apiversion": 3, "func": "rename_user", "module": "Postgresql", "result": { "data": null, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function renames a PostgreSQL® database user.
Warning:
- If you rename a PostgreSQL user, you must set the password for the database user. This is required because of the md5 hash that PostgreSQL creates to store user passwords.
- We strongly recommend that you use the
Postgresql::rename_user functioninstead of this one.
Important:
When you disable the PostgreSQL role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Postgresql/rename_user_no_password
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Postgresql/rename_user_no_password
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Postgresql/rename_user_no_password?newname=dbuser2&oldname=dbuser'{ "apiversion": 3, "func": "rename_user_no_password", "module": "Postgresql", "result": { "data": null, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }