# Wait for State (/machines/Machines_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.


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

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `app_name` | path | `string` | Yes | Fly App Name |
| `machine_id` | path | `string` | Yes | Machine ID |
| `version` | query | `string` | No | 26-character Machine version ID |
| `instance_id` | query | `string` | No | 26-character Machine version ID (deprecated; use version) |
| `from_event_id` | query | `string` | No | 26-character Machine event ID to start waiting after |
| `timeout` | query | `integer` | No | wait timeout. default 60s |
| `state` | query | `string` | No | desired state(s), supports repeated or comma-separated values — Enum: started, stopped, suspended, destroyed, failed, settled |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `200` | OK | `WaitMachineResponse` |
| `400` | Bad Request | `ErrorResponse` |

The full machine-readable OpenAPI spec is available at /openapi.json.