---
title: "Wait for State"
method: GET
path: "/apps/{app_name}/machines/{machine_id}/wait"
tags: ["Machines"]
---

# Wait for State

`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](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.

## Path parameters

- `app_name` string, required
- `machine_id` string, required

## Query parameters

- `version` string
- `instance_id` string
- `from_event_id` string
- `timeout` integer
- `state` 'started' | 'stopped' | 'suspended' | 'destroyed' | 'failed' | 'settled'

## Response `200`

OK

- WaitMachineResponse
  - `event_id` string
  - `ok` boolean
  - `state` string
  - `version` string

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.dev/fly/apis/machines-api.md) · [All operations](https://skmtc.dev/fly/apis/machines-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fly/machines-api/revisions/f5ad396d55d7/schema)
