> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/recycle-bin.md).

# recycle-bin

Browse and restore soft-deleted resources held in the recycle bin (TTL). Deleted resources are retained for a limited window before permanent removal.

**REST API**: [Recycle Bin](https://developer.celigo.com/api/api-reference/account-and-admin/recycle-bin)

```
celigo recycle-bin <subcommand> [args] [flags]
```

Supports all [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md).

## Subcommands

| Subcommand     | Purpose                                                                 |
| -------------- | ----------------------------------------------------------------------- |
| `list`         | List recycle bin entries (all, or one resource type with `--type`).     |
| `get <id>`     | Show a single soft-deleted entry by ID.                                 |
| `restore <id>` | Restore a soft-deleted resource (`--cascade` also restores dependents). |
| `purge <id>`   | Permanently delete a resource from the recycle bin.                     |

***

## `celigo recycle-bin list`

List recycle bin entries. By default lists every entry in the account; pass `--type` to filter to a single resource type (for example `flows`, `exports`, `connections`).

Output columns: `model`, `_id`, `name`. `model` is the resource kind the entry belongs to, such as `Flow`, `McpServer`, or `StorageItem`.

The JSON output is the listing as the API returns it: the untyped listing is an array of `{model, doc}` entries, and a typed listing is an array of the deleted documents themselves. Since celigo-cli 2026.10.1:

* `--type` takes the spelling you have at hand: the plural API type (`flows`, `lookupcaches`), a singular (`flow`), a kebab-case command-group name (`lookup-caches`, `on-premise-agents`, `storage`, and since celigo-cli 2026.11.2 [`on-premise-agent-groups`](https://developer.celigo.com/cli/commands/on-premise-agent-groups.md)), or the `model` this listing prints (`Flow`, `StorageItem`). The CLI sends the type as the API spells it. Until then only the API's own spelling worked, and any other met the platform's `403`.
* A typed listing fills the table (it printed blank rows); its `model` column shows the API type the listing was asked for.
* `--type storageitems` (or `storage`) follows the listing's `Link` header to the last page — it read only the first page of up to 1,000 items — and its JSON output is the bare item array, like every other typed listing. It used to be `[{"items": […]}]`; a script that read `.[0].items` must now read the array itself.
* `--jq` is evaluated against the full JSON output under `--format table` too.

**Signature**

```bash
celigo recycle-bin list [flags]
```

**Flags**

| Flag                    | Type   | Default | Description                                                                                                                                        |
| ----------------------- | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--type <resourceType>` | string | —       | Filter to a single resource type (e.g. `flows`, `exports`, `connections`). Plural, singular, kebab-case group names, and model names are accepted. |

**Example**

```bash
celigo recycle-bin list --format table
celigo recycle-bin list --type flows
celigo recycle-bin list --type lookup-caches --format table

# Deleted Celigo Storage items, every page
celigo recycle-bin list --type storage --jq '.[] | {_id, name}'
```

**Corresponds to**: [`GET /v1/recycleBinTTL`](https://developer.celigo.com/api/api-reference/account-and-admin/recycle-bin), or `GET /v1/recycleBinTTL/{_resourceType}` with `--type`.

***

## `celigo recycle-bin get`

Show a single soft-deleted entry by ID. You do not supply the resource type — the CLI reads the bin index and finds the entry. Since celigo-cli 2026.10.1 it prints the deleted resource's full document, read from the bin's per-resource route; the listing's copy it printed before is abridged (a script's `content` is left out, for example). A Celigo Storage item has no per-resource route, so its listing copy is printed.

**Signature**

```bash
celigo recycle-bin get <id>
```

**Arguments**

| Argument | Type   | Required | Description                      |
| -------- | ------ | -------- | -------------------------------- |
| `<id>`   | string | Yes      | ID of the soft-deleted resource. |

**Example**

```bash
celigo recycle-bin get 5f83a9b2c7d3e8f1a2b3c4d5
```

**Corresponds to**: [`GET /v1/recycleBinTTL`](https://developer.celigo.com/api/api-reference/account-and-admin/recycle-bin) to find the entry, then `GET /v1/recycleBinTTL/{_resourceType}/{_id}` for the document. An ID that is not in the bin fails with a message saying it may not be deleted, or that its retention window expired.

***

## `celigo recycle-bin restore`

Restore a single soft-deleted resource. The resource type is detected from the bin entry, so the ID is the only argument. Pass `--cascade` to also restore the resource's dependents — for example, a flow along with the exports, imports, and connections it references.

**Signature**

```bash
celigo recycle-bin restore <id> [flags]
```

**Arguments**

| Argument | Type   | Required | Description                      |
| -------- | ------ | -------- | -------------------------------- |
| `<id>`   | string | Yes      | ID of the soft-deleted resource. |

**Flags**

| Flag                | Type    | Default | Description                                                                                                                                                                                       |
| ------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--cascade`         | boolean | `false` | Also restore the resource's dependents. Generic resources only — it has no effect on a Celigo Storage item, whose folder restores cascade already.                                                |
| `-f, --file <path>` | string  | —       | JSON body file (`-f -` reads stdin). A Celigo Storage item takes `{"name": "<new name>"}` to restore under a new name when a live item has taken its old one; the generic routes ignore any body. |

**Request body**

Optional, and read only when `-f` is given; it must be a JSON object. Since celigo-cli 2026.10.1 a storage item's restore sends it — `{"name": "orders-2026-restored.csv"}` resolves a name clash — where the file used to be ignored.

**Output**

Since celigo-cli 2026.10.1 the command reports what it restored — `Restored flow 5f83a9b2c7d3e8f1a2b3c4d5.`, or with `--cascade` `Restored flow 5f83a9b2c7d3e8f1a2b3c4d5 and its dependents.` — instead of printing `null` for the generic routes' empty reply. A storage item's restore prints the item the API returns.

**Example**

```bash
celigo recycle-bin restore 5f83a9b2c7d3e8f1a2b3c4d5
celigo recycle-bin restore 5f83a9b2c7d3e8f1a2b3c4d5 --cascade

# A storage item whose name a live item has taken
echo '{"name": "orders-2026-restored.csv"}' > restore.json
celigo recycle-bin restore 6a1b2c3d4e5f6a7b8c9d0e1f -f restore.json
```

**Corresponds to**: [`POST /v1/recycleBinTTL/{_resourceType}/{_id}`](https://developer.celigo.com/api/api-reference/account-and-admin/recycle-bin), or `.../doCascadeRestore` with `--cascade`. A Celigo Storage item routes to `POST /v1/storage/items/{_id}/restore` instead.

**Required**: `full` mode — restoring a resource is a structural change.

***

## `celigo recycle-bin purge`

Permanently delete a resource from the recycle bin. This is irreversible — the resource can no longer be restored afterward. Prompts for confirmation unless `-y` is passed.

> ⚠️ **Purging is permanent.** The resource is removed from the recycle bin and can no longer be restored. Entries also age out automatically after the retention window.

An integration's system storage folder cannot be purged by itself: the platform refuses it with `403` "System items cannot be modified or deleted". The folder goes to the bin when its integration is deleted, and it leaves the bin when that integration is purged.

**Signature**

```bash
celigo recycle-bin purge <id> [flags]
```

**Arguments**

| Argument | Type   | Required | Description                      |
| -------- | ------ | -------- | -------------------------------- |
| `<id>`   | string | Yes      | ID of the soft-deleted resource. |

**Flags**

| Flag        | Type    | Default | Description        |
| ----------- | ------- | ------- | ------------------ |
| `-y, --yes` | boolean | `false` | Skip confirmation. |

**Example**

```bash
celigo recycle-bin purge 5f83a9b2c7d3e8f1a2b3c4d5 -y
```

**Corresponds to**: [`DELETE /v1/recycleBinTTL/{_resourceType}/{_id}`](https://developer.celigo.com/api/api-reference/account-and-admin/recycle-bin). A Celigo Storage item routes to `DELETE /v1/storage/items/{_id}/purge` instead.

**Required**: `full` mode.

***

## Gotchas

* **`get`, `restore`, and `purge` take an ID alone.** You do not pass a resource type. Each command reads the bin index, finds the entry, and routes on its `model`. Run `list` first if you need to find the ID. Since celigo-cli 2026.10.1 an entry whose `model` is missing or could change the request path is refused instead of routed: `The recycle-bin entry for id <id> carries no usable model name, so its resource type cannot be routed.`
* **`list --type storageitems` JSON changed shape.** Since celigo-cli 2026.10.1 it is the bare item array — every page of it — like the other typed listings, not `[{"items": […]}]`. Update scripts that parse it.
* **`list` output is not projected.** Every row is the soft-deleted document itself, so the response carries complete records regardless of the `--fields` default described in [Global flags](https://developer.celigo.com/cli/getting-started/global-flags.md).
* **`purge` is permanent.** Once a resource is purged it cannot be restored. Entries also age out automatically after the retention window. An integration's system storage folder is purged with its integration; purging the folder by itself answers `403`.
* **`get` tells a deleted resource from an id that never existed.** The platform answers a group's `delete` with the same recycle-bin message for a resource already in the bin and for an id the account never had. Since celigo-cli 2026.10.1 the CLI says so and points at `celigo recycle-bin get <id>`, which finds an entry only for a deleted resource; a group's `get` of a deleted resource hints at `recycle-bin list` and `restore`.
* **Use `restore --cascade` for resources with dependents.** Restoring a flow alone may leave it broken if its exports, imports, or connections were deleted too. `--cascade` brings the dependents back with it.
* **Celigo Storage items take a different path.** A deleted storage item appears in the bin with `model: StorageItem` and routes to the item-scoped storage endpoints rather than the generic ones. `--cascade` does not apply, and a folder's contents restore with it automatically. `-f` supplies the `{"name": …}` body that restores an item under a new name when a live item has taken its old one (since celigo-cli 2026.10.1). Since celigo-cli 2026.11.2, `get`, `restore`, and `purge` also find a deleted storage item that the all-types listing leaves out: that listing holds only the newest 1,000 storage items, so the commands read the paged storage listing before they report an id as not in the bin. See [storage](https://developer.celigo.com/cli/commands/storage.md).

## Related

* [flows](https://developer.celigo.com/cli/commands/flows.md) — a common resource type to restore.
* [connections](https://developer.celigo.com/cli/commands/connections.md) — restore deleted credentials and their dependents.
* [storage](https://developer.celigo.com/cli/commands/storage.md) — `storage delete` soft-deletes to this bin, and storage items restore through their own endpoints.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.celigo.com/cli/commands/recycle-bin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
