# DELETE /protected-folders/{id}

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

UrbeStack release 0.2.35 API operation in the files group.

Remove HTTP Basic authentication from a protected folder

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

UrbeStack deletes the folder users and retains the directory and its files. It regenerates the affected virtual host configurations and reloads Apache immediately. The response includes path and deleted.

The API returns 400 if id is invalid and 404 if the protected folder does not exist.

## As a command

- [urbestack-protected-folder-del](https://urbestack.com/docs/commands/urbestack-protected-folder-del.md): Removes HTTP Basic authentication from a protected folder and deletes its folder users.

## Parameters

- `id` (path, integer, 1 or more, required): Protected folder ID returned by GET /protected-folders.

## 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" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "deleted": true,
  "path": "public_html/index.php"
}
```

## Errors

- 400: --path 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: Username '<value>' is reserved
- 401: Authentication required
- 404: No protected folder <id>
- 404: User '<user>' not found
