From a91b5a21461a09add87bfc8e126f173aa441b7e4 Mon Sep 17 00:00:00 2001 From: Ronnie Miller Date: Mon, 23 Nov 2026 15:40:36 -0800 Subject: [PATCH 1/4] Use name, not app_name, in Machines API create-app examples --- blueprints/warm-pool-user-machines.mdx | 2 +- machines/api/apps-resource.mdx | 4 ++-- networking/custom-private-networks.mdx | 2 +- snippets/reference/machines/create-app-req.mdx | 2 +- snippets/reference/machines/create-app.mdx | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/blueprints/warm-pool-user-machines.mdx b/blueprints/warm-pool-user-machines.mdx index c4c553d84b..ab60e56239 100644 --- a/blueprints/warm-pool-user-machines.mdx +++ b/blueprints/warm-pool-user-machines.mdx @@ -26,7 +26,7 @@ curl -X POST "https://api.machines.dev/v1/apps" \ -H "Authorization: Bearer ${FLY_API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ - "app_name": "pool-x7f3k2", + "name": "pool-x7f3k2", "org_slug": "my-org", "network": "pool-x7f3k2" }' diff --git a/machines/api/apps-resource.mdx b/machines/api/apps-resource.mdx index d864e2206c..228ae393c1 100644 --- a/machines/api/apps-resource.mdx +++ b/machines/api/apps-resource.mdx @@ -38,7 +38,7 @@ Machines must be associated with a Fly App. App names must be unique. #### Body parameters - + Name of the app to create @@ -59,7 +59,7 @@ curl -i -X POST \\ -H "Authorization: Bearer ${FLY_API_TOKEN}" -H "Content-Type: application/json" \\ "${FLY_API_HOSTNAME}/v1/apps" \\ -d '{ - "app_name": "my-app-name", + "name": "my-app-name", "org_slug": "personal", "network": "my-optional-network" }' diff --git a/networking/custom-private-networks.mdx b/networking/custom-private-networks.mdx index 767b0dc13c..1edf6ea4e1 100644 --- a/networking/custom-private-networks.mdx +++ b/networking/custom-private-networks.mdx @@ -39,7 +39,7 @@ curl -i -X POST \\ -H "Authorization: Bearer ${FLY_API_TOKEN}" -H "Content-Type: application/json" \\ "${FLY_API_HOSTNAME}/v1/apps" \\ -d '{ - "app_name": "my-app-name", + "name": "my-app-name", "org_slug": "personal", "network": "my-custom-network-name" }' diff --git a/snippets/reference/machines/create-app-req.mdx b/snippets/reference/machines/create-app-req.mdx index befc8023c7..9e45b1473b 100644 --- a/snippets/reference/machines/create-app-req.mdx +++ b/snippets/reference/machines/create-app-req.mdx @@ -3,7 +3,7 @@ curl -i -X POST \\ -H "Authorization: Bearer ${FLY_API_TOKEN}" -H "Content-Type: application/json" \\ "${FLY_API_HOSTNAME}/v1/apps" \\ -d '{ - "app_name": "my-app-name", + "name": "my-app-name", "org_slug": "personal" }' diff --git a/snippets/reference/machines/create-app.mdx b/snippets/reference/machines/create-app.mdx index 8c0a86b87d..d4b017f57b 100644 --- a/snippets/reference/machines/create-app.mdx +++ b/snippets/reference/machines/create-app.mdx @@ -3,7 +3,7 @@ curl -i -X POST \\ -H "Authorization: Bearer ${FLY_API_TOKEN}" -H "Content-Type: application/json" \\ "${FLY_API_HOSTNAME}/v1/apps" \\ -d '{ - "app_name": "my-app-name", + "name": "my-app-name", "org_slug": "personal", "network": "my-app-name-network" }' From b78bea37900fde6119bad29fe60e7153312c1fec Mon Sep 17 00:00:00 2001 From: Ronnie Miller Date: Mon, 23 Nov 2026 15:40:37 -0800 Subject: [PATCH 2/4] Document Machines API ip_assignments endpoint on Apps page --- machines/api/apps-resource.mdx | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/machines/api/apps-resource.mdx b/machines/api/apps-resource.mdx index 228ae393c1..4839bb5d2e 100644 --- a/machines/api/apps-resource.mdx +++ b/machines/api/apps-resource.mdx @@ -14,6 +14,10 @@ You can use the Apps resource to create and manage Fly Apps. A Fly App is an abs POST /v1/apps + + POST + /v1/apps/{'{app_name}'}/ip_assignments + GET /v1/apps/{'{app_name}'} @@ -76,9 +80,37 @@ To segment the app into its own network, you can pass a `network` argument in th ## Allocate an IP address for global request routing -If you intend for Machines to be accessible to the internet, you’ll need to allocate an IP address to the app. Currently this is done using `flyctl` or the [Fly.io GraphQL API](https://api.fly.io/graphql). This offers your app automatic, global routing via [Anycast](/networking/services#about-anycast). Read more about this in [the Networking section](/machines/api/machines-resource#notes-on-networking). +`POST /v1/apps/{app_name}/ip_assignments` + +If you intend for Machines to be accessible to the internet, you’ll need to allocate an IP address to the app, with this endpoint or with `flyctl`. This offers your app automatic, global routing via [Anycast](/networking/services#about-anycast). Read more about this in [the Networking section](/machines/api/machines-resource#notes-on-networking). + +#### Body parameters + + + Type of IP address to allocate: `shared_v4` (an IPv4 address shared with other apps), `v4` (a dedicated IPv4 address), `v6`, or `private_v6` (a [Flycast](/networking/flycast) address). The [OpenAPI spec](https://docs.machines.dev/openapi.json) also lists the egress types. + + +```sh title="POST/v1/apps/{app_name}/ip_assignments" +curl -i -X POST \ + -H "Authorization: Bearer ${FLY_API_TOKEN}" -H "Content-Type: application/json" \ + "${FLY_API_HOSTNAME}/v1/apps/my-app-name/ip_assignments" \ + -d '{"type": "shared_v4"}' +``` + +```json title="Status: 200 OK - Example response" +{ + "ip": "66.241.125.240", + "region": null, + "service_name": null, + "shared": true, + "created_at": null, + "egress": false, + "network": null, + "ip_pair": null +} +``` -Example: +With flyctl: ```sh cmd From 2a2391aa199262e9f3be606b9db5a3881ef478a9 Mon Sep 17 00:00:00 2001 From: Ronnie Miller Date: Mon, 23 Nov 2026 15:40:37 -0800 Subject: [PATCH 3/4] State 1-60 second range for Machine wait timeout --- machines/api/machines-resource.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machines/api/machines-resource.mdx b/machines/api/machines-resource.mdx index c82cb3c909..f2bacbaad4 100644 --- a/machines/api/machines-resource.mdx +++ b/machines/api/machines-resource.mdx @@ -482,7 +482,7 @@ Filter for a specific Machine `instance_id` (version). Required when waiting for -The time, in seconds, to wait for the Machine to enter the specified state. Default is 60. +The time, in seconds, to wait for the Machine to enter the specified state: a whole number from 1 to 60. Default is 60. From f754ea269e7e1ced2e79eaadf60fe29e92a5631e Mon Sep 17 00:00:00 2001 From: Ronnie Miller Date: Tue, 24 Nov 2026 20:29:07 -0800 Subject: [PATCH 4/4] Use name and Machines API IP calls in MCP Machines API guide --- .../deploy-with/machines-api.mdx | 38 +++---------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/model-context-protocol/deploy-with/machines-api.mdx b/model-context-protocol/deploy-with/machines-api.mdx index edfd5b46e7..faf2cef4d8 100644 --- a/model-context-protocol/deploy-with/machines-api.mdx +++ b/model-context-protocol/deploy-with/machines-api.mdx @@ -61,7 +61,7 @@ curl -i -X POST \ -H "Content-Type: application/json" \ "${FLY_API_HOSTNAME}/v1/apps" \ -d "{ \ - \"app_name\": \"${APP_NAME}\", \ + \"name\": \"${APP_NAME}\", \ \"org_slug\": \"${ORG}\" \ }" ``` @@ -70,46 +70,20 @@ Response should be a `200` Success, along with some JSON output. ## Create IP addresses for your application - -While the Fly.io GraphQL endpoint is public, our [usage of it](https://github.com/superfly/fly-go/blob/main/resource_ip_addresses.go) is [open source](https://github.com/superfly/fly-go/blob/main/LICENSE), can be directly observed by setting `LOG_LEVEL=debug` before running `flyctl` commands, and there are no current plans to change it, be aware that this interface is not guaranteed to be stable and can change without notice. If this is a concern, consider using the [`fly ips`](/flyctl/cmd/fly_ips) command instead. - - -The following will create a shared IPv4 address and a dedicated IPv6 address: +The following uses the [Allocate an IP address](/machines/api/apps-resource#allocate-an-ip-address-for-global-request-routing) API to create a shared IPv4 address and a dedicated IPv6 address: ```json curl -i -X POST \ -H "Authorization: Bearer ${FLY_API_TOKEN}" \ -H "Content-Type: application/json" \ - "https://api.fly.io/graphql" \ - -d @- <