/protected-folders/{id}/users
0.2.24Unchanged since publicationAdd a user to a protected folder
filesallThe username must be unique within the folder. It must be 1 to 64 characters, begin with an ASCII letter or digit, and contain only ASCII letters, digits, dots, underscores, hyphens, @, and +. The password must contain 8 to 128 printable ASCII characters. UrbeStack hashes it the same way it hashes a system password.
The user starts enabled. Omit expires_at or pass null or an empty string to leave access open-ended. To set an end time, pass a valid future UTC timestamp in the format 2026-11-04T09:30:00Z. Apache uses its own clock to end access at that minute. The user stays listed as ended until you set a new end time, clear it, or remove the user.
UrbeStack reloads Apache immediately and returns 201 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, username format, password, or end time, and 404 if the protected folder does not exist.
As a command
Run as root on the serverParameters
idpath ·integer, 1 or moreRequiredpasswordstring, up to 128 charactersRequiredusernameProtectedUsernameRequiredexpires_atstring, matching ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$ or nullExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/protected-folders/1/users" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"expires_at": "2026-09-16T10:15:00Z",
"password": "Sup3r-Secret-Passphrase",
"username": "text"
}'201 Created{
"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
17 errors, each a status and a sentence400--<_> is required400--password-stdin is required: the password comes on standard input400--user is required400Invalid password: 8 to 128 printable characters400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400The access end date (<value>) is in the past.400The folder id is a number400The 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 reserved400expires_at has passed already: <t>400expires_at is a UTC time spelled as 2026-11-04T09:30:00Z400expires_at is not a day the calendar has: <t>401Authentication required404No protected folder <id>404User '<user>' not found409<name> is already a user of <f.path>urbestack.com/docs/api/post-protected-folders-id-users/