Managed databases have a lifecycle independent from sandboxes and deployment runtime instances. Deleting or replacing compute does not implicitly delete an attached database.
Base path: /api/v1/databases
Core lifecycle
| Method | Path | Purpose |
|---|---|---|
GET | /databases | List databases visible to the current tenant and workspace scope |
POST | /databases | Create a managed database |
GET | /databases/{id} | Inspect one database |
DELETE | /databases/{id} | Permanently delete one database |
POST | /databases/{id}/start | Start a stopped or recoverable database |
POST | /databases/{id}/stop | Stop a running database while preserving its volume |
POST | /databases/{id}/restart | Restart the database runtime |
POST | /databases/{id}/wake | Wake a database that can be resumed |
POST | /databases/{id}/resize-compute | Change its compute allocation |
POST | /databases/{id}/move | Move the database through the managed placement workflow |
Data topology and recovery
| Method | Path | Purpose |
|---|---|---|
POST | /databases/{id}/branch | Create an independent database branch |
POST | /databases/{id}/replicas | Create a replica |
POST | /databases/{id}/backups | Create an on-demand backup |
GET | /databases/{id}/backups | List backups |
GET | /databases/{id}/backups/{backup_id} | Inspect one backup |
POST | /databases/{id}/restore | Restore from a selected backup |
GET | /databases/{id}/restores | List restore operations |
GET | /databases/{id}/credentials | Return the current connection contract |
Logs and metrics use the common observability endpoints:
GET /api/v1/databases/{id}/logs
GET /api/v1/databases/{id}/logs/stream
GET /api/v1/databases/{id}/metrics Create
curl -X POST https://api.miosa.ai/api/v1/databases
-H "Authorization: Bearer $MIOSA_API_KEY"
-H "Idempotency-Key: $IDEMPOTENCY_KEY"
-H "Content-Type: application/json"
-d '{"name":"app-production","engine":"postgresql"}' Creation is asynchronous.
Wait until the returned database reaches running before connecting.
miosa databases create postgresql --name app-production --wait --json Credentials
curl https://api.miosa.ai/api/v1/databases/$DATABASE_ID/credentials
-H "Authorization: Bearer $MIOSA_API_KEY" Use the returned recommended connection URL. Do not construct hostnames, ports, usernames, or database names from resource metadata.
Backup and restore
miosa db backup <database-id> --json
miosa db restore <database-id> --backup <backup-id> --force --json Restore replaces the target database contents with the selected backup. Confirm the database ID and backup ID before approving the operation.
Permissions
| Action | Required scope |
|---|---|
| List, inspect, read metrics, or fetch credentials | databases:read |
| Create, resize, branch, back up, restore, move, or delete | databases:write |