List Users
GET /api/users
Get a list of all users in the system.
Request
Exclude the requesting admin user from the results
Get users excluding yourself
Response
Returns an array of user objects.Example Response
Create User
POST /api/users
Create a new user account. Optionally set their role and avatar.
Request
Unique username for the new user
Password for the new user (will be hashed)
Base64-encoded image or URL for user avatar. Falls back to server default avatar if not provided.
User role:
USER, ADMIN, or SUPERADMINSame as GET endpoint - affects response format
Response
Returns the created user object.Example Response
Errors
- 400 Bad Request: Username already exists
- 403 Forbidden: Attempting to create a role higher than your own
- 429 Too Many Requests: Rate limit exceeded (1 request per second)
Rate Limiting
This endpoint is rate-limited to 1 request per second.Get User
GET /api/users/:id
Retrieve detailed information about a specific user.
Request
Response
Example Response
Errors
- 404 Not Found: User not found
Update User
PATCH /api/users/:id
Update user profile, role, password, or quota settings.
Request
New username (must be unique)
New password (will be hashed)
New avatar URL
New role:
USER, ADMIN, or SUPERADMINUser quota configuration
Update role and quota
Remove quota limits
Response
Returns the updated user object.Errors
- 400 Bad Request: Invalid quota configuration (e.g.,
BY_BYTESwithoutmaxBytes) - 403 Forbidden: Attempting to assign a role higher than your own
- 404 Not Found: User not found
Delete User
DELETE /api/users/:id
Delete a user account. Optionally delete all their files and URLs.
Request
If
true, also deletes all files and URLs owned by the user from storage. If false, only the user account is deleted (files/URLs become orphaned).Delete user only
Delete user and all their content
Response
Returns the deleted user object.Example Response
Errors
- 403 Forbidden:
- Attempting to delete yourself
- Attempting to delete a user with a role equal to or higher than yours
- 404 Not Found: User not found
Role Hierarchy
The role system enforces a hierarchy:- SUPERADMIN: Can manage all users including other admins
- ADMIN: Can manage users with
USERrole only - USER: Cannot access these endpoints
- Create or assign roles higher than your own
- Modify or delete users with roles equal to or higher than yours
- Delete your own account through this endpoint