---
title: "List the trash"
method: GET
path: "/v2/trash"
tags: ["Trash"]
---

# List the trash

`GET /v2/trash`

## Request

- Base URL: `https://api.codepen.io`
- URL: `https://api.codepen.io/v2/trash`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

The key owner's Pens and Collections in the trash, newest deletion
first. Each is restorable until `expires_at`, three days after
deletion.

## Query parameters

- `page` integer
- `per_page` integer
- `sort` 'created' | 'updated'
- `direction` 'asc' | 'desc'

## Response `200`

A page of trash items.

- TrashItem[]
  - `deleted_at` string, date-time, required
  - `expires_at` string, date-time, required
  - `id` string, required
  - `item_id` string, required: The Pen's or Collection's id, for the restore endpoints.
  - `title` string, required
  - `type` 'Pen' | 'Collection', required

## Other responses

- `400`: `BAD_USER_INPUT`: an invalid parameter, body, path, setting, access level or role. `field` names the argument when known, and `details` carries structured detail (the misses of `PATCH /v2/pens/{id}/files`).
- `401`: `UNAUTHENTICATED`: a missing or invalid key, a deleted owner, or a Team key for a Team that is not PRO.
- `429`: `RATE_LIMITED`: the owner exceeded the plan's requests in an hour, its reads today, or today's allowance of Pen or Collection creates. No `Retry-After` or rate-limit headers are sent; the body carries `retry_after_seconds`, `limit` and `reset_at`.
- `500`: `INTERNAL`: unexpected, and reported; the message is generic.

---

[API](https://skmtc.dev/codepen/apis/codepen-api.md) - [All operations](https://skmtc.dev/codepen/apis/codepen-api/llms.txt) - [OpenAPI document](https://skmtc.dev/codepen/apis/codepen-api/revisions/108fe91e3ef5?raw)
