---
title: "List trashed items"
method: GET
path: "/workspaces/{workspace_id}/projects/{project_id}/trash"
tags: ["Trash"]
---

# List trashed items

`GET /workspaces/{workspace_id}/projects/{project_id}/trash`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/projects/{project_id}/trash`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Returns dataviews and datasets that are currently in trash. Cascade-trashed children share their parent's cascade_trash_event_id so the FE can group rows for display.

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.
- `project_id` integer, required

## Query parameters

- `type` string[], nullable: Filter the trash listing by one or more resource types. Omit to return all. Allowed values: dataview, dataset, dashboard, automation, and 'data' (the data-library bucket = datasets + their dataviews). Repeat the param to select multiple.
- `sort` string: Sort by name, trashed_at, or size. The 'expires' UX axis is expressed as trashed_at with asc=soonest / desc=latest, since expires_at = trashed_at + retention is a fixed offset.
- `order` string: asc or desc
- `limit` integer: Page size, default 50, max 500. Cap is high enough to let the FE fetch everything in one shot for client-side filter/sort mode (toggled via TRASH_USE_SERVER_SIDE in trash.vue) — trash is retention-bounded so 500 covers virtually every project.
- `offset` integer: Number of items to skip.
- `q` string, nullable: Substring match on item name (case-insensitive). Empty / whitespace is treated as no filter.
- `trashed_by` integer[], nullable: Restrict to items trashed by any of these users.
- `trashed_after` string, date-time, nullable: ISO timestamp lower bound on trashed_at (inclusive). FE computes from local calendar-day boundaries so 'Today' / 'This week' / 'Older' buckets line up with what the user sees in the row's TRASHED cell. Server treats whatever it receives as UTC.
- `trashed_before` string, date-time, nullable: ISO timestamp upper bound on trashed_at (exclusive). Pair with trashed_after for closed-open windows.
- `expiring_within_days` integer, nullable: Restrict to items whose remaining retention is ≤ N days. Server computes trashed_at <= NOW() - (retention - N) days. Powers the 'Expiring in ≤7 days' filter.
- `folder_path` string[], nullable: Restrict the listing to datasets (and their dataviews) whose location-at-trash-time folder chain (trashed_folder_path) equals these names, outermost-first. Matches by name chain so it works even when the original folder has since been deleted. Dashboards and automations are excluded when set — they don't live in folders. Repeat the param to pass each level.
- `folder_root` boolean: Restrict to datasets (and their dataviews) that were at the project root (Data Library) at trash time — i.e. an empty trashed_folder_path. The root counterpart of folder_path; pass one or the other. Dashboards/automations are excluded when set.

## Response `200`

Request fulfilled, document follows

- TrashList
  - `items` TrashItem[], required
    - `id` integer, required
    - `type` 'dataview' | 'dataset' | 'dashboard' | 'automation', required
    - `name` string, nullable
    - `project_id` integer, nullable
    - `dataset_id` integer, nullable: Parent dataset id; only present for dataview rows.
    - `trashed_at` string, date-time, nullable
    - `trashed_by` TrashedByUser
      - `id` integer, required
      - `name` string, nullable
    - `days_until_purge` integer, nullable: Days remaining before auto-purge. Null when retention is disabled.
    - `cascade_trash_event_id` string, uuid, nullable
    - `folder_resource_id` integer, nullable: Resource id of the folder to route to. Null at project root, or when the original folder was moved/deleted (no intact location).
    - `original_folder_path` string[]: Folder names of the item's location at trash time (outermost-first), from the trashed_folder_path snapshot. Empty at project root.
    - `task_count` integer, nullable: For dataview rows: total pipeline tasks + action triggers. Null for dataset rows.
    - `additional_info` object: Type-specific extra metadata. Dataset: {size_in_bytes, total_size_in_bytes}. Dataview: {size_in_bytes, exports}. Future types add their own keys without schema churn.
    - `is_context_match` boolean: True for parent-dataset rows that didn't match the active filter but were pulled in so the FE can render the cascade-tree grouping (a matching dataview nested under its parent). The FE auto-expands these and shows only the matched children, instead of treating them as direct matches.
    - `is_active_parent` boolean: True for synthetic parent-dataset rows whose dataset is NOT trashed but has trashed child dataviews. Sent so the FE can group standalone-trashed views under their parent for legibility (cleaner than a flat list of orphan view rows each with `· in {parent}` suffix). FE renders these as read-only context: no checkbox, no actions, muted icon.
  - `limit` integer, required
  - `offset` integer, required
  - `total` integer, required
  - `dataset_count` integer
  - `dataview_count` integer
  - `dashboard_count` integer
  - `automation_count` integer
  - `total_dataset_count` integer
  - `total_dataview_count` integer
  - `total_dashboard_count` integer
  - `total_automation_count` integer
  - `total_size_in_bytes` integer
  - `retention_days` integer
  - `next` string, nullable

## Other responses

- `400`: Bad request syntax or unsupported method

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/fe078afe239b?raw)
