API operation · files group
PATCH
/protected-folders/{id}
First published 4 Nov 2026
0.2.24Unchanged since publicationChange the directory listing setting for a protected folder
Who may call it
AdministratorResellerCustomer
Token scope, any of
filesallAnswers200 OK
Set list_files to true to let Apache list files for authenticated visitors when the folder has no index page. Set it to false to make Apache return 403 Forbidden in that case. Directory listing is enabled by default when a folder is first protected. A site that uses the folder as its document root applies its own directory listing setting.
UrbeStack regenerates the affected virtual host configurations and reloads Apache immediately. The response includes the updated protected folder in folder. The API returns 400 if list_files is missing or null or if id is invalid. It returns 404 if the protected folder does not exist.
As a command
Run as root on the serverParameters
idpath ·integer, 1 or moreRequiredProtected folder ID returned by GET /protected-folders.
list_filesbooleanRequiredExample
See the API overview for how to set $API and $TOKEN.Request
curl -sS -X PATCH "$API/protected-folders/1" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"list_files": true
}'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
11 errors, each a status and a sentence400--list-files and --no-list-files exclude each other400--path is required400--user is required400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Nothing to change: give --list-files or --no-list-files400Nothing to change: give list_files400The folder id is a number400Username '<value>' is reserved401Authentication required404No protected folder <id>404User '<user>' not foundNo error of this operation matches.
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.2.24 on 4 Nov 2026.
urbestack.com/docs/api/patch-protected-folders-id/