API: Databases
List databases
GET /api/v1/databases
curl -H "Authorization: Bearer sk_live_..." \
https://api.flokk.dev/api/v1/databases
Returns an array of database objects.
Create a database
POST /api/v1/databases
curl -X POST https://api.flokk.dev/api/v1/databases \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "name": "my-app", "tier": "starter", "pg_version": "16" }'
The response includes the generated password (shown once), connection host, and database name with its random suffix.
Get a database
GET /api/v1/databases/:id
Get connection info
GET /api/v1/databases/:id/connection-info
Returns the host, port, database name, username, and connection string templates for both rw and ro endpoints.
Rotate credentials
POST /api/v1/databases/:id/credentials/rotate
Generates a new password. The old password is invalidated immediately. Returns the new password (shown once).
Install an extension
POST /api/v1/databases/:id/extensions { "name": "vector" }
Remove an extension
DELETE /api/v1/databases/:id/extensions/:name
Change plan
POST /api/v1/databases/:id/plan { "tier": "pro" }
Delete a database
DELETE /api/v1/databases/:id
Permanently deletes the database, its PG role, and all associated backups. This cannot be undone.