# Restore from trash

**Publié le** : 2026-05-08
**Catégorie** : Media & Files

## `POST /media/:id/restore`

**Restore from trash**

Restores a soft-deleted file back to the media library.

Required permissions: `media.delete`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes | Unique identifier |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Unauthorized — invalid or missing API token |
| `403` | Forbidden — insufficient permissions |
| `404` | Not found |
| `422` | Validation error |


### Examples

```bash
curl -X POST https://api.lynkow.com/v1/media/d4e5f6a7-b8c9-0123-defa-456789012345/restore \
  -H "Authorization: Bearer $API_TOKEN"
```

### Response Example

```json
{
  "data": {
    "id": "d4e5f6a7-b8c9-0123-defa-456789012345",
    "filename": "old-banner.jpg",
    "originalName": "old-banner.jpg",
    "mimeType": "image/jpeg",
    "size": 198400,
    "alt": "Old banner",
    "url": "https://cdn.lynkow.com/sites/abc123/old-banner.jpg",
    "folderId": null,
    "createdAt": "2025-01-20T09:00:00.000Z",
    "updatedAt": "2025-04-06T12:00:00.000Z"
  }
}
```

---