Get your free beta license ↗
API operation · files group
GET

/files/{user}/trash

First published 14 Oct 20260.2.0Unchanged since publication

List the entries in the customer's Trash

Who may call it
AdministratorResellerCustomer
Token scope, any of
filesreadall
Answers200 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

Run as root on the server

Parameters

userpath ·UsernameRequired
Username of the customer whose entries to move to the Trash. Administrators can select any customer, and customers can select only themselves.

Example

See the API overview for how to set $API and $TOKEN.
Request
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

5 errors, each a status and a sentence
400--user is required
400<name> is an administrator: administrators have no home
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Username '<value>' is reserved
401Authentication required
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.2.0 on 14 Oct 2026.
urbestack.com/docs/api/get-files-user-trash/