## Permanently delete folder

`POST /v1/folders/:id/purge`

**Permanently deletes the object, bypassing trash.** Accepts live and trashed objects. To keep the option to restore, use `DELETE /v1/folders/:id`.

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | yes | Positive safe integer |

Key scope: `disk`. No body required.

## curl

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/folders/42/purge" -H "X-Api-Key: YOUR_API_KEY"
```

## JavaScript

```javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/folders/42/purge", {
  method: "POST",
  headers: { "X-Api-Key": "YOUR_API_KEY" },
});
const data = await response.json();
```

## Response

```json
{
  "success": true,
  "data": {
    "id": 42,
    "purged": true
  }
}
```

## Errors

400 INVALID_ID / INVALID_PARAMS; 401 TOKEN_MISSING; 403 SCOPE_DENIED / BITRIX_ACCESS_DENIED / WRITE_BLOCKED_READONLY_KEY; 404 ENTITY_NOT_FOUND; 422 BITRIX_ERROR / DISK_DELETE_REFUSED; 429; 502 DISK_OUTCOME_UNKNOWN / BITRIX_UNAVAILABLE; 503.

A READONLY key cannot perform this action. A missing object and a repeated successful purge return 404.

## Known behavior

Permanently deletes the entire tree. Permissions are checked only on the addressed folder; child objects are deleted without individual permission checks. The operation is not transactional: a refusal may follow partial deletion; read the folder again. A storage root cannot be deleted.

Only `deletedType != 0` indicates trash: `deletedAt` and `deletedBy` are not cleared after restoration. Writes are never automatically retried. A network interruption leaves the outcome unknown: read the object before retrying. Batch does not support these dedicated actions.

Bitrix24: `disk.folder.deleteTree`.

## See also

- [DELETE](/docs/entities/folders/delete)
- [Restore](/docs/entities/folders/restore)
