Managed Databases
Managed databases are provisioned and operated by Dooor OS directly on the cluster using the CloudNativePG operator (PostgreSQL), native operators for MySQL and Redis. Backups, health checks, and failover are handled automatically.
List Databases
/workspaces/{wsId}/databasesReturns a paginated list of managed databases in the workspace. Filter by engine, status, or a search term.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | integer | optional | Page number, starting at 1. Default: 1 |
| limit | integer | optional | Items per page. Default: 20, max: 100 |
| engine | string | optional | Filter by engine: postgresql, mysql, or redis |
| status | string | optional | Filter by status: provisioning, ready, updating, error, deleting |
| search | string | optional | Full-text search on database name and slug |
Response
{
"data": [
{
"id": "db_01hx...",
"name": "Production DB",
"slug": "production-db",
"engine": "postgresql",
"version": "16",
"status": "ready",
"cpu": "250m",
"memory": "512Mi",
"storageGb": 10,
"createdAt": "2025-04-10T09:00:00Z"
}
],
"meta": {
"total": 3,
"page": 1,
"limit": 20,
"totalPages": 1
}
}curl -X GET "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/databases?page=1&limit=20" \
-H "Authorization: Bearer dor_sk_your_key_here"Create Database
/workspaces/{wsId}/databasesProvisions a new managed database on the cluster. The database will enter the provisioning status while the operator sets up the resource. Poll the status endpoint until it reaches ready.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | required | Human-readable display name for the database |
| slug | string | required | URL-safe identifier in DNS-1123 format (e.g. production-db). Must be unique within the workspace. |
| engine | string | required | Database engine: postgresql, mysql, or redis |
| version | string | optional | Engine version (e.g. 16 for PostgreSQL, 8 for MySQL). Defaults to latest stable. |
| cpu | string | optional | CPU request in Kubernetes notation (e.g. 250m, 1). Default: 250m |
| memory | string | optional | Memory request in Kubernetes notation (e.g. 512Mi, 2Gi). Default: 512Mi |
| storageGb | integer | optional | Persistent storage in gigabytes. Range: 1-1024. Default: 10 |
| storageClass | string | optional | Kubernetes StorageClass to use. Defaults to the cluster default storage class. |
Response
{
"id": "db_01hx...",
"name": "Production DB",
"slug": "production-db",
"engine": "postgresql",
"version": "16",
"status": "provisioning",
"cpu": "250m",
"memory": "512Mi",
"storageGb": 10,
"storageClass": "standard",
"createdAt": "2025-04-17T12:00:00Z"
}curl -X POST "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/databases" \
-H "Authorization: Bearer dor_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Production DB",
"slug": "production-db",
"engine": "postgresql",
"version": "16",
"cpu": "250m",
"memory": "512Mi",
"storageGb": 10
}'Get Database
/workspaces/{wsId}/databases/{dbId}Returns the full details of a single database including current resource allocation and status.
Response
{
"id": "db_01hx...",
"name": "Production DB",
"slug": "production-db",
"engine": "postgresql",
"version": "16",
"status": "ready",
"cpu": "250m",
"memory": "512Mi",
"storageGb": 10,
"storageClass": "standard",
"createdAt": "2025-04-10T09:00:00Z",
"updatedAt": "2025-04-10T09:05:00Z"
}curl -X GET "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/databases/{dbId}" \
-H "Authorization: Bearer dor_sk_your_key_here"Database Status
/workspaces/{wsId}/databases/{dbId}/statusReturns the live replica readiness reported by the Kubernetes operator. Use this endpoint to poll until ready equals desired after provisioning or an update.
Response
{
"ready": 1,
"desired": 1
}curl -X GET "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/databases/{dbId}/status" \
-H "Authorization: Bearer dor_sk_your_key_here"Connection Info
/workspaces/{wsId}/databases/{dbId}/connectionReturns the connection details for the database including the full connection URI. These credentials can be injected directly into your app as environment variables.
Response
{
"uri": "postgresql://app_user:s3cr3t@production-db.internal:5432/app_db",
"username": "app_user",
"password": "s3cr3t",
"host": "production-db.internal",
"port": 5432
}curl -X GET "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/databases/{dbId}/connection" \
-H "Authorization: Bearer dor_sk_your_key_here"Update Database
/workspaces/{wsId}/databases/{dbId}Updates the display name or resource allocation of a database. Storage can only be increased - shrinking storageGb is not supported and will return a validation error.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | optional | New display name for the database |
| cpu | string | optional | New CPU request in Kubernetes notation (e.g. 500m, 2) |
| memory | string | optional | New memory request in Kubernetes notation (e.g. 1Gi, 4Gi) |
| storageGb | integer | optional | New storage size in gigabytes. Must be greater than current value (grow only). |
Response
{
"id": "db_01hx...",
"name": "Production DB",
"slug": "production-db",
"engine": "postgresql",
"version": "16",
"status": "updating",
"cpu": "500m",
"memory": "1Gi",
"storageGb": 20,
"updatedAt": "2025-04-17T15:00:00Z"
}curl -X PATCH "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/databases/{dbId}" \
-H "Authorization: Bearer dor_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"cpu": "500m",
"memory": "1Gi",
"storageGb": 20
}'Delete Database
/workspaces/{wsId}/databases/{dbId}Permanently deletes a managed database and all of its data. The Kubernetes resources and persistent volumes are removed from the cluster.
Returns 204 No Content on success.
curl -X DELETE "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/databases/{dbId}" \
-H "Authorization: Bearer dor_sk_your_key_here"