Fly.io
Machines

Wait for State

View as Markdown

Wait for a Machine to reach a specific state. Specify the desired state with the state parameter. See the [Machine states table](https://fly.io/docs/machines/working-with-machines/#machine-states) for a list of possible states. The default for this parameter is `started`. This request will block for up to 60 seconds. Set a shorter timeout with the timeout parameter.

GET
/apps/{app_name}/machines/{machine_id}/wait

Wait for a Machine to reach a specific state. Specify the desired state with the state parameter. See the Machine states table for a list of possible states. The default for this parameter is started.

This request will block for up to 60 seconds. Set a shorter timeout with the timeout parameter.

Authorization

bearerAuth
AuthorizationBearer <token>

A Fly.io access token. Create one with fly tokens create.

In: header

Path Parameters

app_name*string

Fly App Name

machine_id*string

Machine ID

Query Parameters

version?string

26-character Machine version ID

instance_id?string

26-character Machine version ID (deprecated; use version)

from_event_id?string

26-character Machine event ID to start waiting after

timeout?integer

wait timeout. default 60s

state?string

desired state(s), supports repeated or comma-separated values

Response Body

application/json

application/json

curl -X GET "https://example.com/apps/string/machines/string/wait"
{  "event_id": "string",  "ok": true,  "state": "string",  "version": "string"}
{  "details": {},  "error": "string",  "status": "unknown"}