API operation · files group
POST
/files/{user}/trash/restore
First published 14 Oct 2026
0.2.0Unchanged since publicationRestore entries from the Trash to their original directories
Who may call it
AdministratorResellerCustomer
Token scope, any of
filesallAnswers200 OK
Give 1 to 1000 Trash paths in paths. Use the paths returned by GET /files/{user}/trash. UrbeStack restores entries using the customer's permissions and recreates missing original directories. If the original name is taken, UrbeStack restores the entry under a numbered name.
The API returns 400 for an invalid list, a missing path, a path that lacks the leading / or contains a control character or a .. component, a path over 4096 characters, or a component over 255 characters. It also returns 400 if user identifies an administrator.
As a command
Run as root on the serverParameters
userpath ·UsernameRequiredUsername of the customer whose Trash entries to restore. Administrators can select any customer, and customers can select only themselves.
pathsarray of HomePathRequiredExample
See the API overview for how to set $API and $TOKEN.Request
curl -sS -X POST "$API/files/alice/trash/restore" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paths": [
"text"
]
}'Response ·
200 OK{
"count": 1,
"restored": [
{
"from": "text",
"to": "text"
}
]
}Errors
15 errors, each a status and a sentence400--path is required400--user is required400<name> is an administrator: administrators have no home400<what> climbs out of the home with ..400<what> has a name over 255 characters400<what> holds a control character400<what> is required400<what> is too long400<what> may hold at most 1000 paths400<what> must be a list of at least one path400<what> must start with /, which is the home400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Nothing to restore400Username '<value>' is reserved401Authentication requiredNo error of this operation matches.
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/post-files-user-trash-restore/