Databases (Admin)
GET /api/v1/accounts/{username}/databases
List databases for an account
Returns every database owned by the given account.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
ApiSuccess_list_DatabaseResponse__ |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"data": [
{
"charset": "...",
"collation": "...",
"name": "...",
"remote_hosts": "...",
"size_mb": "...",
"users": "..."
}
],
"message": "",
"status": "success",
"warnings": [
"string"
]
}
cURL example:
curl -X GET \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
https://your-server:2000/api/v1/accounts/{username}/databases
POST /api/v1/accounts/{username}/databases
Create database
Create a new MariaDB database for the account, auto-prefixed with {username}_. Enforces the plan's max_databases cap.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
Body fields:
| Field | Type | Required | Notes |
|---|---|---|---|
charset |
string | no | default utf8mb4 |
collation |
string | no | default utf8mb4_unicode_ci |
name |
string | yes | minLength=1; maxLength=47; pattern=^[a-z][a-z0-9_]{0,46}$ |
Request body example:
{
"charset": "utf8mb4",
"collation": "utf8mb4_unicode_ci",
"name": "string"
}
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
ApiSuccess_DatabaseResponse_ |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"data": {
"charset": "utf8mb4",
"collation": "utf8mb4_unicode_ci",
"name": "string",
"remote_hosts": [
"..."
],
"size_mb": 0.0,
"users": [
"..."
]
},
"message": "",
"status": "success",
"warnings": [
"string"
]
}
cURL example:
curl -X POST \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
-H "Content-Type: application/json" \
-d @body.json \
https://your-server:2000/api/v1/accounts/{username}/databases
GET /api/v1/accounts/{username}/databases/phpmyadmin-url
Mint a tenant-scoped phpMyAdmin SSO URL
Returns a short-lived, single-use phpMyAdmin sign-in for this account only: a MariaDB user that exists for five minutes with grants on the account's own databases, never the server's root. db (short name) opens that database. The answer is the same as the client panel's: PMA_NOT_INSTALLED comes as a 200 error envelope; an account without databases answers 404 DATABASE_NOT_FOUND.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
Query parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
db |
string | no | — |
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
— | Successful Response |
422 |
HTTPValidationError |
Validation Error |
cURL example:
curl -X GET \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
https://your-server:2000/api/v1/accounts/{username}/databases/phpmyadmin-url
DELETE /api/v1/accounts/{username}/databases/{db_name}
Delete database
Drop the database and remove its user/grant entries.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
MessageResponse |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"message": "string",
"status": "success"
}
cURL example:
curl -X DELETE \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}
GET /api/v1/accounts/{username}/databases/{db_name}/phpmyadmin-url
Mint phpMyAdmin SSO URL
Returns a short-lived SSO login URL for the panel's embedded phpMyAdmin. Returns a 200 with error_code=PMA_NOT_INSTALLED when phpMyAdmin is not present — handle both shapes client-side.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
object |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{}
cURL example:
curl -X GET \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}/phpmyadmin-url
GET /api/v1/accounts/{username}/databases/{db_name}/remote-hosts
List remote hosts
Returns the IPs / patterns currently allowed to connect to this database.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
ApiSuccess_list_RemoteHostResponse__ |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"data": [
{
"host": "...",
"note": "...",
"users": "..."
}
],
"message": "",
"status": "success",
"warnings": [
"string"
]
}
cURL example:
curl -X GET \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}/remote-hosts
POST /api/v1/accounts/{username}/databases/{db_name}/remote-hosts
Add remote host
Whitelist a host/IP pattern for remote database access.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
Body fields:
| Field | Type | Required | Notes |
|---|---|---|---|
host |
string | yes | — |
note |
string | no | default `` |
Request body example:
{
"host": "string",
"note": ""
}
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
ApiSuccess_RemoteHostResponse_ |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"data": {
"host": "string",
"note": "",
"users": [
"..."
]
},
"message": "",
"status": "success",
"warnings": [
"string"
]
}
cURL example:
curl -X POST \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
-H "Content-Type: application/json" \
-d @body.json \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}/remote-hosts
DELETE /api/v1/accounts/{username}/databases/{db_name}/remote-hosts/{host}
Remove remote host
Revoke remote access for the given host pattern.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
host |
string | yes | — |
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
MessageResponse |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"message": "string",
"status": "success"
}
cURL example:
curl -X DELETE \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}/remote-hosts/{host}
POST /api/v1/accounts/{username}/databases/{db_name}/users
Create database user
Create a new MariaDB user and grant it access to this database.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
Body fields:
| Field | Type | Required | Notes |
|---|---|---|---|
host |
string | no | default localhost |
password |
string | yes | — |
privileges |
array |
no | — |
username |
string | yes | minLength=1; maxLength=15; pattern=^[a-z][a-z0-9_]{0,14}$ |
Request body example:
{
"host": "localhost",
"password": "REPLACE_ME",
"privileges": [
"string"
],
"username": "alice"
}
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
ApiSuccess_DatabaseUserResponse_ |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"data": {
"host": "string",
"privileges": [
"..."
],
"username": "alice"
},
"message": "",
"status": "success",
"warnings": [
"string"
]
}
cURL example:
curl -X POST \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
-H "Content-Type: application/json" \
-d @body.json \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}/users
DELETE /api/v1/accounts/{username}/databases/{db_name}/users/{db_user}
Delete database user
Revoke + drop the MariaDB user.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
db_user |
string | yes | — |
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
MessageResponse |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"message": "string",
"status": "success"
}
cURL example:
curl -X DELETE \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}/users/{db_user}
PUT /api/v1/accounts/{username}/databases/{db_name}/users/{db_user}
Update database user (password reset)
Currently only rotates the MariaDB password for an existing user.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
db_user |
string | yes | — |
Body fields:
| Field | Type | Required | Notes |
|---|---|---|---|
password |
string | no | — |
Request body example:
{
"password": "string"
}
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
MessageResponse |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"message": "string",
"status": "success"
}
cURL example:
curl -X PUT \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
-H "Content-Type: application/json" \
-d @body.json \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}/users/{db_user}
DELETE /api/v1/accounts/{username}/databases/{db_name}/users/{db_user}/grants
Revoke a user's access to this database
Removes the user's privileges on this database only. The user keeps its grants on other databases and is dropped when none remain.
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
db_user |
string | yes | — |
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
MessageResponse |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"message": "string",
"status": "success"
}
cURL example:
curl -X DELETE \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}/users/{db_user}/grants
POST /api/v1/accounts/{username}/databases/{db_name}/users/{db_user}/grants
Grant existing user access to another database
Used by the panel's 'Assign User' flow when the user already exists on a different DB — issues a GRANT only (no CREATE USER).
Path parameters:
| Name | Type | Required | Notes |
|---|---|---|---|
username |
string | yes | — |
db_name |
string | yes | — |
db_user |
string | yes | — |
Body fields:
| Field | Type | Required | Notes |
|---|---|---|---|
privileges |
array |
no | — |
Request body example:
{
"privileges": [
"string"
]
}
Responses:
| Status | Schema | Description |
|---|---|---|
200 |
ApiSuccess_DatabaseUserResponse_ |
Successful Response |
422 |
HTTPValidationError |
Validation Error |
Response example (200):
{
"data": {
"host": "string",
"privileges": [
"..."
],
"username": "alice"
},
"message": "",
"status": "success",
"warnings": [
"string"
]
}
cURL example:
curl -X POST \
-H "X-WHost-Key: $WHOST_API_KEY" \
-H "X-WHost-Timestamp: $(date +%s)" \
-H "X-WHost-Nonce: $(openssl rand -hex 16)" \
-H "X-WHost-Signature: $(compute_hmac)" \
-H "Content-Type: application/json" \
-d @body.json \
https://your-server:2000/api/v1/accounts/{username}/databases/{db_name}/users/{db_user}/grants
Our support team is here around the clock for anything you can't find above.