Skip to main content
POST
Execute Command

Authorizations

Authorization
string
header
required

A Fly API token with access to the requested organization or resource. Send it as Authorization: Bearer <Fly API token>.

Path Parameters

app_name
string
required

Fly App Name

machine_id
string
required

Machine ID

Body

application/json

Request body

cmd
string

Command line to run, split into arguments like a shell would. Takes precedence over command.

Deprecated: use command.

command
string[]

Command to run, as the program followed by its arguments. It is run directly, not by a shell.

container
string

Name of the container to run the command in, for Machines with containers.

machine
boolean

Run the command in the Machine's own namespace instead of in a container. Mutually exclusive with container.

stdin
string

Data to write to the command's standard input.

timeout
integer

How long to let the command run, in seconds. Defaults to 10; at most 600.

Response

OK

exit_code
integer

The command's exit code.

exit_signal
integer

The signal that terminated the command, or 0 if it exited normally.

stderr
string

The command's standard error.

stdout
string

The command's standard output.