Possible to launch new Machine via https://api.fly.io/graphql?

I’m trying to launch a new Fly Machine using the internal graphql endpoint: GraphQL Playground and see this error:

      "message": "The launchMachine endpoint has reached its EOL. Please visit https://fly.io/docs/reference/machines/ for more information on how to leverage our new Machines API!",

flyctl allows launching machines using fly machines run ., so the API still works; am wondering if there’s some setting I can specify to call the gql endpoint, or whether I just need to switch to calling the machines REST endpoint when I’m inside the Fly VPC to launch a machine?

1 Like

The CLI uses the REST API to manage machines and it’s the only way to do so on the platform.

1 Like

This might help : )

Connecting to the API

The Machines API endpoint requires a connection to your Fly private network - either by running on a VM inside the network, or via a WireGuard VPN, or using flyctl proxy.

This guide assumes that you have flyctl and curl installed, and have authenticated to the Fly.io platform.

Curious - how does the flyctl manage to launch machines? It’s not running inside the Fly vpc and it seems to be just hitting the graphql endpoint to run a mutation for LaunchMachine.

The CLI creates a user-mode wireguard tunnel which enables the local machine to access the internal network where the API is available at _api.internal.

1 Like