Databases API
Create and manage PostgreSQL, MySQL, Redis, and MongoDB database instances.
List 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
Engine type: postgresql, mysql, redis, or mongodb
Engine version (e.g., 16 for PostgreSQL)
Storage size in GB (default: 10)
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
| Status | Description |
|---|
provisioning | StatefulSet being created |
running | Database is ready and accepting connections |
stopped | Database has been stopped |
error | Provisioning or runtime error |
destroyed | Permanently deleted |
Supported Engines
| Engine | Versions | Features |
|---|
| PostgreSQL | 14, 15, 16 | HA, PITR, pooling (CloudNativePG) |
| MySQL | 8.0, 8.4 | Replication, backups |
| Redis | 7.0, 7.2 | Persistence, clustering |
| MongoDB | 6.0, 7.0 | Replica sets, sharding |