> 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/recycle-bin)

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

Supports all [global flags](/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`.

**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`). |

**Example**

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

**Corresponds to**: [`GET /v1/recycleBinTTL`](https://developer.celigo.com/api/api-reference/recycle-bin)

***

## `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.

**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/recycle-bin). The CLI reads the bin index and returns the matching entry's 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, or pipe via stdin. Generic resources only.                                                                                         |

**Request body**

Optional. Reads JSON from `--file` or stdin, and is forwarded to the restore endpoint.

**Example**

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

**Corresponds to**: [`POST /v1/recycleBinTTL/{_resourceType}/{_id}`](https://developer.celigo.com/api/api-reference/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.

**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/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.
* **`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](/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.
* **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` and `--file` do not apply, and a folder's contents restore with it automatically. See [storage](/cli/commands/storage.md).

## Related

* [flows](/cli/commands/flows.md) — a common resource type to restore.
* [connections](/cli/commands/connections.md) — restore deleted credentials and their dependents.
* [storage](/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
