The Machines API now supports Managed Postgres (MPG). Using a Fly API token, you can create, inspect, fork, restore, and delete clusters through api.machines.dev/v1/postgres.
The API also covers backups, extensions, databases, users, credentials, and app attachments. Cluster creation, fork, restore, deletion, and backup creation are asynchronous. For example, a provisioning script can create a cluster, poll until it reports ready, then create the databases and users your app needs.
These endpoints support MPG v2 clusters only; requests for MPG v1 clusters return 404. If you’re on v1, check your dashboard to see whether your cluster is eligible for migration.
App attachments track which apps use a cluster. Connection secrets such as DATABASE_URL are configured separately.
The API reference and OpenAPI spec are public. You can use them to write your own scripts or point a coding agent at them to help automate your setup.
Let us know if you run into bugs or rough edges, or if there’s a specific workflow you’d like to see supported.