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

# Delete Media

> Permanently delete an asset with client.delete_media().

Deletes an asset and every cached transform derived from it.

```python theme={null}
client.delete_media(asset.id)
```

## Signature

```python theme={null}
client.delete_media(media_id, *, timeout=NOT_GIVEN) -> None
```

| Parameter | Type | Description |
| :- | :- | :- |
| `media_id` | `str` | **Required.** The asset's `id` |

Returns `None`. A successful delete has no body.

> [!WARNING]
>
> This is immediate and permanent. URLs already handed out stop resolving — including
> [signed URLs](https://docs.dreep.cloud/python-sdk/media/signed-url.md) that have not expired yet.

## Deletes are not retried

Writes are never retried automatically, deletes included. If a delete fails with a network
error and you retry it by hand, a `DreepNotFoundError` usually means the first attempt
actually succeeded:

```python theme={null}
from dreep import DreepNotFoundError

try:
    client.delete_media(media_id)
except DreepNotFoundError:
    pass  # already gone — treat as success
```

## Deleting a whole folder

There is no endpoint for deleting a folder. To clear one, list it and delete the assets:

```python theme={null}
for item in client.list_all_media(folder="temp", recursive=True):
    client.delete_media(item.id)
```

## Errors

| Error | Cause |
| :- | :- |
| `DreepNotFoundError` | No such asset, or it was already deleted |
| `DreepAuthError` | The key doesn't belong to the asset's project |


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