# GET /protected-folders

First published 4 Nov 2026 (release 0.2.24) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the files group.

List an account's password-protected folders

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

Each folder includes its path, creation time, directory listing setting, and whether it exists on disk. The response gives the domain and folder URL for each site that serves the folder.

For each folder user, the response includes the username, whether the user is enabled, when access expires, whether it has expired, and the recorded creation and update times. The listing omits passwords and password hashes. The API returns 400 if the selected account is an administrator.

## As a command

- [urbestack-protected-list](https://urbestack.com/docs/commands/urbestack-protected-list.md): Lists password-protected folders for a customer or reseller.

## Parameters

- `user` (query, Username): Username of the customer whose protected folders to list. Administrators can select any customer, and resellers can select one of their customers. The default is the caller's username.

## 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/protected-folders?user=alice" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "folders": [
    {
      "created_at": "2026-09-09T10:15:00Z",
      "exists": true,
      "id": 1,
      "list_files": true,
      "path": "public_html/index.php",
      "sites": [
        {
          "domain": "example.com",
          "url": "text"
        }
      ],
      "users": [
        {
          "created_at": "2026-09-09T10:15:00Z",
          "enabled": true,
          "ended": true,
          "expires_at": "2026-09-16T10:15:00Z",
          "updated_at": "text",
          "username": "text"
        }
      ]
    }
  ]
}
```

## Errors

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