# Create Lease (/machines/Machines_create_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.


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

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `app_name` | path | `string` | Yes | Fly App Name |
| `machine_id` | path | `string` | Yes | Machine ID |
| `fly-machine-lease-nonce` | header | `string` | No | Existing lease nonce to refresh by ttl, empty or non-existent to create a new lease |

## Request Body

Type: `CreateLeaseRequest`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | `string` | No |  |
| `ttl` | `integer` | No | seconds lease will be valid |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `201` | Created | `Lease` |

The full machine-readable OpenAPI spec is available at /openapi.json.