---
title: "Update Machine"
method: POST
path: "/apps/{app_name}/machines/{machine_id}"
tags: ["Machines"]
---

# Update Machine

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

Update a Machine's configuration using the details provided in the request body.

## Path parameters

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

## Request body

- UpdateMachineRequest
  - `config` FlyMachineConfig
    - `auto_destroy` boolean — Optional boolean telling the Machine to destroy itself once it’s complete (default false)
    - `cache_drive` FlyMachineCacheDrive
      - `size_mb` integer
    - `checks` object — An optional object that defines one or more named top-level checks. The key for each check is the check name.
    - `containers` FlyContainerConfig[] — Containers are a list of containers that will run in the machine. Currently restricted to only specific organizations.
      - `cmd` string[] — CmdOverride is used to override the default command of the image.
      - `depends_on` FlyContainerDependency[] — DependsOn can be used to define dependencies between containers. The container will only be started after all of its dependent conditions have been satisfied.
        - `condition` 'exited_successfully' | 'healthy' | 'started'
        - `name` string
      - `entrypoint` string[] — EntrypointOverride is used to override the default entrypoint of the image.
      - `env` object — ExtraEnv is used to add additional environment variables to the container.
      - `env_from` FlyEnvFrom[] — EnvFrom can be provided to set environment variables from machine fields.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `field_ref` 'id' | 'version' | 'app_name' | 'private_ip' | 'region' | 'image' — FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image.
      - `exec` string[] — Image Config overrides - these fields are used to override the image configuration. If not provided, the image configuration will be used. ExecOverride is used to override the default command of the image.
      - `files` FlyFile[] — Files are files that will be written to the container file system.
        - `guest_path` string — GuestPath is the path on the machine where the file will be written and must be an absolute path. For example: /full/path/to/file.json
        - `image_config` string — The name of an image to use the OCI image config as the file contents.
        - `mode` integer — Mode bits used to set permissions on this file as accepted by chmod(2).
        - `raw_value` string — The base64 encoded string of the file contents.
        - `secret_name` string — The name of the secret that contains the base64 encoded file contents.
      - `healthchecks` FlyContainerHealthcheck[] — Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command.
        - `exec` FlyExecHealthcheck
          - `command` string[] — The command to run to check the health of the container (e.g. ["cat", "/tmp/healthy"])
        - `failure_threshold` integer — The number of times the check must fail before considering the container unhealthy.
        - `grace_period` integer — The time in seconds to wait after a container starts before checking its health.
        - `http` FlyHTTPHealthcheck
          - `headers` FlyMachineHTTPHeader[] — Additional headers to send with the request
            - `name` string — The header name
            - `values` string[] — The header value
          - `method` string — The HTTP method to use to when making the request
          - `path` string — The path to send the request to
          - `port` integer — The port to connect to, often the same as internal_port
          - `scheme` 'http' | 'https'
          - `tls_server_name` string — If the protocol is https, the hostname to use for TLS certificate validation
          - `tls_skip_verify` boolean — If the protocol is https, whether or not to verify the TLS certificate
        - `interval` integer — The time in seconds between executing the defined check.
        - `kind` 'readiness' | 'liveness'
        - `name` string — The name of the check. Must be unique within the container.
        - `success_threshold` integer — The number of times the check must succeeed before considering the container healthy.
        - `tcp` FlyTCPHealthcheck
          - `port` integer — The port to connect to, often the same as internal_port
        - `timeout` integer — The time in seconds to wait for the check to complete.
        - `unhealthy` 'stop'
      - `image` string — Image is the docker image to run.
      - `name` string — Name is used to identify the container in the machine.
      - `restart` FlyMachineRestart — The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.
        - `gpu_bid_price` number — GPU bid price for spot Machines.
        - `max_retries` integer — When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.
        - `policy` 'no' | 'always' | 'on-failure' | 'spot-price' — * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. * spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price.
      - `secrets` FlyMachineSecret[] — Secrets can be provided at the process level to explicitly indicate which secrets should be used for the process. If not provided, the secrets provided at the machine level will be used.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `name` string — Name is optional and when provided is used to reference a secret name where the EnvVar is different from what was set as the secret name.
      - `stop` FlyStopConfig
        - `signal` 'SIGHUP' | 'SIGINT' | 'SIGQUIT' | 'SIGKILL' | 'SIGUSR1' | 'SIGUSR2' | 'SIGTERM'
        - `timeout` string
      - `user` string — UserOverride is used to override the default user of the image.
    - `disable_machine_autostart` boolean — Deprecated: use Service.Autostart instead
    - `dns` FlyDNSConfig
      - `dns_forward_rules` FlyDnsForwardRule[]
        - `addr` string
        - `basename` string
      - `hostname` string
      - `hostname_fqdn` string
      - `nameservers` string[]
      - `options` FlyDnsOption[]
        - `name` string
        - `value` string
      - `searches` string[]
      - `skip_registration` boolean
    - `env` object — An object filled with key/value pairs to be set as environment variables
    - `files` FlyFile[]
      - `guest_path` string — GuestPath is the path on the machine where the file will be written and must be an absolute path. For example: /full/path/to/file.json
      - `image_config` string — The name of an image to use the OCI image config as the file contents.
      - `mode` integer — Mode bits used to set permissions on this file as accepted by chmod(2).
      - `raw_value` string — The base64 encoded string of the file contents.
      - `secret_name` string — The name of the secret that contains the base64 encoded file contents.
    - `guest` FlyMachineGuest
      - `cpu_kind` string
      - `cpus` integer
      - `gpu_kind` string
      - `gpus` integer
      - `host_dedication_id` string
      - `kernel_args` string[]
      - `max_memory_mb` integer
      - `memory_mb` integer
      - `persist_rootfs` 'never' | 'always' | 'restart' — Deprecated: use MachineConfig.Rootfs instead
    - `image` string — The docker image to run
    - `init` FlyMachineInit
      - `cmd` string[]
      - `entrypoint` string[]
      - `exec` string[]
      - `kernel_args` string[]
      - `swap_size_mb` integer
      - `tty` boolean
    - `metadata` object
    - `metrics` FlyMachineMetrics
      - `https` boolean
      - `path` string
      - `port` integer
    - `mounts` FlyMachineMount[]
      - `add_size_gb` integer
      - `encrypted` boolean
      - `extend_threshold_percent` integer
      - `name` string
      - `path` string
      - `size_gb` integer
      - `size_gb_limit` integer
      - `volume` string
    - `processes` FlyMachineProcess[]
      - `cmd` string[]
      - `entrypoint` string[]
      - `env` object
      - `env_from` FlyEnvFrom[] — EnvFrom can be provided to set environment variables from machine fields.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `field_ref` 'id' | 'version' | 'app_name' | 'private_ip' | 'region' | 'image' — FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image.
      - `exec` string[]
      - `ignore_app_secrets` boolean — IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to and only use the secrets provided at the process level. The default/legacy behavior is to use the secrets provided at the App level.
      - `secrets` FlyMachineSecret[] — Secrets can be provided at the process level to explicitly indicate which secrets should be used for the process. If not provided, the secrets provided at the machine level will be used.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `name` string — Name is optional and when provided is used to reference a secret name where the EnvVar is different from what was set as the secret name.
      - `user` string
    - `restart` FlyMachineRestart — The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.
      - `gpu_bid_price` number — GPU bid price for spot Machines.
      - `max_retries` integer — When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.
      - `policy` 'no' | 'always' | 'on-failure' | 'spot-price' — * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. * spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price.
    - `rootfs` FlyMachineRootfs
      - `persist` 'never' | 'always' | 'restart'
      - `size_gb` integer
    - `schedule` string
    - `services` FlyMachineService[]
      - `autostart` boolean
      - `autostop` 'off' | 'stop' | 'suspend' — Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. * "off" or false - Do not autostop the Machine. * "stop" or true - Automatically stop the Machine. * "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible.
      - `checks` FlyMachineServiceCheck[] — An optional list of service checks
        - `grace_period` string — The time to wait after a VM starts before checking its health
        - `headers` FlyMachineHTTPHeader[]
          - `name` string — The header name
          - `values` string[] — The header value
        - `interval` string — The time between connectivity checks
        - `method` string — For http checks, the HTTP method to use to when making the request
        - `path` string — For http checks, the path to send the request to
        - `port` integer — The port to connect to, often the same as internal_port
        - `protocol` string — For http checks, whether to use http or https
        - `timeout` string — The maximum time a connection can take before being reported as failing its health check
        - `tls_server_name` string — If the protocol is https, the hostname to use for TLS certificate validation
        - `tls_skip_verify` boolean — For http checks with https protocol, whether or not to verify the TLS certificate
        - `type` string — tcp or http
      - `concurrency` FlyMachineServiceConcurrency
        - `hard_limit` integer
        - `soft_limit` integer
        - `type` string
      - `force_instance_description` string
      - `force_instance_key` string
      - `internal_port` integer
      - `min_machines_running` integer
      - `ports` FlyMachinePort[]
        - `end_port` integer
        - `force_https` boolean
        - `handlers` string[]
        - `http_options` FlyHTTPOptions
          - `compress` boolean
          - `h2_backend` boolean
          - `headers_read_timeout` integer
          - `idle_timeout` integer
          - `replay_cache` FlyReplayCache[]
            - `allow_bypass` boolean
            - `name` string — Name of the cookie or header to key the cache on
            - `path_prefix` string
            - `ttl_seconds` integer
            - `type` 'cookie' | 'header' — Currently either "cookie" or "header"
          - `response` FlyHTTPResponseOptions
            - `headers` object
            - `pristine` boolean
        - `port` integer
        - `proxy_proto_options` FlyProxyProtoOptions
          - `version` string
        - `start_port` integer
        - `tls_options` FlyTLSOptions
          - `alpn` string[]
          - `default_self_signed` boolean
          - `versions` string[]
      - `protocol` string
    - `size` string — Deprecated: use Guest instead
    - `spot` FlyMachineSpot
      - `max_price_fraction` number — MaxPriceFraction is the maximum fraction of the full Machine price you will pay for this Machine. Range: (0, 1.0]
    - `standbys` string[] — Standbys enable a machine to be a standby for another. In the event of a hardware failure, the standby machine will be started.
    - `statics` FlyStatic[]
      - `guest_path` string, required
      - `index_document` string
      - `tigris_bucket` string
      - `url_prefix` string, required
    - `stop_config` FlyStopConfig
      - `signal` 'SIGHUP' | 'SIGINT' | 'SIGQUIT' | 'SIGKILL' | 'SIGUSR1' | 'SIGUSR2' | 'SIGTERM'
      - `timeout` string
  - `current_version` string
  - `lease_ttl` integer
  - `min_secrets_version` integer
  - `name` string — Unique name for this Machine. If omitted, one is generated for you
  - `region` string — The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).
  - `skip_launch` boolean
  - `skip_secrets` boolean
  - `skip_service_registration` boolean

