# GET /files/{user}

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the files group.

List the entries in a directory in a customer's home

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

The 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

- [urbestack-file-list](https://urbestack.com/docs/commands/urbestack-file-list.md): Lists the entries in a directory of a customer's home, with directories first.

## Parameters

- `user` (path, Username, required): Username of the customer who owns the home directory. Administrators can specify any customer, and customers can specify only themselves.
- `path` (query, HomePath): Directory path starting with /. Defaults to /, the customer's home directory.

## 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?path=public_html/index.php" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 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

- 400: --user is required
- 400: <name> is an administrator: administrators have no home
- 400: <what> climbs out of the home with ..
- 400: <what> has a name over 255 characters
- 400: <what> holds a control character
- 400: <what> is required
- 400: <what> is too long
- 400: <what> must start with /, which is the home
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Username '<value>' is reserved
- 401: Authentication required
