Databases API

Create and manage PostgreSQL, MySQL, Redis, and MongoDB database instances.

List Databases

GET /api/v1/databases
Response:
[
  {
    "id": "db_a1b2c3d4",
    "project_id": "proj_default",
    "name": "main-postgres",
    "slug": "main-postgres",
    "db_type": "postgresql",
    "version": "16",
    "plan_id": "db-s-2vcpu-4gb",
    "status": "running",
    "region": "nyc1",
    "storage_gb": 50,
    "replicas": 1,
    "created_at": "2024-01-15T10:30:00Z"
  }
]

Create a Database

POST /api/v1/databases
name
string
required
Database instance name
db_type
string
required
Engine type: postgresql, mysql, redis, or mongodb
version
string
Engine version (e.g., 16 for PostgreSQL)
plan_id
string
required
Instance size plan
region
string
required
Deployment region
storage_gb
integer
Storage size in GB (default: 10)
replicas
integer
Number of replicas for HA (default: 1)
{
  "name": "main-postgres",
  "db_type": "postgresql",
  "version": "16",
  "plan_id": "db-s-2vcpu-4gb",
  "region": "nyc1",
  "storage_gb": 50,
  "replicas": 1
}
Response: 201 Created
{
  "id": "db_a1b2c3d4",
  "name": "main-postgres",
  "db_type": "postgresql",
  "status": "provisioning",
  "created_at": "2024-01-15T10:30:00Z"
}

Get a Database

GET /api/v1/databases/{id}

Delete a Database

DELETE /api/v1/databases/{id}
This permanently destroys the database instance and all data. This cannot be undone.

Get Connection Credentials

GET /api/v1/databases/{id}/credentials
Response (PostgreSQL):
{
  "host": "main-postgres.production.svc",
  "port": 5432,
  "username": "app_user",
  "password": "generated-password",
  "database": "main_postgres",
  "ssl_mode": "require",
  "connection_string": "postgresql://..."
}
Response (Redis):
{
  "host": "cache-redis.production.svc",
  "port": 6379,
  "password": "generated-password",
  "connection_string": "redis://..."
}

Database Status

StatusDescription
provisioningStatefulSet being created
runningDatabase is ready and accepting connections
stoppedDatabase has been stopped
errorProvisioning or runtime error
destroyedPermanently deleted

Supported Engines

EngineVersionsFeatures
PostgreSQL14, 15, 16HA, PITR, pooling (CloudNativePG)
MySQL8.0, 8.4Replication, backups
Redis7.0, 7.2Persistence, clustering
MongoDB6.0, 7.0Replica sets, sharding