# Recycle bin

> For AI agents: the full docs index is at https://brixsignage.com/llms.txt, and every page has a markdown twin (add .md to the path).

Base URL `https://api.brixsignage.com`. Send `Authorization: Bearer $BRIX_API_KEY` unless an operation says Auth: none or Auth: no API key. The Permission line names what the key must hold. See [Authentication and scopes](https://brixsignage.com/developers/authentication.md), [Errors and rate limits](https://brixsignage.com/developers/errors-and-rate-limits.md) and [Pagination](https://brixsignage.com/developers/pagination.md).

- [GET /v1/recycle-bin](#get-v1-recycle-bin)
- [POST /v1/recycle-bin/{kind}/{id}/purge](#post-v1-recycle-bin-kind-id-purge)

Every 4xx and 5xx response below returns this body:

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | Machine-readable code: `unauthorized`, `forbidden`, `not_found`, `validation_error`, `conflict`, `rate_limited`, `internal_error`, … |
| `message` | string | Human-readable explanation. Safe to show an operator. |
| `requestId` | string | Present on 5xx: quote it to support. |

## GET /v1/recycle-bin

List the recycle bin

List every deleted item across your workspace, including media, playlists, schedules, layouts, creatives, apps, and data sources. Each entry includes the deletion time and size, so items can be restored or permanently erased within the 30-day recovery window. Deleted screens are not included; screens have their own recovery endpoints.

**Notes.**
- Items deleted in the last 30 days, newest first. Each kind is listed only if the caller holds its view permission (`playlist.view`, `media.view`, …) where the item lives; a `screen.view`-only key sees only screens.

Auth: Bearer token. Permission: `screen.view`.

```bash
curl "https://api.brixsignage.com/v1/recycle-bin" \
  -H "Authorization: Bearer $BRIX_API_KEY"
```

Response 200: Success.

| Field | Type | Description |
| --- | --- | --- |
| `data` | array of object |  |
| `data[].kind` | string |  |
| `data[].id` | string |  |
| `data[].name` | string |  |
| `data[].deletedAt` | string | ISO-8601 timestamp (UTC). |
| `data[].nodeId` | string \| null |  |
| `data[].sizeBytes` | integer | Stored bytes (media); 0 for other kinds. |
| `data[].usageBeforeDelete` | integer | How many places used it when it was deleted. |
| `data[].thumbnailUrl` | string \| null | For media: its stored address (may be an internal `r2://` reference, not a public URL). |

Response 401: Missing, expired or revoked bearer token.

Response 403: The token lacks the permission this operation needs (see `x-brix-permission`).

Response 5XX: Server error. The body carries a `requestId` to quote to support.

## POST /v1/recycle-bin/{kind}/{id}/purge

Permanently delete from the recycle bin

Permanently erase one deleted item before the 30-day recovery window would otherwise remove it. For media, this also deletes the stored file. This action cannot be undone.

**Notes.**
- Irreversible. Besides the `screen.view` gate, the caller needs the kind's delete permission (`media.delete`, `integration.delete` for a banner, …).

Auth: Bearer token. Permission: `screen.view`.

Parameters:

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `kind` | path | string | yes | `screen`, `playlist`, `schedule`, `layout`, `creative`, `app`, `media`, `signage`, `data-source`, `banner` or `media-folder`. |
| `id` | path | string | yes | The deleted item's id. |

```bash
curl -X POST "https://api.brixsignage.com/v1/recycle-bin/{kind}/{id}/purge" \
  -H "Authorization: Bearer $BRIX_API_KEY"
```

Response 200: Success.

| Field | Type | Description |
| --- | --- | --- |
| `data` | object |  |
| `data.id` | string |  |
| `data.kind` | string |  |
| `data.purged` | true |  |

Response 401: Missing, expired or revoked bearer token.

Response 403: You lack the kind's delete permission (`playlist.delete`, …) where the item lives.

Response 404: No such item in the recycle bin.

Response 422: Unknown `kind`.

Response 502: A stored file could not be removed; nothing was deleted.

Response 5XX: Server error. The body carries a `requestId` to quote to support.