## Response `200`

OK

- Machine
  - `checks` CheckStatus[]
    - `name` string
    - `output` string
    - `status` string
    - `updated_at` string
  - `config` FlyMachineConfig
    - `auto_destroy` boolean — Optional boolean telling the Machine to destroy itself once it’s complete (default false)
    - `cache_drive` FlyMachineCacheDrive
      - `size_mb` integer
    - `checks` object — An optional object that defines one or more named top-level checks. The key for each check is the check name.
    - `containers` FlyContainerConfig[] — Containers are a list of containers that will run in the machine. Currently restricted to only specific organizations.
      - `cmd` string[] — CmdOverride is used to override the default command of the image.
      - `depends_on` FlyContainerDependency[] — DependsOn can be used to define dependencies between containers. The container will only be started after all of its dependent conditions have been satisfied.
        - `condition` 'exited_successfully' | 'healthy' | 'started'
        - `name` string
      - `entrypoint` string[] — EntrypointOverride is used to override the default entrypoint of the image.
      - `env` object — ExtraEnv is used to add additional environment variables to the container.
      - `env_from` FlyEnvFrom[] — EnvFrom can be provided to set environment variables from machine fields.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `field_ref` 'id' | 'version' | 'app_name' | 'private_ip' | 'region' | 'image' — FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image.
      - `exec` string[] — Image Config overrides - these fields are used to override the image configuration. If not provided, the image configuration will be used. ExecOverride is used to override the default command of the image.
      - `files` FlyFile[] — Files are files that will be written to the container file system.
        - `guest_path` string — GuestPath is the path on the machine where the file will be written and must be an absolute path. For example: /full/path/to/file.json
        - `image_config` string — The name of an image to use the OCI image config as the file contents.
        - `mode` integer — Mode bits used to set permissions on this file as accepted by chmod(2).
        - `raw_value` string — The base64 encoded string of the file contents.
        - `secret_name` string — The name of the secret that contains the base64 encoded file contents.
      - `healthchecks` FlyContainerHealthcheck[] — Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command.
        - `exec` FlyExecHealthcheck
          - `command` string[] — The command to run to check the health of the container (e.g. ["cat", "/tmp/healthy"])
        - `failure_threshold` integer — The number of times the check must fail before considering the container unhealthy.
        - `grace_period` integer — The time in seconds to wait after a container starts before checking its health.
        - `http` FlyHTTPHealthcheck
          - `headers` FlyMachineHTTPHeader[] — Additional headers to send with the request
            - `name` string — The header name
            - `values` string[] — The header value
          - `method` string — The HTTP method to use to when making the request
          - `path` string — The path to send the request to
          - `port` integer — The port to connect to, often the same as internal_port
          - `scheme` 'http' | 'https'
          - `tls_server_name` string — If the protocol is https, the hostname to use for TLS certificate validation
          - `tls_skip_verify` boolean — If the protocol is https, whether or not to verify the TLS certificate
        - `interval` integer — The time in seconds between executing the defined check.
        - `kind` 'readiness' | 'liveness'
        - `name` string — The name of the check. Must be unique within the container.
        - `success_threshold` integer — The number of times the check must succeeed before considering the container healthy.
        - `tcp` FlyTCPHealthcheck
          - `port` integer — The port to connect to, often the same as internal_port
        - `timeout` integer — The time in seconds to wait for the check to complete.
        - `unhealthy` 'stop'
      - `image` string — Image is the docker image to run.
      - `name` string — Name is used to identify the container in the machine.
      - `restart` FlyMachineRestart — The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.
        - `gpu_bid_price` number — GPU bid price for spot Machines.
        - `max_retries` integer — When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.
        - `policy` 'no' | 'always' | 'on-failure' | 'spot-price' — * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. * spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price.
      - `secrets` FlyMachineSecret[] — Secrets can be provided at the process level to explicitly indicate which secrets should be used for the process. If not provided, the secrets provided at the machine level will be used.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `name` string — Name is optional and when provided is used to reference a secret name where the EnvVar is different from what was set as the secret name.
      - `stop` FlyStopConfig
        - `signal` 'SIGHUP' | 'SIGINT' | 'SIGQUIT' | 'SIGKILL' | 'SIGUSR1' | 'SIGUSR2' | 'SIGTERM'
        - `timeout` string
      - `user` string — UserOverride is used to override the default user of the image.
    - `disable_machine_autostart` boolean — Deprecated: use Service.Autostart instead
    - `dns` FlyDNSConfig
      - `dns_forward_rules` FlyDnsForwardRule[]
        - `addr` string
        - `basename` string
      - `hostname` string
      - `hostname_fqdn` string
      - `nameservers` string[]
      - `options` FlyDnsOption[]
        - `name` string
        - `value` string
      - `searches` string[]
      - `skip_registration` boolean
    - `env` object — An object filled with key/value pairs to be set as environment variables
    - `files` FlyFile[]
      - `guest_path` string — GuestPath is the path on the machine where the file will be written and must be an absolute path. For example: /full/path/to/file.json
      - `image_config` string — The name of an image to use the OCI image config as the file contents.
      - `mode` integer — Mode bits used to set permissions on this file as accepted by chmod(2).
      - `raw_value` string — The base64 encoded string of the file contents.
      - `secret_name` string — The name of the secret that contains the base64 encoded file contents.
    - `guest` FlyMachineGuest
      - `cpu_kind` string
      - `cpus` integer
      - `gpu_kind` string
      - `gpus` integer
      - `host_dedication_id` string
      - `kernel_args` string[]
      - `max_memory_mb` integer
      - `memory_mb` integer
      - `persist_rootfs` 'never' | 'always' | 'restart' — Deprecated: use MachineConfig.Rootfs instead
    - `image` string — The docker image to run
    - `init` FlyMachineInit
      - `cmd` string[]
      - `entrypoint` string[]
      - `exec` string[]
      - `kernel_args` string[]
      - `swap_size_mb` integer
      - `tty` boolean
    - `metadata` object
    - `metrics` FlyMachineMetrics
      - `https` boolean
      - `path` string
      - `port` integer
    - `mounts` FlyMachineMount[]
      - `add_size_gb` integer
      - `encrypted` boolean
      - `extend_threshold_percent` integer
      - `name` string
      - `path` string
      - `size_gb` integer
      - `size_gb_limit` integer
      - `volume` string
    - `processes` FlyMachineProcess[]
      - `cmd` string[]
      - `entrypoint` string[]
      - `env` object
      - `env_from` FlyEnvFrom[] — EnvFrom can be provided to set environment variables from machine fields.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `field_ref` 'id' | 'version' | 'app_name' | 'private_ip' | 'region' | 'image' — FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image.
      - `exec` string[]
      - `ignore_app_secrets` boolean — IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to and only use the secrets provided at the process level. The default/legacy behavior is to use the secrets provided at the App level.
      - `secrets` FlyMachineSecret[] — Secrets can be provided at the process level to explicitly indicate which secrets should be used for the process. If not provided, the secrets provided at the machine level will be used.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `name` string — Name is optional and when provided is used to reference a secret name where the EnvVar is different from what was set as the secret name.
      - `user` string
    - `restart` FlyMachineRestart — The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.
      - `gpu_bid_price` number — GPU bid price for spot Machines.
      - `max_retries` integer — When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.
      - `policy` 'no' | 'always' | 'on-failure' | 'spot-price' — * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. * spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price.
    - `rootfs` FlyMachineRootfs
      - `persist` 'never' | 'always' | 'restart'
      - `size_gb` integer
    - `schedule` string
    - `services` FlyMachineService[]
      - `autostart` boolean
      - `autostop` 'off' | 'stop' | 'suspend' — Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. * "off" or false - Do not autostop the Machine. * "stop" or true - Automatically stop the Machine. * "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible.
      - `checks` FlyMachineServiceCheck[] — An optional list of service checks
        - `grace_period` string — The time to wait after a VM starts before checking its health
        - `headers` FlyMachineHTTPHeader[]
          - `name` string — The header name
          - `values` string[] — The header value
        - `interval` string — The time between connectivity checks
        - `method` string — For http checks, the HTTP method to use to when making the request
        - `path` string — For http checks, the path to send the request to
        - `port` integer — The port to connect to, often the same as internal_port
        - `protocol` string — For http checks, whether to use http or https
        - `timeout` string — The maximum time a connection can take before being reported as failing its health check
        - `tls_server_name` string — If the protocol is https, the hostname to use for TLS certificate validation
        - `tls_skip_verify` boolean — For http checks with https protocol, whether or not to verify the TLS certificate
        - `type` string — tcp or http
      - `concurrency` FlyMachineServiceConcurrency
        - `hard_limit` integer
        - `soft_limit` integer
        - `type` string
      - `force_instance_description` string
      - `force_instance_key` string
      - `internal_port` integer
      - `min_machines_running` integer
      - `ports` FlyMachinePort[]
        - `end_port` integer
        - `force_https` boolean
        - `handlers` string[]
        - `http_options` FlyHTTPOptions
          - `compress` boolean
          - `h2_backend` boolean
          - `headers_read_timeout` integer
          - `idle_timeout` integer
          - `replay_cache` FlyReplayCache[]
            - `allow_bypass` boolean
            - `name` string — Name of the cookie or header to key the cache on
            - `path_prefix` string
            - `ttl_seconds` integer
            - `type` 'cookie' | 'header' — Currently either "cookie" or "header"
          - `response` FlyHTTPResponseOptions
            - `headers` object
            - `pristine` boolean
        - `port` integer
        - `proxy_proto_options` FlyProxyProtoOptions
          - `version` string
        - `start_port` integer
        - `tls_options` FlyTLSOptions
          - `alpn` string[]
          - `default_self_signed` boolean
          - `versions` string[]
      - `protocol` string
    - `size` string — Deprecated: use Guest instead
    - `spot` FlyMachineSpot
      - `max_price_fraction` number — MaxPriceFraction is the maximum fraction of the full Machine price you will pay for this Machine. Range: (0, 1.0]
    - `standbys` string[] — Standbys enable a machine to be a standby for another. In the event of a hardware failure, the standby machine will be started.
    - `statics` FlyStatic[]
      - `guest_path` string, required
      - `index_document` string
      - `tigris_bucket` string
      - `url_prefix` string, required
    - `stop_config` FlyStopConfig
      - `signal` 'SIGHUP' | 'SIGINT' | 'SIGQUIT' | 'SIGKILL' | 'SIGUSR1' | 'SIGUSR2' | 'SIGTERM'
      - `timeout` string
  - `cordoned` boolean
  - `created_at` string
  - `events` MachineEvent[]
    - `id` string
    - `request` object
    - `source` string
    - `status` string
    - `timestamp` integer
    - `type` string
  - `host_status` 'ok' | 'unknown' | 'unreachable'
  - `id` string
  - `image_ref` ImageRef
    - `digest` string
    - `labels` object
    - `registry` string
    - `repository` string
    - `tag` string
  - `incomplete_config` FlyMachineConfig
    - `auto_destroy` boolean — Optional boolean telling the Machine to destroy itself once it’s complete (default false)
    - `cache_drive` FlyMachineCacheDrive
      - `size_mb` integer
    - `checks` object — An optional object that defines one or more named top-level checks. The key for each check is the check name.
    - `containers` FlyContainerConfig[] — Containers are a list of containers that will run in the machine. Currently restricted to only specific organizations.
      - `cmd` string[] — CmdOverride is used to override the default command of the image.
      - `depends_on` FlyContainerDependency[] — DependsOn can be used to define dependencies between containers. The container will only be started after all of its dependent conditions have been satisfied.
        - `condition` 'exited_successfully' | 'healthy' | 'started'
        - `name` string
      - `entrypoint` string[] — EntrypointOverride is used to override the default entrypoint of the image.
      - `env` object — ExtraEnv is used to add additional environment variables to the container.
      - `env_from` FlyEnvFrom[] — EnvFrom can be provided to set environment variables from machine fields.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `field_ref` 'id' | 'version' | 'app_name' | 'private_ip' | 'region' | 'image' — FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image.
      - `exec` string[] — Image Config overrides - these fields are used to override the image configuration. If not provided, the image configuration will be used. ExecOverride is used to override the default command of the image.
      - `files` FlyFile[] — Files are files that will be written to the container file system.
        - `guest_path` string — GuestPath is the path on the machine where the file will be written and must be an absolute path. For example: /full/path/to/file.json
        - `image_config` string — The name of an image to use the OCI image config as the file contents.
        - `mode` integer — Mode bits used to set permissions on this file as accepted by chmod(2).
        - `raw_value` string — The base64 encoded string of the file contents.
        - `secret_name` string — The name of the secret that contains the base64 encoded file contents.
      - `healthchecks` FlyContainerHealthcheck[] — Healthchecks determine the health of your containers. Healthchecks can use HTTP, TCP or an Exec command.
        - `exec` FlyExecHealthcheck
          - `command` string[] — The command to run to check the health of the container (e.g. ["cat", "/tmp/healthy"])
        - `failure_threshold` integer — The number of times the check must fail before considering the container unhealthy.
        - `grace_period` integer — The time in seconds to wait after a container starts before checking its health.
        - `http` FlyHTTPHealthcheck
          - `headers` FlyMachineHTTPHeader[] — Additional headers to send with the request
            - `name` string — The header name
            - `values` string[] — The header value
          - `method` string — The HTTP method to use to when making the request
          - `path` string — The path to send the request to
          - `port` integer — The port to connect to, often the same as internal_port
          - `scheme` 'http' | 'https'
          - `tls_server_name` string — If the protocol is https, the hostname to use for TLS certificate validation
          - `tls_skip_verify` boolean — If the protocol is https, whether or not to verify the TLS certificate
        - `interval` integer — The time in seconds between executing the defined check.
        - `kind` 'readiness' | 'liveness'
        - `name` string — The name of the check. Must be unique within the container.
        - `success_threshold` integer — The number of times the check must succeeed before considering the container healthy.
        - `tcp` FlyTCPHealthcheck
          - `port` integer — The port to connect to, often the same as internal_port
        - `timeout` integer — The time in seconds to wait for the check to complete.
        - `unhealthy` 'stop'
      - `image` string — Image is the docker image to run.
      - `name` string — Name is used to identify the container in the machine.
      - `restart` FlyMachineRestart — The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.
        - `gpu_bid_price` number — GPU bid price for spot Machines.
        - `max_retries` integer — When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.
        - `policy` 'no' | 'always' | 'on-failure' | 'spot-price' — * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. * spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price.
      - `secrets` FlyMachineSecret[] — Secrets can be provided at the process level to explicitly indicate which secrets should be used for the process. If not provided, the secrets provided at the machine level will be used.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `name` string — Name is optional and when provided is used to reference a secret name where the EnvVar is different from what was set as the secret name.
      - `stop` FlyStopConfig
        - `signal` 'SIGHUP' | 'SIGINT' | 'SIGQUIT' | 'SIGKILL' | 'SIGUSR1' | 'SIGUSR2' | 'SIGTERM'
        - `timeout` string
      - `user` string — UserOverride is used to override the default user of the image.
    - `disable_machine_autostart` boolean — Deprecated: use Service.Autostart instead
    - `dns` FlyDNSConfig
      - `dns_forward_rules` FlyDnsForwardRule[]
        - `addr` string
        - `basename` string
      - `hostname` string
      - `hostname_fqdn` string
      - `nameservers` string[]
      - `options` FlyDnsOption[]
        - `name` string
        - `value` string
      - `searches` string[]
      - `skip_registration` boolean
    - `env` object — An object filled with key/value pairs to be set as environment variables
    - `files` FlyFile[]
      - `guest_path` string — GuestPath is the path on the machine where the file will be written and must be an absolute path. For example: /full/path/to/file.json
      - `image_config` string — The name of an image to use the OCI image config as the file contents.
      - `mode` integer — Mode bits used to set permissions on this file as accepted by chmod(2).
      - `raw_value` string — The base64 encoded string of the file contents.
      - `secret_name` string — The name of the secret that contains the base64 encoded file contents.
    - `guest` FlyMachineGuest
      - `cpu_kind` string
      - `cpus` integer
      - `gpu_kind` string
      - `gpus` integer
      - `host_dedication_id` string
      - `kernel_args` string[]
      - `max_memory_mb` integer
      - `memory_mb` integer
      - `persist_rootfs` 'never' | 'always' | 'restart' — Deprecated: use MachineConfig.Rootfs instead
    - `image` string — The docker image to run
    - `init` FlyMachineInit
      - `cmd` string[]
      - `entrypoint` string[]
      - `exec` string[]
      - `kernel_args` string[]
      - `swap_size_mb` integer
      - `tty` boolean
    - `metadata` object
    - `metrics` FlyMachineMetrics
      - `https` boolean
      - `path` string
      - `port` integer
    - `mounts` FlyMachineMount[]
      - `add_size_gb` integer
      - `encrypted` boolean
      - `extend_threshold_percent` integer
      - `name` string
      - `path` string
      - `size_gb` integer
      - `size_gb_limit` integer
      - `volume` string
    - `processes` FlyMachineProcess[]
      - `cmd` string[]
      - `entrypoint` string[]
      - `env` object
      - `env_from` FlyEnvFrom[] — EnvFrom can be provided to set environment variables from machine fields.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `field_ref` 'id' | 'version' | 'app_name' | 'private_ip' | 'region' | 'image' — FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image.
      - `exec` string[]
      - `ignore_app_secrets` boolean — IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to and only use the secrets provided at the process level. The default/legacy behavior is to use the secrets provided at the App level.
      - `secrets` FlyMachineSecret[] — Secrets can be provided at the process level to explicitly indicate which secrets should be used for the process. If not provided, the secrets provided at the machine level will be used.
        - `env_var` string — EnvVar is required and is the name of the environment variable that will be set from the secret. It must be a valid environment variable name.
        - `name` string — Name is optional and when provided is used to reference a secret name where the EnvVar is different from what was set as the secret name.
      - `user` string
    - `restart` FlyMachineRestart — The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.
      - `gpu_bid_price` number — GPU bid price for spot Machines.
      - `max_retries` integer — When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.
      - `policy` 'no' | 'always' | 'on-failure' | 'spot-price' — * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. * spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price.
    - `rootfs` FlyMachineRootfs
      - `persist` 'never' | 'always' | 'restart'
      - `size_gb` integer
    - `schedule` string
    - `services` FlyMachineService[]
      - `autostart` boolean
      - `autostop` 'off' | 'stop' | 'suspend' — Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses. * "off" or false - Do not autostop the Machine. * "stop" or true - Automatically stop the Machine. * "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible.
      - `checks` FlyMachineServiceCheck[] — An optional list of service checks
        - `grace_period` string — The time to wait after a VM starts before checking its health
        - `headers` FlyMachineHTTPHeader[]
          - `name` string — The header name
          - `values` string[] — The header value
        - `interval` string — The time between connectivity checks
        - `method` string — For http checks, the HTTP method to use to when making the request
        - `path` string — For http checks, the path to send the request to
        - `port` integer — The port to connect to, often the same as internal_port
        - `protocol` string — For http checks, whether to use http or https
        - `timeout` string — The maximum time a connection can take before being reported as failing its health check
        - `tls_server_name` string — If the protocol is https, the hostname to use for TLS certificate validation
        - `tls_skip_verify` boolean — For http checks with https protocol, whether or not to verify the TLS certificate
        - `type` string — tcp or http
      - `concurrency` FlyMachineServiceConcurrency
        - `hard_limit` integer
        - `soft_limit` integer
        - `type` string
      - `force_instance_description` string
      - `force_instance_key` string
      - `internal_port` integer
      - `min_machines_running` integer
      - `ports` FlyMachinePort[]
        - `end_port` integer
        - `force_https` boolean
        - `handlers` string[]
        - `http_options` FlyHTTPOptions
          - `compress` boolean
          - `h2_backend` boolean
          - `headers_read_timeout` integer
          - `idle_timeout` integer
          - `replay_cache` FlyReplayCache[]
            - `allow_bypass` boolean
            - `name` string — Name of the cookie or header to key the cache on
            - `path_prefix` string
            - `ttl_seconds` integer
            - `type` 'cookie' | 'header' — Currently either "cookie" or "header"
          - `response` FlyHTTPResponseOptions
            - `headers` object
            - `pristine` boolean
        - `port` integer
        - `proxy_proto_options` FlyProxyProtoOptions
          - `version` string
        - `start_port` integer
        - `tls_options` FlyTLSOptions
          - `alpn` string[]
          - `default_self_signed` boolean
          - `versions` string[]
      - `protocol` string
    - `size` string — Deprecated: use Guest instead
    - `spot` FlyMachineSpot
      - `max_price_fraction` number — MaxPriceFraction is the maximum fraction of the full Machine price you will pay for this Machine. Range: (0, 1.0]
    - `standbys` string[] — Standbys enable a machine to be a standby for another. In the event of a hardware failure, the standby machine will be started.
    - `statics` FlyStatic[]
      - `guest_path` string, required
      - `index_document` string
      - `tigris_bucket` string
      - `url_prefix` string, required
    - `stop_config` FlyStopConfig
      - `signal` 'SIGHUP' | 'SIGINT' | 'SIGQUIT' | 'SIGKILL' | 'SIGUSR1' | 'SIGUSR2' | 'SIGTERM'
      - `timeout` string
  - `instance_id` string — InstanceID is unique for each version of the machine
  - `lease` StrippedLease
    - `description` string
    - `expires_at` integer
    - `owner` string
  - `name` string
  - `nonce` string — Nonce is only every returned on machine creation if a lease_duration was provided.
  - `private_ip` string — PrivateIP is the internal 6PN address of the machine.
  - `region` string
  - `state` string
  - `updated_at` string

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/machines/apis/machines-api.md) · [All operations](https://skmtc.net/machines/apis/machines-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/machines/machines-api/versions/633ddedda749/schema)
