On this page

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

MethodPathPurpose
GET/databasesList databases visible to the current tenant and workspace scope
POST/databasesCreate a managed database
GET/databases/{id}Inspect one database
DELETE/databases/{id}Permanently delete one database
POST/databases/{id}/startStart a stopped or recoverable database
POST/databases/{id}/stopStop a running database while preserving its volume
POST/databases/{id}/restartRestart the database runtime
POST/databases/{id}/wakeWake a database that can be resumed
POST/databases/{id}/resize-computeChange its compute allocation
POST/databases/{id}/moveMove the database through the managed placement workflow

Data topology and recovery

MethodPathPurpose
POST/databases/{id}/branchCreate an independent database branch
POST/databases/{id}/replicasCreate a replica
POST/databases/{id}/backupsCreate an on-demand backup
GET/databases/{id}/backupsList backups
GET/databases/{id}/backups/{backup_id}Inspect one backup
POST/databases/{id}/restoreRestore from a selected backup
GET/databases/{id}/restoresList restore operations
GET/databases/{id}/credentialsReturn 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

ActionRequired scope
List, inspect, read metrics, or fetch credentialsdatabases:read
Create, resize, branch, back up, restore, move, or deletedatabases:write

See also

Was this helpful?