# DELETE /protected-folders/{id}/users/{username}

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

UrbeStack release 0.2.35 API operation in the files group.

Remove a user from a protected folder

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

UrbeStack reloads Apache and the removed user loses access immediately. If you remove the last user, Apache still prompts for credentials and denies access. The API returns 200 with the updated protected folder in the folder field.

The caller must be signed in, have permission to act on the folder owner's account, and use a token with the files scope. The API returns 400 for an invalid folder ID or username format, and 404 if the protected folder does not exist.

## As a command

- [urbestack-protected-user-del](https://urbestack.com/docs/commands/urbestack-protected-user-del.md): Removes the user named by --name from a protected folder and reloads Apache.

## Parameters

- `id` (path, integer, 1 or more, required): The protected folder ID returned by the listing.
- `username` (path, ProtectedUsername, required): The username of the protected folder user to remove.

## 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 DELETE "$API/protected-folders/1/users/text" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "folder": {
    "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: --<_> is required
- 400: --user is required
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: The folder id is a number
- 400: The username must be 1\x{2013}64 characters, start with a letter or number, and contain only letters, numbers, dots, underscores, hyphens, @ or +.
- 400: Username '<value>' is reserved
- 401: Authentication required
- 404: <username> is not a user of <f.path>
- 404: No protected folder <id>
- 404: User '<user>' not found
