Fly.io
Machines

Create Lease

View as Markdown

Create a lease for a specific Machine within an app using the details provided in the request body. Machine leases can be used to obtain an exclusive lock on modifying a Machine.

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

Create a lease for a specific Machine within an app using the details provided in the request body. Machine leases can be used to obtain an exclusive lock on modifying a Machine.

Authorization

bearerAuth
AuthorizationBearer <token>

A Fly.io access token. Create one with fly tokens create.

In: header

Path Parameters

app_name*string

Fly App Name

machine_id*string

Machine ID

Header Parameters

fly-machine-lease-nonce?string

Existing lease nonce to refresh by ttl, empty or non-existent to create a new lease

Request Body

application/json

Request body

description?string
ttl?integer

seconds lease will be valid

Response Body

application/json

curl -X POST "https://example.com/apps/string/machines/string/lease" \  -H "Content-Type: application/json" \  -d '{}'
{  "description": "string",  "expires_at": 0,  "nonce": "string",  "owner": "string",  "version": "string"}