/files/{user}
0.1.0Unchanged since publicationList the entries in a directory in a customer's home
filesreadallThe listing puts directories first. Each entry includes its size, modification time, mode, and owner. Symbolic link entries also include the target and indicate whether it is inside the home directory. The listing includes links that resolve outside the home directory without following them.
All /files operations use the named customer's account, with the same filesystem permissions as SFTP. In API paths, / represents /home/<user>/files. The API ignores repeated slashes and . components. It returns 400 for a missing required path, a path without a leading /, a .. component, a control character, a path longer than 4096 characters, or a component longer than 255 characters. Specifying an administrator's account as the target also returns 400 because administrator accounts lack a customer home directory.
The response field limit_mb reports the maximum file size set by files.upload_limit_mb, in MB. This limit applies to file contents transferred as JSON and to raw uploads. GET /files/{user}/download streams bytes without a size limit.
As a command
Run as root on the serverParameters
Example
See the API overview for how to set $API and $TOKEN.curl -sS -X GET "$API/files/alice?path=public_html/index.php" \ -H "Authorization: Bearer $TOKEN"
200 OK{
"entries": [
{
"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"
}
],
"limit_mb": 1,
"path": "public_html/index.php",
"total": 1,
"truncated": true,
"user": "alice"
}Errors
11 errors, each a status and a sentence400--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> must start with /, which is the home400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Username '<value>' is reserved401Authentication requiredurbestack.com/docs/api/get-files-user/