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

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

First published 4 Nov 20260.2.24Unchanged since publication

Update a user in a protected folder

Who may call it
AdministratorResellerCustomer
Token scope, any of
filesall
Answers200 OK

Supply at least one of password, a different username, enabled, or expires_at. The API ignores null values for password, username, and enabled. A new username must be unused in the folder. Usernames must be 1 to 64 characters, begin with an ASCII letter or digit, and contain only ASCII letters, digits, dots, underscores, hyphens, @, and +. A new password must contain 8 to 128 printable ASCII characters.

Set enabled to false to suspend access while retaining the username and password. Set enabled to true to enable the user. To restore access for an expired user, set a new end time or clear it, and enable the user if suspended.

Set expires_at to a valid future UTC timestamp in the format 2026-11-04T09:30:00Z. Apache uses its own clock to end access at that minute. Pass null or an empty string to clear the end time.

UrbeStack reloads Apache and 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 if the request supplies no changes or contains an invalid folder ID, username format, password, or end time. 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
The protected folder ID returned by the listing.
usernamepath ·ProtectedUsernameRequired
The username of the protected folder user to remove.

Request body

JSON ·ProtectedUserPatch· 4 fields
enabledboolean
Set to false to suspend the user or true to lift the suspension.
expires_atstring, matching ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$ or null
Future UTC time at which access expires. Set to null to clear the expiration.
passwordstring, up to 128 characters
New username. Renaming alone preserves the current password.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X PATCH "$API/protected-folders/1/users/text" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "expires_at": "2026-09-16T10:15:00Z",
    "password": "Sup3r-Secret-Passphrase",
    "username": "text"
  }'
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

21 errors, each a status and a sentence
400--<_> is required
400--enable and --disable exclude each other
400--expires-at and --no-end exclude each other
400--user is required
400Invalid password: 8 to 128 printable characters
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Nothing to change: give a password, a new name, enabled or expires_at
400Nothing to change: give a password, a new name, the switch or an end time
400The access end date (<value>) is in the past.
400The folder id is a number
400The password must be 8\x{2013}128 characters using letters, numbers, or punctuation (no accented characters).
400The username must be 1\x{2013}64 characters, start with a letter or number, and contain only letters, numbers, dots, underscores, hyphens, @ or +.
400Username '<value>' is reserved
400expires_at has passed already: <t>
400expires_at is a UTC time spelled as 2026-11-04T09:30:00Z
400expires_at is not a day the calendar has: <t>
401Authentication required
404<username> is not a user of <f.path>
404No protected folder <id>
404User '<user>' not found
409<new> is already a user of <f.path>
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-users-username/