Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Fly.io Machines API

The Fly.io Machines API is a low-level REST interface for provisioning and managing Fly Machines, which are fast-booting virtual machines that run on Fly.io's global edge infrastructure. It provides endpoints for creating, starting, stopping, and destroying Machines, as well as managing Fly Apps, Fly Volumes, and TLS certificates. The API is accessible publicly at https://api.machines.dev or internally within the Fly.io private WireGuard network at http://_api.internal:4280.

Fly.io Machines API is one of 9 APIs that fly-io publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Deployment, Edge Computing, Infrastructure, Platform, and Virtual Machines. The published artifact set on APIs.io includes API documentation and an OpenAPI specification.

This API exposes 14 operations across 9 paths, and defines 12 schemas. It is described by OpenAPI 3.1.0, at version 1.0.

Requests are made against 2 base URLs: https://{provider_base_url}, https://api.fly.io.

14 operations 9 paths 12 schemas 2 DELETE4 GET8 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.1.0
API Version
1.0
Base URL
https://api.machines.dev
Authentication
HTTP Bearer, HTTP Bearer, API Key
Terms of Service
Resource Areas
1

Authentication & Security 3

Fly.io Machines API declares 3 security schemes for authenticating requests. It accepts HTTP bearer tokens (flySharedSecret). It accepts HTTP bearer tokens (oauthBearerAuth). An API key is passed in the header as X-Fly-Signature (webhookHmac). By default, every request must be authenticated.

  • flySharedSecret — Shared secret provided by Fly.io to the extension provider. Fly.io includes this secret in an Authorization Bearer header on all requests to the provider's API…
  • oauthBearerAuth — Fly.io OAuth access token obtained from the token exchange endpoint.
  • webhookHmac — HMAC-SHA256 signature of the raw request body, computed using the webhook signing secret. Recipients must verify this signature before processing the payload.

Paths & Operations 14

Across 9 paths, the API surfaces 14 operations — 2 DELETE, 4 GET, 8 POST. Each is listed below with its method, path, parameters, and response codes.

Machines 14

Core operations for creating, reading, updating, starting, stopping, suspending, and deleting Fly Machines. Machines are fast-booting virtual machines deployed on Fly.io's global…

GET
/v1/apps/{app_name}/machines
List machines in an app
listMachines 1 param → 200401404
POST
/v1/apps/{app_name}/machines
Create a Fly Machine
createMachine 1 param body → 200400401
GET
/v1/apps/{app_name}/machines/{machine_id}
Get a Fly Machine
getMachine 2 params → 200401404
POST
/v1/apps/{app_name}/machines/{machine_id}
Update a Fly Machine
updateMachine 2 params body → 200400401404
DELETE
/v1/apps/{app_name}/machines/{machine_id}
Delete a Fly Machine
deleteMachine 2 params → 200401404
POST
/v1/apps/{app_name}/machines/{machine_id}/start
Start a Fly Machine
startMachine 2 params → 200401404
POST
/v1/apps/{app_name}/machines/{machine_id}/stop
Stop a Fly Machine
stopMachine 2 params body → 200401404
POST
/v1/apps/{app_name}/machines/{machine_id}/suspend
Suspend a Fly Machine
suspendMachine 2 params → 200401404
GET
/v1/apps/{app_name}/machines/{machine_id}/wait
Wait for a Machine to reach a state
waitForMachineState 5 params → 200408401404
POST
/v1/apps/{app_name}/machines/{machine_id}/cordon
Cordon a Fly Machine
cordonMachine 2 params → 200401404
POST
/v1/apps/{app_name}/machines/{machine_id}/uncordon
Uncordon a Fly Machine
uncordonMachine 2 params → 200401404
GET
/v1/apps/{app_name}/machines/{machine_id}/metadata/{key}
Get a Machine metadata value
getMachineMetadata 3 params → 200401404
POST
/v1/apps/{app_name}/machines/{machine_id}/metadata/{key}
Set a Machine metadata value
setMachineMetadata 3 params body → 204401404
DELETE
/v1/apps/{app_name}/machines/{machine_id}/metadata/{key}
Delete a Machine metadata value
deleteMachineMetadata 3 params → 204401404

Schemas 12

The contract defines 12 schemas that model the data the API accepts and returns. The most detailed are MachineConfig (11 properties), Machine (9 properties), MachineCheck (7 properties), MachineService (4 properties). Each schema is shown below with its type and property counts.

MachinePort
object
An external port mapping for a Machine service.
3 properties
MachineInit
object
Startup process configuration for a Fly Machine.
4 properties
MachineServiceConcurrency
object
Concurrency-based load balancing configuration for a service.
3 properties
MachineRestart
object
Restart policy configuration for a Fly Machine.
1 property
ErrorResponse
object
A standard error response returned by the API on failure.
2 properties
MachineService
object
A network service definition for exposing a Machine to external traffic.
4 properties
MachineConfig
object
Configuration for a Fly Machine.
11 properties 1 required
Machine
object
A Fly Machine is a fast-booting virtual machine deployed on Fly.io's global edge infrastructure.
9 properties
CreateMachineRequest
object
Request body for creating or updating a Fly Machine.
4 properties 1 required
MachineMount
object
A volume mount definition for a Fly Machine.
3 properties
MachineGuest
object
Compute resource specification for a Fly Machine.
3 properties
MachineCheck
object
A health check definition for a Fly Machine.
7 properties

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

fly-io-machines-api-openapi.yml Raw ↑

Other APIs fly-io publishes across the network.

Fly.io GraphQL API
Fly.io Extensions API
fly-io Apps API
fly-io OAuth API
fly-io SSO API
fly-io Tokens API
fly-io Volumes API
fly-io Webhooks API