WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function lists the server's database users.
Warning:
On most servers, this function returns a large amount of output. We strongly suggest that you filter and sort the output.
Important:
When you disable the MySQL/MariaDB and PostgreSQL roles and remote MySQL is not already configured, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_database_users
- A server running WHM.
https://whm-server.tld:2087/json-api/list_database_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/whm.openapi/list_database_users{ "data": { "payload": [ … ] }, "metadata": { "command": "list_database_users", "reason": "OK", "result": 1, "version": 1 } }
Request
This function lists the server's databases.
Warning:
On most servers, this function returns a large amount of output. We strongly suggest that you filter and sort the output.
Important:
When you disable the MySQL/MariaDB and PostgreSQL roles and remote MySQL is not already configured, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_databases
- A server running WHM.
https://whm-server.tld:2087/json-api/list_databases
- 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/whm.openapi/list_databases{ "data": { "payload": [ … ] }, "metadata": { "command": "list_databases", "reason": "OK", "result": 1, "version": 1 } }
Request
This function retrieves the MySQL® database and user data for the specified account.
Important:
When you disable the MySQL/MariaDB role and remote MySQL is not already configured, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_mysql_databases_and_users
- A server running WHM.
https://whm-server.tld:2087/json-api/list_mysql_databases_and_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/whm.openapi/list_mysql_databases_and_users?user=username'{ "data": { "mysql_config": { … }, "mysql_databases": { … } }, "metadata": { "command": "list_mysql_databases_and_users", "reason": "OK", "result": 1, "version": 1 } }