Skip to main content

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:

ParameterTypeRequiredDescription
project_uuidstringYesTarget project UUID
environment_namestringYesTarget environment name
server_uuidstringYesServer to deploy on
destination_uuidstringYesDocker network/destination UUID
namestringNoDatabase name
imagestringNoDocker image (defaults to latest stable)
is_publicbooleanNoMake publicly accessible (default: false)
public_portintegerNoPublic port when is_public is true
limits_memorystringNoMemory limit (e.g., 512m, 2g)
limits_cpusstringNoCPU 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}
ParameterTypeDefaultDescription
delete_configurationsbooleantrueDelete configuration files
delete_volumesbooleanfalseDelete persistent data volumes
docker_cleanupbooleantrueRemove 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
}
ParameterTypeRequiredDescription
frequencystringYesCron expression for schedule
s3_storage_idintegerNoS3 storage for remote backups
number_of_backups_locallyintegerNoLocal retention count
enabledbooleanNoEnable 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}