Databases
Manage standalone databases through the API. Corelix supports PostgreSQL, MySQL, MariaDB, MongoDB, Redis, ClickHouse, Dragonfly, KeyDB, and 50+ additional database images.
List Databases
GET /api/v1/databases
Response:
{
"data": [
{
"uuid": "db-abc123",
"name": "production-postgres",
"type": "standalone-postgresql",
"status": "running:healthy",
"image": "postgres:16",
"is_public": false,
"created_at": "2024-01-15T10:30:00Z"
}
]
}
Get Database
GET /api/v1/databases/{uuid}
Returns full database configuration including connection details, resource limits, and backup schedules.
Create Database
Create a database by type:
PostgreSQL
POST /api/v1/databases/postgresql
{
"project_uuid": "proj-abc123",
"environment_name": "production",
"server_uuid": "srv-abc123",
"destination_uuid": "dest-abc123",
"name": "production-postgres",
"postgres_user": "app",
"postgres_password": "secure-password",
"postgres_db": "myapp",
"image": "postgres:16",
"is_public": false
}
MySQL
POST /api/v1/databases/mysql
MariaDB
POST /api/v1/databases/mariadb
MongoDB
POST /api/v1/databases/mongodb
Redis
POST /api/v1/databases/redis
ClickHouse
POST /api/v1/databases/clickhouse
Dragonfly
POST /api/v1/databases/dragonfly
KeyDB
POST /api/v1/databases/keydb
Common parameters for all database types:
| Parameter | Type | Required | Description |
|---|---|---|---|
project_uuid | string | Yes | Target project UUID |
environment_name | string | Yes | Target environment name |
server_uuid | string | Yes | Server to deploy on |
destination_uuid | string | Yes | Docker network/destination UUID |
name | string | No | Database name |
image | string | No | Docker image (defaults to latest stable) |
is_public | boolean | No | Make publicly accessible (default: false) |
public_port | integer | No | Public port when is_public is true |
limits_memory | string | No | Memory limit (e.g., 512m, 2g) |
limits_cpus | string | No | CPU limit (e.g., 1, 0.5) |
Response: 201 Created
{
"uuid": "db-abc123",
"name": "production-postgres",
"type": "standalone-postgresql",
"internal_db_url": "postgres://app:secure-password@db-abc123:5432/myapp"
}
Update Database
PATCH /api/v1/databases/{uuid}
{
"name": "updated-name",
"is_public": true,
"public_port": 5433
}
Delete Database
DELETE /api/v1/databases/{uuid}
| Parameter | Type | Default | Description |
|---|---|---|---|
delete_configurations | boolean | true | Delete configuration files |
delete_volumes | boolean | false | Delete persistent data volumes |
docker_cleanup | boolean | true | Remove Docker resources |
Database Actions
Start Database
POST /api/v1/databases/{uuid}/start
Stop Database
POST /api/v1/databases/{uuid}/stop
Restart Database
POST /api/v1/databases/{uuid}/restart
Database Backups
List Backup Schedules
GET /api/v1/databases/{uuid}/backups
Create Backup Schedule
POST /api/v1/databases/{uuid}/backups
{
"frequency": "0 2 * * *",
"s3_storage_id": 1,
"number_of_backups_locally": 5,
"enabled": true
}
| Parameter | Type | Required | Description |
|---|---|---|---|
frequency | string | Yes | Cron expression for schedule |
s3_storage_id | integer | No | S3 storage for remote backups |
number_of_backups_locally | integer | No | Local retention count |
enabled | boolean | No | Enable schedule (default: true) |
Update Backup Schedule
PATCH /api/v1/databases/{uuid}/backups/{backup_uuid}
Delete Backup Schedule
DELETE /api/v1/databases/{uuid}/backups/{backup_uuid}
List Backup Executions
GET /api/v1/databases/{uuid}/backups/{backup_uuid}/executions
Delete Backup Execution
DELETE /api/v1/databases/{uuid}/backups/{backup_uuid}/executions/{execution_uuid}
Environment Variables
List Variables
GET /api/v1/databases/{uuid}/envs
Create Variable
POST /api/v1/databases/{uuid}/envs
Bulk Update
PATCH /api/v1/databases/{uuid}/envs/bulk
Delete Variable
DELETE /api/v1/databases/{uuid}/envs/{env_uuid}