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

# Delete a lease

> Revoke a lease's credentials with the Node.js SDK.

`client.dynamicSecrets().leases.delete()` deletes a lease and revokes its credentials in the external system, such as by deleting the database user.

## Parameters

**leaseId** `string` *required*

The ID of the lease.

**options** `DeleteDynamicSecretLeaseOptions` *required*

**properties**

**projectSlug** `string` *required*

The slug of the project.

**environmentSlug** `string` *required*

The slug of the environment, such as `dev`.

**path** `string` (default: /)

The path of the folder that the dynamic secret is in.

**isForced** `boolean` (default: false)

Whether to delete the lease in Infisical even if Infisical can't revoke the credentials in the external system. If you force a delete, the credentials can stay valid in the external system.

## Returns

**result** `DeleteLeaseResponse`

**properties**

**lease** `Lease`

The deleted lease.

```typescript Basic theme={"dark"}
const { lease } = await client.dynamicSecrets().leases.delete("<lease-id>", {
  projectSlug: "<project-slug>",
  environmentSlug: "dev",
});
```

```typescript Forced theme={"dark"}
const { lease } = await client.dynamicSecrets().leases.delete("<lease-id>", {
  projectSlug: "<project-slug>",
  environmentSlug: "dev",
  isForced: true,
});
```

```json Response theme={"dark"}
{
  "lease": {
    "id": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
    "version": 1,
    "externalEntityId": "inf_a8f3k2",
    "expireAt": "2026-12-02T12:25:00.000Z",
    "status": null,
    "statusDetails": null,
    "dynamicSecretId": "4d5e6f7a-8b9c-4d0e-1f2a-3b4c5d6e7f8a",
    "createdAt": "2026-12-02T11:00:00.000Z",
    "updatedAt": "2026-12-02T11:25:00.000Z"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.