Get your free beta license ↗
API operation · files group
PATCH

/protected-folders/{id}

First published 4 Nov 20260.2.24Unchanged since publication

Change the directory listing setting for a protected folder

Who may call it
AdministratorResellerCustomer
Token scope, any of
filesall
Answers200 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 server

Parameters

idpath ·integer, 1 or moreRequired
Protected folder ID returned by GET /protected-folders.

Request body

JSON ·ProtectedFolderPatch· 1 field
list_filesbooleanRequired

Example

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 sentence
400--list-files and --no-list-files exclude each other
400--path is required
400--user is required
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Nothing to change: give --list-files or --no-list-files
400Nothing to change: give list_files
400The folder id is a number
400Username '<value>' is reserved
401Authentication required
404No protected folder <id>
404User '<user>' not found
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/