# GET /files/{user}/trash

First published 14 Oct 2026 (release 0.2.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the files group.

List the entries in the customer's Trash

- Who may call it: administrator, reseller, customer
- Token scope, any of: files, read, all
- Answers: 200 OK

UrbeStack lists entries using the customer's permissions, newest deletion day first. Each entry includes its Trash path, name, original location, and deletion date. The response also includes the retention period in days and the Trash's disk usage if UrbeStack can measure it within a few seconds. The API returns 400 if user identifies an administrator.

The Trash is an ordinary directory at /.trash in the customer's home. Its directory layout stores all Trash metadata. In /.trash/DAY/WHERE/NAME, DAY is the deletion date, WHERE is the original parent directory's full path encoded as one component, and NAME is the entry's name. In WHERE, / becomes %2F and % becomes %25. The home directory itself is encoded as %2F. If a second entry with the same name is deleted from the same directory on the same day, it goes under WHERE%~2.

Nightly cleanup permanently deletes entries whose deletion day is older than files.trash_days. Trashed entries count toward the account's disk usage until they are deleted. Backups exclude the Trash.

## As a command

- [urbestack-file-trash-list](https://urbestack.com/docs/commands/urbestack-file-trash-list.md): Lists all entries in the customer's Trash using the customer's permissions, newest deletion day first.

## Parameters

- `user` (path, Username, required): Username of the customer whose entries to move to the Trash. Administrators can select any customer, and customers can select only themselves.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X GET "$API/files/alice/trash" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "bytes": 1,
  "count": 1,
  "items": [
    {
      "day": "2026-09-09",
      "inside": true,
      "mode": "text",
      "modified": "text",
      "name": "alice",
      "owner": "text",
      "path": "public_html/index.php",
      "size": 1,
      "target": "https://example.com/new",
      "target_type": "dir",
      "text": true,
      "type": "dir",
      "was_in": "text"
    }
  ],
  "keep_days": 1,
  "truncated": true,
  "user": "alice"
}
```

## Errors

- 400: --user is required
- 400: <name> is an administrator: administrators have no home
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Username '<value>' is reserved
- 401: Authentication required
