> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fly.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Machine

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




## OpenAPI

````yaml /api/machines/openapi.json post /v1/apps/{app_name}/machines/{machine_id}
openapi: 3.1.0
info:
  title: Machines API
  description: >-
    This site hosts documentation generated from the Fly.io Machines API OpenAPI
    specification. Visit our complete [Machines API
    docs](https://fly.io/docs/machines/api/) for how to get started, more
    information about each endpoint, parameter descriptions, and examples.
  contact: {}
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://api.machines.dev
security:
  - FlyBearerAuth: []
tags:
  - name: Apps
    description: >-
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/apps-resource/) for details about
      using the Apps resource.
  - name: Machines
    description: >-
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/machines-resource/) for details
      about using the Machines resource.
  - name: TLS Certificates
    description: >
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/certificates-resource/) for details
      about using the TLS Certificates resource.
  - name: Volumes
    description: >-
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/volumes-resource/) for details
      about using the Volumes resource.
  - name: Postgres Clusters
    description: >-
      Create and manage Postgres clusters, including databases, users,
      extensions, backups, and app attachments.
externalDocs:
  url: https://fly.io/docs/machines/working-with-machines/
paths:
  /v1/apps/{app_name}/machines/{machine_id}:
    post:
      tags:
        - Machines
      summary: Update Machine
      description: >
        Update a Machine's configuration using the details provided in the
        request body.
      operationId: Machines_update
      parameters:
        - name: app_name
          in: path
          description: Fly App Name
          required: true
          schema:
            type: string
        - name: machine_id
          in: path
          description: Machine ID
          required: true
          schema:
            type: string
      requestBody:
        description: Request body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMachineRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    UpdateMachineRequest:
      type: object
      properties:
        config:
          type: object
          description: The new Machine configuration. It replaces the current one entirely.
          allOf:
            - $ref: '#/components/schemas/fly.MachineConfig'
        current_version:
          type: string
          description: >-
            Optional optimistic-concurrency guard: the Machine's `version`, as
            returned by create,

            get or a previous update. When set and it is no longer the Machine's
            current version,

            the update is rejected with 409 Conflict and nothing changes. Omit
            it to update

            unconditionally.
        lease_ttl:
          type: integer
          description: Ignored. Use the lease endpoints to lease an existing Machine.
        min_secrets_version:
          type: integer
          description: >-
            The minimum version of the app's secrets the Machine must run with.
            Set it to the `version`

            returned by the endpoints that set or delete app secrets, so that
            the Machine is guaranteed

            to see those changes. This field belongs at the top level of the
            request body, not in

            `config`. If omitted, the app's current secrets version is looked up
            for you.
        name:
          type: string
          description: Ignored.
        region:
          type: string
          description: >-
            Not used to place the Machine: an update never moves it to another
            region or host.
        skip_launch:
          type: boolean
          description: >-
            Apply the update without starting the Machine. It ends up `stopped`;
            start it with the

            Start Machine endpoint. Not allowed for spot Machines.
        skip_secrets:
          type: boolean
          description: >-
            Don't look up the app's current secrets version. The Machine still
            gets the app's

            secrets, but may not see recent changes to them. Takes precedence
            over

            `min_secrets_version`.
        skip_service_registration:
          type: boolean
          description: Ignored. Use the cordon and uncordon endpoints instead.
    Machine:
      type: object
      properties:
        checks:
          type: array
          description: >-
            Status of each health check: the Machine's top-level `checks` and
            its services'

            checks.
          items:
            $ref: '#/components/schemas/CheckStatus'
        config:
          type: object
          description: >-
            The Machine's configuration, as provided when it was created or last
            updated, with

            `metadata` and `mounts` reflecting their current values. Null when
            the host is not

            reachable (`host_status` is not `ok`) or `summary=true` was
            requested; see

            `incomplete_config`.
          allOf:
            - $ref: '#/components/schemas/fly.MachineConfig'
        cordoned:
          type: boolean
          description: >-
            Whether the Machine is cordoned, meaning Fly Proxy does not route
            requests to it. See

            the Cordon Machine endpoint.
        created_at:
          type: string
          description: When the Machine was created.
        events:
          type: array
          description: >-
            Up to 5 of the most recent events of the current Machine version,
            newest first. Use

            the List Events endpoint for more.
          items:
            $ref: '#/components/schemas/MachineEvent'
        host_features:
          type: array
          description: >-
            Features of the Machine's host, for comparison with
            `config.guest.required_host_features`.

            Only returned when the request sets the `fly-include-host-features:
            true` header.
          items:
            type: string
        host_status:
          type: string
          description: >-
            Whether Fly.io could reach the Machine's host: `ok` if it could,
            `unreachable` if it

            could not, in which case the response is built from last known
            state. `unknown` if the

            host's status was not reported.
          enum:
            - ok
            - unknown
            - unreachable
        id:
          type: string
          description: Unique ID of the Machine.
        image_ref:
          type: object
          description: >-
            The image the Machine runs, as resolved when it was last created or
            updated.
          allOf:
            - $ref: '#/components/schemas/ImageRef'
        incomplete_config:
          type: object
          description: >-
            Last known configuration, returned in place of `config` when the
            host could not be

            reached (`host_status` is not `ok`) or when listing Machines with
            `summary=true`. It

            comes from Fly.io's replicated state rather than the host, so it may
            be stale or lack

            fields.
          allOf:
            - $ref: '#/components/schemas/fly.MachineConfig'
        instance_id:
          type: string
          description: |-
            Same value as `version`.

            Deprecated: use `version`.
        lease:
          type: object
          description: >-
            The lease currently held on the Machine. Only returned when
            `include_leases=true`

            was requested and a lease is held.
          allOf:
            - $ref: '#/components/schemas/StrippedLease'
        name:
          type: string
          description: >-
            Name of the Machine. Generated when not provided at creation. Names
            are not required

            to be unique.
        nonce:
          type: string
          description: >-
            Nonce of the lease acquired on the Machine at creation. Only
            returned when creating a

            Machine with `lease_ttl` set. Pass it in the
            `fly-machine-lease-nonce` header to act on

            the Machine while the lease is held.
        private_ip:
          type: string
          description: >-
            The Machine's address on the organization's private (6PN) IPv6
            network.
        region:
          type: string
          description: Code of the region the Machine runs in, such as `iad`.
        state:
          type: string
          description: >-
            Current state of the Machine, taken from the status of its most
            recent event. One of

            `created`, `starting`, `started`, `stopping`, `stopped`,
            `suspending`, `suspended`,

            `replacing`, `replaced`, `destroying`, `destroyed`, `failed`,
            `migrating`, `migrated`,

            `archived`, or `pending`. See
            https://fly.io/docs/machines/machine-states/.
        updated_at:
          type: string
          description: >-
            Time of the Machine's most recent event, truncated to whole seconds.
            The zero time

            (0001-01-01T00:00:00Z) if the host could not be reached. With
            `summary=true`, the time

            Fly.io last recorded a change to the Machine.
        version:
          type: string
          description: >-
            Unique ID of this version of the Machine. Every update creates a new
            version. Pass it

            as `current_version` when updating the Machine to reject the update
            if the Machine has

            changed since this version.
    ErrorResponse:
      type: object
      properties:
        details:
          type: object
          description: 'Deprecated: details about some errors. Do not rely on its contents.'
        error:
          type: string
          description: >-
            Human-readable description of the error. Its wording may change; use
            `status` to tell

            errors apart.
        status:
          type: object
          description: >-
            Machine-readable error code, set for some errors, such as
            `insufficient_capacity`,

            `volume_placement_capacity`, `name_taken`, `exec_request_too_large`,
            or

            `exec_output_too_large`.
          allOf:
            - $ref: '#/components/schemas/main.statusCode'
    fly.MachineConfig:
      type: object
      properties:
        auto_destroy:
          type: boolean
          description: >-
            Optional boolean telling the Machine to destroy itself once it’s
            complete (default false)
        cache_drive:
          type: object
          description: >-
            Beta: a cache drive attached to the Machine. This field may be
            removed in the future
          allOf:
            - $ref: '#/components/schemas/fly.MachineCacheDrive'
        checks:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/fly.MachineCheck'
          description: >-
            An optional object that defines one or more named top-level checks.
            The key for each check is the check name.
        containers:
          type: array
          description: >-
            Containers are a list of containers that will run in the machine,
            each from its own image.
          items:
            $ref: '#/components/schemas/fly.ContainerConfig'
        disable_machine_autostart:
          type: boolean
          description: 'Deprecated: use Service.Autostart instead'
        dns:
          type: object
          description: DNS settings for the Machine
          allOf:
            - $ref: '#/components/schemas/fly.DNSConfig'
        env:
          type: object
          additionalProperties:
            type: string
          description: >-
            An object filled with key/value pairs to be set as environment
            variables
        files:
          type: array
          description: >-
            Files to write into the Machine, from either a raw value or an app
            secret
          items:
            $ref: '#/components/schemas/fly.File'
        guest:
          type: object
          description: The resources (CPUs, memory, etc.) allocated to the Machine
          allOf:
            - $ref: '#/components/schemas/fly.MachineGuest'
        image:
          type: string
          description: The docker image to run
        init:
          type: object
          description: >-
            Arguments for init, Fly.io's footprint inside the Machine, which
            controls how your own code is run
          allOf:
            - $ref: '#/components/schemas/fly.MachineInit'
        metadata:
          type: object
          additionalProperties:
            type: string
          description: >-
            Key/value pairs of Machine metadata. Fly.io uses metadata internally
            for routing, process groups, and clusters
        metrics:
          type: object
          description: An optional metrics endpoint for Prometheus on Fly.io to scrape
          allOf:
            - $ref: '#/components/schemas/fly.MachineMetrics'
        mounts:
          type: array
          description: >-
            Persistent volumes to mount in the Machine. A Machine can mount at
            most one volume, which must be on

            the same host. The mounted volume cannot be changed by updating the
            Machine
          items:
            $ref: '#/components/schemas/fly.MachineMount'
        processes:
          type: array
          description: >-
            Multiple processes to run within this one Machine, all from the
            Machine's image. Unrelated to the

            process groups in fly.toml, which run on separate Machines. To run
            processes from different

            images, use containers instead
          items:
            $ref: '#/components/schemas/fly.MachineProcess'
        restart:
          type: object
          description: >-
            Whether and how the Machine is restarted after its main process
            exits
          allOf:
            - $ref: '#/components/schemas/fly.MachineRestart'
        rootfs:
          type: object
          description: >-
            Beta: the size of the Machine's root filesystem and whether it
            persists. This field may be

            removed in the future
          allOf:
            - $ref: '#/components/schemas/fly.MachineRootfs'
        schedule:
          type: string
          description: >-
            Run the Machine at an interval: one of hourly, daily, weekly or
            monthly. The interval starts when

            the Machine is created
        services:
          type: array
          description: Network services that Fly Proxy routes traffic to
          items:
            $ref: '#/components/schemas/fly.MachineService'
        size:
          type: string
          description: 'Deprecated: use Guest instead'
        spot:
          type: object
          description: Spot pricing settings for the Machine
          allOf:
            - $ref: '#/components/schemas/fly.MachineSpot'
        standbys:
          type: array
          description: >-
            Standbys enable a machine to be a standby for another. In the event
            of a hardware failure,

            the standby machine will be started.
          items:
            type: string
        statics:
          type: array
          description: >-
            Static files to serve under a URL prefix. Fly Proxy routes matching
            requests to a file server

            inside the Machine, bypassing your application's own process; the
            Machine must be running. The

            files are read either from a path inside the Machine or from a
            Tigris bucket that belongs to the

            app; no bucket is created for you
          items:
            $ref: '#/components/schemas/fly.Static'
        stop_config:
          type: object
          description: >-
            How the Machine is shut down gracefully: the signal sent to it and
            how long to wait before a hard shutdown
          allOf:
            - $ref: '#/components/schemas/fly.StopConfig'
    CheckStatus:
      type: object
      properties:
        name:
          type: string
          description: >-
            Name of the check: the key of a top-level check in `config.checks`,
            or

            `servicecheck-<index>-<type>-<internal_port>` for a check defined in
            a service.
        output:
          type: string
          description: Output of the most recent check run, such as an error message.
        status:
          type: string
          description: 'Result of the check: `passing`, `warning`, or `critical`.'
          enum:
            - passing
            - warning
            - critical
        updated_at:
          type: string
          description: When the check's status was last updated.
    MachineEvent:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of the event (a ULID).
        request:
          type: object
          description: >-
            Details that depend on the event type. For example, `exit` events
            carry the exit

            code and whether the process was killed for running out of memory,
            and `update`

            events carry the new version.
        source:
          type: string
          description: >-
            Who triggered the event: `user` for requests to this API, `flyd` for
            the host's

            Machine manager acting on its own (for example when a Machine exits
            or restarts), or

            `proxy` for Fly Proxy starting and stopping Machines.
        status:
          type: string
          description: >-
            The state the Machine moved to with this event, such as `created`,
            `started`, or

            `stopped`. The Machine's `state` is the status of its latest event.
        timestamp:
          type: integer
          description: When the event happened, in Unix milliseconds.
        type:
          type: string
          description: >-
            What happened, such as `launch`, `start`, `stop`, `exit`, `restart`,
            `update`,

            `suspension`, `cancel_suspension`, `migration`, `metadata_update`,
            `archive`, or

            `destroy`.
    ImageRef:
      type: object
      properties:
        digest:
          type: string
          description: Content digest of the image (`sha256:...`).
        labels:
          type: object
          additionalProperties:
            type: string
          description: The image's OCI labels.
        registry:
          type: string
          description: Registry host of the image, such as `registry.fly.io`.
        repository:
          type: string
          description: >-
            Repository of the image within the registry, such as
            `library/nginx`.
        tag:
          type: string
          description: Tag the image was referenced by, if any.
    StrippedLease:
      type: object
      properties:
        description:
          type: string
          description: Description given when the lease was acquired.
        expires_at:
          type: integer
          description: When the lease expires, in Unix seconds.
        owner:
          type: string
          description: Email address of the user who acquired the lease.
    main.statusCode:
      type: string
      enum:
        - unknown
        - insufficient_capacity
        - volume_placement_capacity
        - exec_request_too_large
        - exec_output_too_large
        - name_taken
      x-enum-varnames:
        - unknown
        - capacityErr
        - volumePlacementCapacityErr
        - execRequestTooLargeErr
        - execOutputTooLargeErr
        - nameTakenErr
    fly.MachineCacheDrive:
      type: object
      properties:
        size_mb:
          type: integer
          description: >-
            Beta: size of the cache drive in MiB. At most 51200; 0 uses the
            default
    fly.MachineCheck:
      type: object
      properties:
        grace_period:
          type: string
          description: The time to wait after a VM starts before checking its health
          example: 1s
        headers:
          type: array
          description: For http checks, headers to send with the request
          items:
            $ref: '#/components/schemas/fly.MachineHTTPHeader'
        interval:
          type: string
          description: The time between connectivity checks
          example: 15s
        kind:
          type: string
          description: Kind of the check (informational, readiness)
          enum:
            - informational
            - readiness
        method:
          type: string
          description: For http checks, the HTTP method to use to when making the request
        path:
          type: string
          description: For http checks, the path to send the request to
        port:
          type: integer
          description: The port to connect to, often the same as internal_port
        protocol:
          type: string
          description: For http checks, whether to use http or https
        timeout:
          type: string
          description: >-
            The maximum time a connection can take before being reported as
            failing its health check
          example: 2s
        tls_server_name:
          type: string
          description: >-
            If the protocol is https, the hostname to use for TLS certificate
            validation
        tls_skip_verify:
          type: boolean
          description: >-
            For http checks with https protocol, whether or not to verify the
            TLS certificate
        type:
          type: string
          description: tcp or http
    fly.ContainerConfig:
      type: object
      properties:
        cmd:
          type: array
          description: CmdOverride is used to override the default command of the image.
          items:
            type: string
        depends_on:
          type: array
          description: >-
            DependsOn can be used to define dependencies between containers. The
            container will only be

            started after all of its dependent conditions have been satisfied.
          items:
            $ref: '#/components/schemas/fly.ContainerDependency'
        entrypoint:
          type: array
          description: >-
            EntrypointOverride is used to override the default entrypoint of the
            image.
          items:
            type: string
        env:
          type: object
          additionalProperties:
            type: string
          description: >-
            ExtraEnv is used to add additional environment variables to the
            container.
        env_from:
          type: array
          description: >-
            EnvFrom can be provided to set environment variables from machine
            fields.
          items:
            $ref: '#/components/schemas/fly.EnvFrom'
        exec:
          type: array
          description: >-
            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.
          items:
            type: string
        files:
          type: array
          description: Files are files that will be written to the container file system.
          items:
            $ref: '#/components/schemas/fly.File'
        healthchecks:
          type: array
          description: >-
            Healthchecks determine the health of your containers. Healthchecks
            can use HTTP, TCP or an Exec command.
          items:
            $ref: '#/components/schemas/fly.ContainerHealthcheck'
        image:
          type: string
          description: Image is the docker image to run.
        name:
          type: string
          description: Name is used to identify the container in the machine.
        restart:
          type: object
          description: Restart is used to define the restart policy for the container.
          allOf:
            - $ref: '#/components/schemas/fly.MachineRestart'
        secrets:
          type: array
          description: >-
            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.
          items:
            $ref: '#/components/schemas/fly.MachineSecret'
        stop:
          type: object
          description: >-
            Stop is used to define the signal and timeout for stopping the
            container.
          allOf:
            - $ref: '#/components/schemas/fly.StopConfig'
        user:
          type: string
          description: UserOverride is used to override the default user of the image.
    fly.DNSConfig:
      type: object
      properties:
        dns_forward_rules:
          type: array
          description: Forward DNS queries for some domains to other DNS servers
          items:
            $ref: '#/components/schemas/fly.dnsForwardRule'
        hostname:
          type: string
          description: >-
            Hostname of the Machine. Defaults to the Machine ID. Also added to
            /etc/hosts with the

            Machine's 6PN address
        hostname_fqdn:
          type: string
          description: Fully qualified domain name added to /etc/hosts for `hostname`
        nameservers:
          type: array
          description: >-
            Nameservers to use instead of the default, Fly.io's private DNS
            server `fdaa::3`
          items:
            type: string
        options:
          type: array
          description: Options for /etc/resolv.conf
          items:
            $ref: '#/components/schemas/fly.dnsOption'
        searches:
          type: array
          description: Search domains for /etc/resolv.conf
          items:
            type: string
        skip_registration:
          type: boolean
          description: Currently has no effect
    fly.File:
      type: object
      properties:
        guest_path:
          type: string
          description: >-
            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:
          type: string
          description: >-
            The name of an image to use the OCI image config as the file
            contents.
        mode:
          type: integer
          description: >-
            Mode bits used to set permissions on this file as accepted by
            chmod(2).
        raw_value:
          type: string
          description: The base64 encoded string of the file contents.
        secret_name:
          type: string
          description: >-
            The name of the secret that contains the base64 encoded file
            contents.
      description: >-
        A file that will be written to the Machine. One of RawValue or
        SecretName must be set.
    fly.MachineGuest:
      type: object
      properties:
        cpu_kind:
          type: string
          description: >-
            Kind of CPU: shared or performance. Performance CPUs must be enabled
            for the organization.

            Defaults to shared when `guest` is omitted
        cpus:
          type: integer
          description: >-
            Number of CPUs: 1, 2, 4, 6, 8, 10, 12, 14, 16, 32, 64 or 128, up to
            8 for shared and 16 for

            performance CPUs unless the organization's limit is higher. Defaults
            to 1 when `guest` is

            omitted
        gpu_kind:
          type: string
          description: No longer supported. Requests that set it are rejected
        gpus:
          type: integer
          description: No longer supported. Requests that set it are rejected
        host_dedication_id:
          type: string
          description: >-
            Place the Machine on hosts dedicated to the organization under this
            ID. Only available to

            organizations with dedicated hosts
        kernel_args:
          type: array
          description: Extra arguments appended to the guest kernel command line
          items:
            type: string
        max_memory_mb:
          type: integer
          description: >-
            Memory in MiB that the Machine's memory limit can later be raised to
            without a restart, using

            the memory endpoints. Must be at least memory_mb and at most the
            per-CPU maximum. The Machine

            starts with a limit of memory_mb
        memory_mb:
          type: integer
          description: >-
            Memory in MiB. Must be a multiple of 256 for shared and 1024 for
            performance CPUs, and

            between 256 and 2048 (shared) or 2048 and 8192 (performance) per
            CPU. Defaults to 256 when

            `guest` is omitted
        persist_rootfs:
          type: string
          description: 'Deprecated: use MachineConfig.Rootfs instead'
          enum:
            - never
            - always
            - restart
        required_host_features:
          type: array
          description: >-
            Host features the Machine's host must have, such as
            `storage-tier-1`. At most 16, each made

            of lowercase letters, digits and dashes. Each feature must be
            enabled for the organization
          items:
            type: string
    fly.MachineInit:
      type: object
      properties:
        cmd:
          type: array
          description: Replaces the image's CMD. It's appended to the entrypoint
          items:
            type: string
        entrypoint:
          type: array
          description: Replaces the image's ENTRYPOINT
          items:
            type: string
        exec:
          type: array
          description: >-
            Command to run instead of the image's ENTRYPOINT and CMD. Takes
            precedence over entrypoint

            and cmd
          items:
            type: string
        kernel_args:
          type: array
          description: Currently has no effect. Use `guest.kernel_args` instead
          items:
            type: string
        swap_size_mb:
          type: integer
          description: >-
            Size in MiB of a swap device to give the Machine. Machines with swap
            cannot be suspended
        tty:
          type: boolean
          description: Currently has no effect
    fly.MachineMetrics:
      type: object
      properties:
        https:
          type: boolean
          description: Scrape over HTTPS instead of HTTP
        path:
          type: string
          description: HTTP path to scrape. Defaults to `/`
        port:
          type: integer
          description: Port in the Machine to scrape metrics from
    fly.MachineMount:
      type: object
      properties:
        add_size_gb:
          type: integer
          description: >-
            With automatic extension, grow the volume by this many GB at a time.
            Between 1 and 100.

            Mutually exclusive with add_size_percent
        add_size_percent:
          type: integer
          description: >-
            AddSizePercent grows by a percentage of the current size, rounded up
            to GiB.

            It is mutually exclusive with AddSizeGb.
        encrypted:
          type: boolean
          description: Whether the volume is encrypted. Set by Fly.io; ignored in requests
        extend_threshold_percent:
          type: integer
          description: >-
            Enable automatic volume extension: grow the volume when its usage
            exceeds this percentage.

            Between 50 and 99; 0 disables it
        min_add_size_gb:
          type: integer
          description: MinAddSizeGb is the minimum proportional growth in GiB (default 1).
        name:
          type: string
          description: Name of the volume. Set by Fly.io; ignored in requests
        path:
          type: string
          description: Absolute path in the Machine to mount the volume at. Required
        size_gb:
          type: integer
          description: Size of the volume in GB. Set by Fly.io; ignored in requests
        size_gb_limit:
          type: integer
          description: >-
            With automatic extension, never grow the volume beyond this size in
            GB. At most the

            organization's maximum volume size
        volume:
          type: string
          description: >-
            ID (`vol_...`) or name of the volume to mount. Required. With a
            name, any unattached volume

            of the app with that name in the Machine's region is used
    fly.MachineProcess:
      type: object
      properties:
        cmd:
          type: array
          description: >-
            Replaces the image's CMD for this process. It's appended to the
            entrypoint
          items:
            type: string
        entrypoint:
          type: array
          description: Replaces the image's ENTRYPOINT for this process
          items:
            type: string
        env:
          type: object
          additionalProperties:
            type: string
          description: >-
            Environment variables for this process, in addition to the Machine's
            `env`
        env_from:
          type: array
          description: >-
            EnvFrom can be provided to set environment variables from machine
            fields.
          items:
            $ref: '#/components/schemas/fly.EnvFrom'
        exec:
          type: array
          description: >-
            Command to run instead of the image's ENTRYPOINT and CMD. Takes
            precedence over entrypoint

            and cmd
          items:
            type: string
        ignore_app_secrets:
          type: boolean
          description: >-
            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:
          type: array
          description: >-
            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.
          items:
            $ref: '#/components/schemas/fly.MachineSecret'
        user:
          type: string
          description: User to run the process as, instead of the image's USER
    fly.MachineRestart:
      type: object
      properties:
        max_retries:
          type: integer
          description: >-
            When policy is on-failure, the maximum number of times to attempt to
            restart the Machine before letting it stop.
        policy:
          type: string
          description: >-
            * 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.
          enum:
            - 'no'
            - always
            - on-failure
      description: >-
        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/.
    fly.MachineRootfs:
      type: object
      properties:
        persist:
          type: string
          description: >-
            Whether changes to the root filesystem are kept. `never` (default):
            reset on every start.

            `restart`: kept across stops and restarts, reset when the Machine is
            updated. `always`: also

            kept across updates
          enum:
            - never
            - always
            - restart
        size_gb:
          type: integer
          description: Size of the root filesystem in GB. At most 50; 0 uses the default
    fly.MachineService:
      type: object
      properties:
        autostart:
          type: boolean
          description: >-
            Whether Fly Proxy starts stopped or suspended Machines when requests
            arrive. Defaults to true
        autostop:
          type: string
          description: >-
            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.
          enum:
            - 'off'
            - stop
            - suspend
        checks:
          type: array
          description: An optional list of service checks
          items:
            $ref: '#/components/schemas/fly.MachineServiceCheck'
        concurrency:
          type: object
          description: Load limits Fly Proxy uses to balance traffic across Machines
          allOf:
            - $ref: '#/components/schemas/fly.MachineServiceConcurrency'
        force_instance_description:
          type: string
          description: Currently has no effect
        force_instance_key:
          type: string
          description: Currently has no effect
        internal_port:
          type: integer
          description: >-
            Port in the Machine that Fly Proxy forwards traffic to. Defaults to
            8080
        min_machines_running:
          type: integer
          description: >-
            When autostop is on, the number of Machines Fly Proxy keeps running
            in the app's primary

            region (`PRIMARY_REGION` env var). Machines in other regions can all
            be stopped
        ports:
          type: array
          description: Public ports that Fly Proxy accepts traffic on
          items:
            $ref: '#/components/schemas/fly.MachinePort'
        protocol:
          type: string
          description: 'Protocol: tcp or udp. Defaults to tcp'
    fly.MachineSpot:
      type: object
      properties:
        max_price_fraction:
          type: number
          description: >-
            MaxPriceFraction is the maximum fraction of the full Machine price
            you will pay for this Machine. Range: (0, 1.0]
    fly.Static:
      required:
        - guest_path
        - url_prefix
      type: object
      properties:
        guest_path:
          type: string
          description: >-
            The path inside the Machine, or inside tigris_bucket when set, where
            the files to serve are located
        index_document:
          type: string
          description: >-
            The document served for requests to the URL prefix or any of its
            subfolders. Only works with tigris_bucket
        tigris_bucket:
          type: string
          description: >-
            An existing Tigris bucket belonging to the app to read the files
            from, instead of the Machine's

            filesystem. The files are still served through the Machine
        url_prefix:
          type: string
          description: The URL prefix under which the files are served
    fly.StopConfig:
      type: object
      properties:
        signal:
          type: string
          description: Signal to send to the Machine's processes. Defaults to SIGINT
          enum:
            - SIGHUP
            - SIGINT
            - SIGQUIT
            - SIGKILL
            - SIGUSR1
            - SIGUSR2
            - SIGTERM
        timeout:
          type: string
          description: >-
            How long to wait for the Machine to exit after sending the signal,
            before killing it. At most

            5 minutes (1 minute for spot Machines). Defaults to 5s (60s for spot
            Machines)
          example: 10s
    fly.MachineHTTPHeader:
      type: object
      properties:
        name:
          type: string
          description: The header name
        values:
          type: array
          description: The header value
          items:
            type: string
      description: >-
        For http checks, an array of objects with string field Name and array of
        strings field Values. The key/value pairs specify header and header
        values that will get passed with the check call.
    fly.ContainerDependency:
      type: object
      properties:
        condition:
          type: object
          description: >-
            When the container can start: once the dependency has `started`, is
            `healthy`, or has

            `exited_successfully`
          allOf:
            - $ref: '#/components/schemas/fly.ContainerDependencyCondition'
        name:
          type: string
          description: Name of the container this one depends on
    fly.EnvFrom:
      type: object
      properties:
        env_var:
          type: string
          description: >-
            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:
          type: string
          description: >-
            FieldRef selects a field of the Machine: supports id, version,
            app_name, private_ip, region, image.
          enum:
            - id
            - version
            - app_name
            - private_ip
            - region
            - image
      description: >-
        EnvVar defines an environment variable to be populated from a machine
        field, env_var
    fly.ContainerHealthcheck:
      type: object
      properties:
        exec:
          type: object
          description: Check that a command run in the container exits with status 0
          allOf:
            - $ref: '#/components/schemas/fly.ExecHealthcheck'
        failure_threshold:
          type: integer
          description: >-
            The number of times the check must fail before considering the
            container unhealthy.
        grace_period:
          type: integer
          description: >-
            The time in seconds to wait after a container starts before checking
            its health.
        http:
          type: object
          description: Check that an HTTP request succeeds
          allOf:
            - $ref: '#/components/schemas/fly.HTTPHealthcheck'
        interval:
          type: integer
          description: The time in seconds between executing the defined check.
        kind:
          type: object
          description: Kind of healthcheck (readiness, liveness)
          allOf:
            - $ref: '#/components/schemas/fly.ContainerHealthcheckKind'
        name:
          type: string
          description: The name of the check. Must be unique within the container.
        success_threshold:
          type: integer
          description: >-
            The number of times the check must succeeed before considering the
            container healthy.
        tcp:
          type: object
          description: Check that a TCP connection can be opened
          allOf:
            - $ref: '#/components/schemas/fly.TCPHealthcheck'
        timeout:
          type: integer
          description: The time in seconds to wait for the check to complete.
        unhealthy:
          type: object
          description: >-
            Unhealthy policy that determines what action to take if a container
            is deemed unhealthy
          allOf:
            - $ref: '#/components/schemas/fly.UnhealthyPolicy'
    fly.MachineSecret:
      type: object
      properties:
        env_var:
          type: string
          description: >-
            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:
          type: string
          description: >-
            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.
      description: >-
        A Secret needing to be set in the environment of the Machine. env_var is
        required
    fly.dnsForwardRule:
      type: object
      properties:
        addr:
          type: string
          description: >-
            Address and port of the DNS server to forward queries to over TCP,
            e.g. `10.0.0.1:53`
        basename:
          type: string
          description: >-
            Domain to forward queries for, including subdomains. Must end in a
            dot, e.g. `example.com.`
    fly.dnsOption:
      type: object
      properties:
        name:
          type: string
          description: Option name, e.g. `ndots`
        value:
          type: string
          description: Option value, e.g. `5`
    fly.MachineServiceCheck:
      type: object
      properties:
        grace_period:
          type: string
          description: The time to wait after a VM starts before checking its health
          example: 1s
        headers:
          type: array
          description: For http checks, headers to send with the request
          items:
            $ref: '#/components/schemas/fly.MachineHTTPHeader'
        interval:
          type: string
          description: The time between connectivity checks
          example: 15s
        method:
          type: string
          description: For http checks, the HTTP method to use to when making the request
        path:
          type: string
          description: For http checks, the path to send the request to
        port:
          type: integer
          description: The port to connect to, often the same as internal_port
        protocol:
          type: string
          description: For http checks, whether to use http or https
        timeout:
          type: string
          description: >-
            The maximum time a connection can take before being reported as
            failing its health check
          example: 2s
        tls_server_name:
          type: string
          description: >-
            If the protocol is https, the hostname to use for TLS certificate
            validation
        tls_skip_verify:
          type: boolean
          description: >-
            For http checks with https protocol, whether or not to verify the
            TLS certificate
        type:
          type: string
          description: tcp or http
    fly.MachineServiceConcurrency:
      type: object
      properties:
        hard_limit:
          type: integer
          description: >-
            Fly Proxy sends no more than this many connections or requests to a
            Machine at once. 0 means

            no hard limit
        soft_limit:
          type: integer
          description: >-
            Above this many connections or requests, Fly Proxy prefers other
            Machines. Defaults to 20,

            and is lowered to hard_limit if higher
        type:
          type: string
          description: 'What to count: `connections` (default) or `requests`'
    fly.MachinePort:
      type: object
      properties:
        end_port:
          type: integer
          description: Last public port of a range
        force_https:
          type: boolean
          description: Redirect plain HTTP requests to HTTPS
        handlers:
          type: array
          description: >-
            How Fly Proxy handles connections before forwarding them: `tls`
            terminates TLS, `pg_tls`

            terminates PostgreSQL TLS, `http` handles HTTP, `proxy_proto` adds a
            PROXY protocol header.

            Without handlers, raw TCP is forwarded
          items:
            type: string
        http_options:
          type: object
          description: Options for the `http` handler
          allOf:
            - $ref: '#/components/schemas/fly.HTTPOptions'
        port:
          type: integer
          description: Public port. Use either port, or start_port and end_port
        proxy_proto_options:
          type: object
          description: Options for the `proxy_proto` handler
          allOf:
            - $ref: '#/components/schemas/fly.ProxyProtoOptions'
        start_port:
          type: integer
          description: First public port of a range
        tls_options:
          type: object
          description: Options for the `tls` handler
          allOf:
            - $ref: '#/components/schemas/fly.TLSOptions'
    fly.ContainerDependencyCondition:
      type: string
      enum:
        - exited_successfully
        - healthy
        - started
      x-enum-varnames:
        - ExitedSuccessfully
        - Healthy
        - Started
    fly.ExecHealthcheck:
      type: object
      properties:
        command:
          type: array
          description: >-
            The command to run to check the health of the container (e.g.
            ["cat", "/tmp/healthy"])
          items:
            type: string
    fly.HTTPHealthcheck:
      type: object
      properties:
        headers:
          type: array
          description: Additional headers to send with the request
          items:
            $ref: '#/components/schemas/fly.MachineHTTPHeader'
        method:
          type: string
          description: The HTTP method to use to when making the request
        path:
          type: string
          description: The path to send the request to
        port:
          type: integer
          description: The port to connect to, often the same as internal_port
        scheme:
          type: object
          description: Whether to use http or https
          allOf:
            - $ref: '#/components/schemas/fly.ContainerHealthcheckScheme'
        tls_server_name:
          type: string
          description: >-
            If the protocol is https, the hostname to use for TLS certificate
            validation
        tls_skip_verify:
          type: boolean
          description: >-
            If the protocol is https, whether or not to verify the TLS
            certificate
    fly.ContainerHealthcheckKind:
      type: string
      enum:
        - readiness
        - liveness
      x-enum-varnames:
        - Readiness
        - Liveness
    fly.TCPHealthcheck:
      type: object
      properties:
        port:
          type: integer
          description: The port to connect to, often the same as internal_port
    fly.UnhealthyPolicy:
      type: string
      enum:
        - stop
      x-enum-varnames:
        - UnhealthyPolicyStop
    fly.HTTPOptions:
      type: object
      properties:
        compress:
          type: boolean
          description: Compress response bodies. Defaults to true
        h2_backend:
          type: boolean
          description: Use HTTP/2 to talk to the Machine
        headers_read_timeout:
          type: integer
          description: >-
            Seconds Fly Proxy waits for a client to send request headers.
            Defaults to 5
        idle_timeout:
          type: integer
          description: >-
            Seconds a client connection can be idle between requests before it's
            closed. Defaults to 300
        replay_cache:
          type: array
          description: >-
            Cache `fly-replay` responses from the Machine: once a client is
            replayed, its further

            requests are replayed directly, keyed on a cookie or header, without
            asking the Machine again
          items:
            $ref: '#/components/schemas/fly.ReplayCache'
        response:
          type: object
          description: Changes Fly Proxy makes to responses
          allOf:
            - $ref: '#/components/schemas/fly.HTTPResponseOptions'
    fly.ProxyProtoOptions:
      type: object
      properties:
        fly_src:
          type: boolean
          description: >-
            With version v2, add the Fly-Src header and its signature to the
            PROXY protocol header
        version:
          type: string
          description: 'PROXY protocol version: v1 (default) or v2'
    fly.TLSOptions:
      type: object
      properties:
        alpn:
          type: array
          description: >-
            ALPN protocols to offer, e.g. `h2`, `http/1.1`. Defaults to `h2` and
            `http/1.1`
          items:
            type: string
        default_self_signed:
          type: boolean
          description: >-
            Use a self-signed certificate when there is no certificate for the
            requested hostname
        versions:
          type: array
          description: 'TLS versions to accept: `TLSv1.2`, `TLSv1.3`. Defaults to both'
          items:
            type: string
    fly.ContainerHealthcheckScheme:
      type: string
      enum:
        - http
        - https
      x-enum-varnames:
        - HTTP
        - HTTPS
    fly.ReplayCache:
      type: object
      properties:
        allow_bypass:
          type: boolean
          description: >-
            Let clients skip the cache by sending the `fly-replay-cache-control:
            skip` header
        name:
          type: string
          description: Name of the cookie or header to key the cache on
        path_prefix:
          type: string
          description: >-
            Requests whose path starts with this prefix use the rule. May start
            with a hostname, e.g.

            `example.com/api/*`
        ttl_seconds:
          type: integer
          description: How long a cached replay is used, in seconds
        type:
          type: string
          description: Currently either "cookie" or "header"
          enum:
            - cookie
            - header
    fly.HTTPResponseOptions:
      type: object
      properties:
        headers:
          type: object
          additionalProperties:
            type: object
          description: >-
            Response headers to set. A string sets the header, a list of strings
            sets it to multiple

            values, and false removes it
        pristine:
          type: boolean
          description: Don't let Fly Proxy add or change any response headers
  securitySchemes:
    FlyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Fly API token with access to the requested organization or resource.
        Send it as `Authorization: Bearer <Fly API token>`.

````