# Execute Command (/machines/Machines_exec)

Execute a command on a specific Machine and return the raw command output bytes.


`POST /apps/{app_name}/machines/{machine_id}/exec`

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `app_name` | path | `string` | Yes | Fly App Name |
| `machine_id` | path | `string` | Yes | Machine ID |

## Request Body

Type: `MachineExecRequest`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `cmd` | `string` | No | Deprecated: use Command instead |
| `command` | `string[]` | No |  |
| `container` | `string` | No |  |
| `stdin` | `string` | No |  |
| `timeout` | `integer` | No |  |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `200` | stdout, stderr, exit code, and exit signal are returned | `flydv1.ExecResponse` |
| `400` | Bad Request | `ErrorResponse` |

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