> ## 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 dynamic secret

> Delete a dynamic secret and its leases with the Node.js SDK.

`client.dynamicSecrets().delete()` deletes a dynamic secret. It also deletes the dynamic secret's leases and revokes their credentials.

## Parameters

**dynamicSecretName** `string` *required*

The name of the dynamic secret.

**options** `DeleteDynamicSecretOptions` *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 dynamic secret without revoking the credentials of its leases. If `true`, the credentials stay valid in the external system.

## Returns

**dynamicSecret** `DynamicSecret`

The deleted dynamic secret.

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

```json Response theme={"dark"}
{
  "id": "4d5e6f7a-8b9c-4d0e-1f2a-3b4c5d6e7f8a",
  "name": "redis-cache",
  "type": "redis",
  "defaultTTL": "1h",
  "maxTTL": "24h",
  "folderId": "3a1f6c2e-9b4d-4e7a-8c5f-2d1e0b9a8c7f",
  "version": 1,
  "status": null,
  "statusDetails": null,
  "createdAt": "2026-12-02T11:10:27.640Z",
  "updatedAt": "2026-12-02T11:10:27.640Z"
}
```


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