Databases API
PostgreSQL and MariaDB databases. Authenticate with a Personal Access Token carrying the database:read, database:write or database:firewall scope.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /v1/databases | List databases |
POST | /v1/databases | Create database |
GET | /v1/databases/tiers | List tiers |
GET | /v1/databases/{db_type}/{db_name} | Get database |
DELETE | /v1/databases/{db_type}/{db_name} | Delete database |
GET | /v1/databases/{db_type}/{db_name}/firewall | List firewall rules |
POST | /v1/databases/{db_type}/{db_name}/firewall | Add firewall rule |
DELETE | /v1/databases/{db_type}/{db_name}/firewall/{rule_id} | Remove firewall rule |
GET /v1/databases
List databases
List the databases on your account. Requires the database:read scope.
Response:
| Field | Type | Description |
|---|---|---|
databases | array | |
total | integer |
Example:
curl https://api.wayscloud.services/v1/databases \
-H "X-API-Key: wayscloud_dbaas_abc12_YOUR_SECRET"Response:
{
"databases": [
{
"name": "webapp_prod_db",
"technical_name": "cust_6dd1d906_pg_webapp_prod_db",
"type": "postgresql",
"description": "Production database",
"tier": "standard",
"host": "db.no.wayscloud.services",
"created_at": "2025-10-15T14:30:00Z"
}
],
"total": 1
}POST /v1/databases
Create database
Create a PostgreSQL or MariaDB database. The password is returned once, in this response. Requires the database:write scope.
Request Body:
| Field | Type | Description |
|---|---|---|
db_name | string | Required. Database name: lowercase letters, digits and underscore |
db_type | string | Required. Values: postgresql, mariadb |
description | string | |
tier | string | encrypted runs on encrypted storage at db-secure.no.wayscloud.services Values: standard, encrypted |
Example:
{
"db_name": "webapp_prod_db",
"db_type": "postgresql",
"description": "Production database",
"tier": "standard"
}Response:
| Field | Type | Description |
|---|---|---|
ok | boolean | |
created | boolean | |
friendly_name | string | |
technical_name | string | |
db_type | string | Values: postgresql, mariadb |
host | string | |
port | integer | |
username | string | |
password | string | |
connection_string | string |
Example:
curl -X POST https://api.wayscloud.services/v1/databases \
-H "X-API-Key: wayscloud_dbaas_abc12_YOUR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"db_name": "webapp_prod_db",
"db_type": "postgresql",
"description": "Production database",
"tier": "standard"
}'Response:
{
"ok": true,
"created": true,
"friendly_name": "webapp_prod_db",
"technical_name": "cust_6dd1d906_pg_webapp_prod_db",
"db_type": "postgresql",
"host": "db.no.wayscloud.services",
"port": 5432,
"username": "cust_6dd1d906_pg_webapp_prod_db",
"password": "Xk9mN2pQ4rS7tV3wYz",
"connection_string": "postgresql://cust_6dd1d906_pg_webapp_prod_db:Xk9mN2pQ4rS7tV3wYz@db.no.wayscloud.services:5432/cust_6dd1d906_pg_webapp_prod_db"
}GET /v1/databases/tiers
List tiers
List the tiers you can create databases in. Requires the database:read scope.
Response example:
[
{
"tier": "encrypted",
"name": "Norway Encrypted PostgreSQL",
"description": "Encrypted PostgreSQL node - LUKS encrypted at rest for compliance",
"is_encrypted": true
},
{
"tier": "standard",
"name": "Norway Standard PostgreSQL",
"description": "Standard PostgreSQL node - general purpose workloads",
"is_encrypted": false
}
]Example:
curl https://api.wayscloud.services/v1/databases/tiers \
-H "X-API-Key: wayscloud_dbaas_abc12_YOUR_SECRET"Response:
[
{
"tier": "encrypted",
"name": "Norway Encrypted PostgreSQL",
"description": "Encrypted PostgreSQL node - LUKS encrypted at rest for compliance",
"is_encrypted": true
},
{
"tier": "standard",
"name": "Norway Standard PostgreSQL",
"description": "Standard PostgreSQL node - general purpose workloads",
"is_encrypted": false
}
]GET /v1/databases/{db_type}/
Get database
Get a database with its host, port, status and size. Requires the database:read scope.
Response:
| Field | Type | Description |
|---|---|---|
db_name | string | Technical name |
friendly_name | string | The name you chose at creation |
technical_name | string | |
db_type | string | Values: postgresql, mariadb |
host | string | |
port | integer | |
status | string | As the database node reports it; unknown when the node does not answer |
size_mb | number | |
created_at | string | |
description | string |
Example:
curl https://api.wayscloud.services/v1/databases/{db_type}/{db_name} \
-H "X-API-Key: wayscloud_dbaas_abc12_YOUR_SECRET"Response:
{
"db_name": "cust_6dd1d906_pg_webapp_prod_db",
"friendly_name": "webapp_prod_db",
"technical_name": "cust_6dd1d906_pg_webapp_prod_db",
"db_type": "postgresql",
"host": "db.no.wayscloud.services",
"port": 5432,
"status": "running",
"size_mb": 256.5,
"created_at": "2025-10-15T14:30:00Z",
"description": "Production database"
}DELETE /v1/databases/{db_type}/
Delete database
Delete a database and all its data. This cannot be undone. Requires the database:write scope.
Response:
| Field | Type | Description |
|---|---|---|
ok | boolean | |
deleted | boolean | |
db_name | string | Technical name |
message | string |
Example:
curl -X DELETE https://api.wayscloud.services/v1/databases/{db_type}/{db_name} \
-H "X-API-Key: wayscloud_dbaas_abc12_YOUR_SECRET"Response:
{
"ok": true,
"deleted": true,
"db_name": "cust_6dd1d906_pg_webapp_prod_db",
"message": "Database permanently deleted"
}GET /v1/databases/{db_type}/{db_name}/firewall
List firewall rules
List the IP addresses allowed to connect. Requires the database:firewall scope.
Response:
| Field | Type | Description |
|---|---|---|
rules | array | The rules as the database node reports them: rule_id, ip_address, port, description and created_at, with the database name and type |
total | integer |
Example:
curl https://api.wayscloud.services/v1/databases/{db_type}/{db_name}/firewall \
-H "X-API-Key: wayscloud_dbaas_abc12_YOUR_SECRET"Response:
{
"rules": [
{
"rule_id": "fw-a1b2c3d4-5678-90ab-cdef-123456789abc",
"db_name": "cust_6dd1d906_pg_webapp_prod_db",
"db_type": "postgresql",
"ip_address": "203.0.113.50",
"port": 5432,
"description": "Production server",
"created_at": "2025-10-20T09:15:00Z"
}
],
"total": 1
}POST /v1/databases/{db_type}/{db_name}/firewall
Add firewall rule
Allow an IPv4 address to connect. The rule applies immediately. Requires the database:firewall scope.
Request Body:
| Field | Type | Description |
|---|---|---|
ip_address | string | Required. IPv4 address to allow |
description | string |
Response:
| Field | Type | Description |
|---|---|---|
rule_id | string | |
ip_address | string | |
port | integer | |
description | string | |
created_at | string |
Example:
curl -X POST https://api.wayscloud.services/v1/databases/{db_type}/{db_name}/firewall \
-H "X-API-Key: wayscloud_dbaas_abc12_YOUR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"ip_address": "203.0.113.50",
"description": "Production server"
}'Response:
{
"rule_id": "fw-a1b2c3d4-5678-90ab-cdef-123456789abc",
"ip_address": "203.0.113.50",
"port": 5432,
"description": "Production server",
"created_at": "2025-10-20T09:15:00Z"
}DELETE /v1/databases/{db_type}/{db_name}/firewall/
Remove firewall rule
Remove an allowed IP address. Requires the database:firewall scope.
Response:
| Field | Type | Description |
|---|---|---|
ok | boolean | |
message | string | |
rule_id | string |
Example:
curl -X DELETE https://api.wayscloud.services/v1/databases/{db_type}/{db_name}/firewall/{rule_id} \
-H "X-API-Key: wayscloud_dbaas_abc12_YOUR_SECRET"Response:
{
"ok": true,
"message": "Firewall rule removed",
"rule_id": "fw-a1b2c3d4-5678-90ab-cdef-123456789abc"
}