> ## 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 folder

> Delete a folder with the Python SDK.

`client.folders.delete_folder()` deletes a [folder](https://infisical.com/docs/documentation/platform/folder.md).

> [!NOTE]
>
> `delete_folder` requires `infisicalsdk` version 1.0.17 or newer.

## Parameters

**folder\_id\_or\_name** `str` *required*

The ID or name of the folder.

**project\_id** `str` *required*

The ID of the project.

**environment\_slug** `str` *required*

The slug of the environment that the folder is in.

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

The path of the folder's parent folder.

**force\_delete** `bool` (default: False)

Whether to delete the folder even if it still holds secrets or subfolders.

> [!WARNING]
>
> If you set `force_delete=True`, Infisical also deletes every secret and subfolder in the folder.

## Returns

**folder** `DeleteFolderResponseItem`

The deleted folder, with its `id`, `name`, and `description`. It has no `path`.

```python By name theme={"dark"}
folder = client.folders.delete_folder(
    folder_id_or_name="backend",
    project_id="<project-id>",
    environment_slug="dev",
)
```

```python With its contents theme={"dark"}
folder = client.folders.delete_folder(
    folder_id_or_name="<folder-id>",
    project_id="<project-id>",
    environment_slug="dev",
    force_delete=True,
)
```

```json Response theme={"dark"}
{
  "id": "3a1f6c2e-9b4d-4e7a-8c5f-2d1e0b9a8c7f",
  "name": "backend",
  "description": "Secrets for the backend service",
  "envId": "c4e2a1b9-7d3f-4a6e-9b8c-5f0e1d2c3b4a",
  "parentId": "8b7a6c5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d",
  "version": 1,
  "createdAt": "2026-11-02T09:10:05.220Z",
  "updatedAt": "2026-11-02T09:10:05.220Z"
}
```


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