Skip to main content
You can use the Volumes resource to create and delete volumes. A Fly Volume is persistent storage for a Fly Machine. Learn more about volumes.

Volume properties

List all the volumes in an app

GET /apps/{app_name}/volumes Given the name of a Fly App, get a list of all the volumes that belong to it.

Path parameters

string
required
The name of the Fly App to list volumes for.
GET/v1/apps/{app_name}/volumes
Status: 200 OK - Example response

Create a volume

POST /apps/{app_name}/volumes Create a volume for a specific app according to the configuration provided in the request body.

Path parameters

string
required
The name of the Fly App to create a volume for.
POST/v1/apps/{app_name}/volumes
Request body schema

Body parameters

bool
Enable automatic daily snapshots. Default true.
object
An optional object defining the compute specifications for the expected Machine size and type that the volume will attach to. Used to place the volume on hardware that can host that Machine.
string
The file system type. Default ext4.
boolean
If true, the volume can only be attached to Machines (not Nomad allocations).
boolean
Whether to encrypt the volume. Default true.
string
required
The name for the new volume.
string
The region where the volume will be created. Defaults to the Machine’s region if attached. If not attached, defaults to the app’s primary region.
int
The size of the volume in GB. Default 3.
string
The ID of the volume snapshot to use to create the new volume.
string
The ID of the source volume for the volume fork.
boolean
If true, we will provision this volume on hardware that doesn’t have another volume with the same name on it. The typical pattern is to create as many volumes as you need, all with the same name and require_unique_zone: true. This will keep your app available in case a host goes down. This flag can also cause volume creation to fail, in case we have used up all unique zones, in which case you probably want to set it to false. Default true.
int
The number of days to retain snapshots. Defaults to 5 when not set. Min 1, max 60.
Status: 200 OK - Example response

Get a specific volume

GET /apps/{app_name}/volumes/{volume_id} Retrieve details about a specific volume by its ID within an app.

Path parameters

string
required
The name of the Fly App the volume belongs to.
string
required
The ID of the volume to get.
GET/v1/apps/{app_name}/volumes/{volume_id}
Status: 200 OK - Example response

Update a volume

PUT /apps/{app_name}/volumes/{volume_id} Update parameters on the volume.

Path parameters

string
required
The name of the Fly App to create a volume for.
string
required
The ID of the volume to get.

Body parameters

bool
Enable automatic daily snapshots. Default true.
int
The number of days to retain snapshots. Defaults to 5 when not set. Min 1, max 60.
PUT/v1/apps/{app_name}/volumes/{volume_id}
Status: 200 OK - Example response

Delete a volume permanently

DELETE /apps/{app_name}/volumes/{volume_id} Delete a volume. This action cannot be undone. Given the name of a Fly App and the volume ID of a Fly volume, delete the volume.

Path parameters

string
required
The name of the Fly App the volume belongs to.
string
required
The ID of the volume to permanently delete.
DELETE/v1/apps/{app_name}/volumes/{volume_id}
Status: 200 OK - Example response

Extend a volume

PUT /apps/{app_name}/volumes/{volume_id}/extend Given the name of a Fly App and a volume ID, you can make a volume bigger by extending it. You can extend (increase) a volume’s size, but you can’t make a volume smaller.

Path parameters

string
required
The name of the Fly App the volume belongs to.
string
required
The ID of the volume to extend.

Body parameters

integer
required
The size in GB to make the volume.
PUT/v1/apps/{app_name}/volumes/{volume_id}/extend
Status: 200 OK - Example response
If needs_restart is true, then your Machine needs to be restarted to make use of the added space.

Get a list of snapshots for a volume

GET /apps/{app_name}/volumes/{volume_id}/snapshots Given the name of a Fly app and a volume ID, list the available snapshots for that volume.

Path parameters

string
required
The name of the Fly App to list snapshots for.
string
required
The ID of the volume to list snapshots for.
GET/v1/apps/{app_name}/volumes/{volume_id}/snapshots
Status: 200 OK - Example response

Create a volume from a snapshot

POST /apps/{app_name}/volumes Create a new volume from a snapshot backup.

Path parameters

string
required
The name of the Fly App to create a volume for.

Body parameters

string
required
The name for the new volume.
string
required
The target region. Must be in the same region as the Machine you want to attach it to.
int
The size of the volume in GB. Default 3.
string
The ID of the volume snapshot to use to create the new volume.
POST/v1/apps/{app_name}/volumes
Status: 200 OK - Example response
If you wait a moment and then get the new volume, the state should be “created”.

Create an on-demand volume snapshot (beta)

POST /apps/{app_name}/volumes/{volume_id}/snapshots Create an on-demand volume snapshot.

Path parameters

string
required
The name of the Fly App to create a snapshot for.
string
required
The ID of the volume to create a snapshot of.
POST/v1/apps/{app_name}/volumes/{volume_id}/snapshots
Status: 200 OK - Example response
Wait a few moments for the snapshot to get created and then get the list of snapshots to confirm.