# History and Recently Deleted

> Find and reopen requests you sent with the API client's History, and restore deleted collections, folders, requests, environments and datasets within 30 days.

Source: https://docs.subcloak.com/cloak-proxy/api-client/history-and-recently-deleted/

Two safety nets keep work from getting lost. **History** records every request you send, so you can go back to a call you made an hour ago even if you changed or never saved the request. **Recently Deleted** keeps deleted collections, folders, requests, environments and datasets for 30 days so you can put them back where they were.

## History

*[Screenshot: The History sidebar with a Clear button, a Filter field, and a long list of GET requests to a local pets URL under the date 14 Oct 2026, each with status 200, duration and time. History groups sent requests by day, newest first.]*

Click **History** in the rail. Each time you send a request from its editor or the sidebar, an entry is added with:

- The method badge.
- The URL as it was sent, with variables filled in. Hover over it to see the URL as written.
- The status code, or "Error" if the request couldn't be sent, then the duration and the time. Errors and statuses of 400 and above are shown in red.

| Action | How |
|---|---|
| Reopen a request | Click the entry. A copy of the request, as it was when you sent it, opens in a new unsaved tab. Use its **Save** menu to keep it. |
| Open in a new tab | Right-click › **Open in New Tab**. Same as clicking. |
| Find a request | Type in **Filter**. It matches the URL as written, the URL as sent, and the request name. |
| Delete one entry | Right-click › **Delete**. |
| Delete all entries | **Clear** at the top of the sidebar. |

History keeps the 300 most recent sends. It's stored in `.cloak/history.json` in the workspace folder, which Git ignores, so it stays on your Mac. Requests run by the collection runner, monitors, flows and Agent Mode's `run_collection` aren't added to History. Requests the agent sends with `run_request` are, since it sends them the same way you do.

> **History holds what you sent:**
> Each entry keeps a full copy of the request, including headers and auth fields as they were when you sent it, in `.cloak/history.json`. Deleted History entries don't go to Recently Deleted.

## Recently Deleted

When you delete something in the API client, it goes to Recently Deleted instead of disappearing.

*[Screenshot: The Recently Deleted tab listing a request deleted from Petstore, an environment called Old staging and a collection called Legacy v0 API, each with a Restore button and a delete button. Each deleted item shows what it was, where it came from and how long it will be kept.]*

### What's kept

| Deleted from | Kept |
|---|---|
| A collection (**Delete** in its menu) | The whole collection: folders, requests, examples, docs, auth, scripts, variables and branding. |
| A folder | The folder and everything in it. |
| A request | The request, with its examples and docs. |
| An environment | The environment and its variables. |
| A dataset | The dataset's columns and rows. |

Specs, flows, packages, monitors and History entries are deleted immediately and don't come here.

### Open Recently Deleted

When anything is in it, a **Recently Deleted (n)** button appears at the bottom of the sidebar in the **Collections**, **Environments** and **Datasets** sections. Click it to open the list.

Each item shows its kind, the collection it came from (for folders and requests), how long ago it was deleted, and how many days are left before it's removed. Items are removed automatically 30 days after deletion.

### Restore an item

1. Open **Recently Deleted**.
2. Click **Restore** next to the item.
3. The item goes back and the client shows it:
   - A **request** or **folder** goes back into its folder if that folder still exists, or the collection's top level if not. If its collection was deleted too, a new collection with the old collection's name is created for it. A restored request opens in a tab.
   - A **collection** is added back to the sidebar and opens. If a collection with the same ID already exists (for example, you restored it before), the copy gets a new ID.
   - An **environment** is added back to the Environments section. It isn't made active.
   - A **dataset** is added back. If one with the same name exists, the restored one is named "… (restored)".

### Delete permanently

- The **×** next to an item deletes it forever.
- **Empty** deletes everything in Recently Deleted forever.

Neither asks for confirmation.

> **Permanent deletion can't be undone:**
> Once an item is removed from Recently Deleted, by you or after 30 days, the app can't bring it back. If your workspace is in Git, a version from an earlier commit may still be recoverable with Git.

### Where it's stored

Recently Deleted is saved in `.cloak/trash.json` in the workspace folder, readable only by your macOS user. `.cloak/` is git-ignored, so deleted items, including their secret values, stay on your Mac and aren't shared with teammates. A teammate who pulls your deletion sees the item gone and can't restore it from their own Recently Deleted.

`cloakctl` and the [MCP server](https://docs.subcloak.com/cloak-proxy/automation/mcp-server/) use the same Recently Deleted: an AI assistant that deletes a collection through MCP leaves it here for 30 days.

## Related

  - [Workspace and Git](https://docs.subcloak.com/cloak-proxy/api-client/workspace-and-git/): What's in .cloak/ and what Git sees.
  - [Collections and requests](https://docs.subcloak.com/cloak-proxy/api-client/collections-and-requests/): Organize, duplicate and delete items.
  - [Variables and environments](https://docs.subcloak.com/cloak-proxy/api-client/variables-and-environments/): Environments you can restore.
  - [Datasets and data files](https://docs.subcloak.com/cloak-proxy/api-client/run/datasets-and-data-files/): Datasets you can restore.
