User Management
Guides, route-group overviews, and live schema entry points for the Plexichat backend.
Manage users in the admin panel
This guide describes how to manage user accounts in the Plexichat admin panel.
Overview
The admin panel lets operators with the appropriate role manage the user lifecycle:
- Search and view user accounts.
- Edit profiles and account settings.
- Lock and unlock accounts.
- Force username changes.
- Handle scheduled deletions, grace periods, and immediate purges.
- Manage tiers and badges.
- Add internal admin notes.
All changes are written to the audit log. Some destructive actions require approval.
See admin_ui.approval_workflows in src/config_defaults.py.
Before you begin
You need an admin session authenticated at <admin-base> (default /api/v1/admin) and a role that contains the permission listed for each action. See Admin permissions and src/core/admin/permissions.py for the full PERMISSION_SCOPES list.
Common scopes:
| Scope | Purpose |
|---|---|
users.read |
View users and activity reports |
users.edit |
Edit profiles, cancel or delay deletions |
users.lock |
Lock and unlock accounts |
users.force_username_change |
Force username changes and credential resets |
users.tier |
Change account tiers |
users.storage |
Set or clear per-user storage-quota overrides |
users.badges |
Add or remove badges |
users.notes |
Add, view, and edit internal notes |
users.delete |
Delete accounts immediately |
users.force_purge |
Immediately purge scheduled deletions |
Caution: Do not document users.force_password_change. This scope does not exist. Use users.force_username_change for forced account and credential changes. The role API rejects wildcard scopes such as * or users.* with 400 (src/api/routes/admin/roles.py).
Search and view users
Search for a user
- Go to User Management.
- Use the search box to filter by:
- User ID (exact Snowflake ID)
- Username (partial or exact match)
- Email address
- Account status
The search endpoint is GET <admin-base>/users/search.
View a user profile
Select a user to view:
- Basic information (username, ID, email)
- Account status and tier
- Registration date and last activity
- Server memberships and roles
- Internal admin notes
- Scheduled deletion status, if any
The profile endpoint is GET <admin-base>/users/{user_id}.
Edit user profiles
- Open the user profile.
- Click Edit Profile.
- Update allowed fields such as display name, email, bio, and profile settings.
- Click Save.
Required permission: users.edit.
The API endpoint is PATCH or PUT on the user resource as exposed by the admin users router (src/api/routes/admin/users/__init__.py).
Lock and unlock accounts
Lock an account
Locking prevents login without deleting data.
- Open the user profile.
- Click Lock Account.
- Enter a reason for the lock.
- Confirm the action.
Required permission: users.lock. The action is POST <admin-base>/security/lock-user.
Unlock an account
- Open the locked user profile.
- Click Unlock Account.
- Confirm the action.
Required permission: users.lock. The action is POST <admin-base>/security/unlock-user.
Force a username change
- Open the user profile.
- Click Force Username Change.
- Enter the new username and a reason.
- Confirm the action.
The user is prompted to choose a new username on next login.
Required permission: users.force_username_change.
Endpoint: POST <admin-base>/users/{user_id}/force-username-change.
Note: There is no users.force_password_change scope. The admin password change for managed admins is POST <admin-base>/auth/force-password-change/{target_admin_id}.
Handle scheduled deletions
When a user requests deletion, the account enters a scheduled deletion state with a grace period (default 30 days).
Cancel a scheduled deletion
- Go to the Deletions tab.
- Find the user in the scheduled deletions list (
GET <admin-base>/users/scheduled-deletions). - Click Cancel.
- Confirm the action.
The account returns to active status.
Required permission: users.edit.
Endpoint: POST <admin-base>/users/{user_id}/cancel-deletion.
Extend the grace period
- Go to the Deletions tab.
- Find the user.
- Click Delay.
- Select a new deletion date.
- Confirm the action.
Required permission: users.edit.
Endpoint: POST <admin-base>/users/{user_id}/delay-deletion.
Force purge an account
Caution: This action immediately and irreversibly deletes the account and all data.
- Go to the Deletions tab.
- Find the user.
- Click Purge.
- Confirm the warning and type
DELETE.
Required permission: users.force_purge. This action typically requires approval from two admins (admin_ui.approval_workflows.require_approval_for includes users.force_purge).
Endpoint: POST <admin-base>/users/{user_id}/force-purge.
The purge erases what the account owned as well as the account row: the servers it owned (with their channels, messages and conversations), conversations left with no other participant (including the conversations of threads it started), and uploaded media metadata plus its stored objects. A media object whose content is shared with another user's upload stays in storage, but the purged user's metadata and reference are removed. Objects the storage backend refuses to delete are recorded on the PURGED audit event as media_object_paths for an operator to sweep, the same way unswept DSAR exports are.
To verify erasure on your deployment, see Account-purge residue check.
Delete an account directly
- Open the user profile.
- Click Delete Account.
- Enter a reason.
- Confirm the action.
Required permission: users.delete (typically requires approval).
Manage tiers and badges
View tiers
Tiers determine capabilities and limits. The current tiers are standard, alpha, premium, and staff as defined in src/config_defaults.py. The available_badges list is also defined there.
Change a tier
- Open the user profile.
- Click Change Tier.
- Select the new tier.
- Enter a reason.
- Confirm the action.
Required permission: users.tier.
Endpoint: PUT <admin-base>/users/{user_id}/tier.
View badges
Badges indicate special status, achievements, or event participation and are rendered on the user profile.
Add a badge
- Open the user profile.
- Click Add Badge.
- Select a badge from the allow-list.
- Add optional notes.
- Confirm the action.
Required permission: users.badges.
Endpoint: POST <admin-base>/users/{user_id}/badges/{badge}.
Remove a badge
- Find the badge in the user's badge list.
- Click Remove.
- Confirm the action.
Required permission: users.badges.
Endpoint: DELETE <admin-base>/users/{user_id}/badges/{badge}.
Use internal admin notes
Notes are private to admins and never shown to the user.
Add a note
- Open the user profile.
- Click Add Note.
- Enter the content and optionally select a category.
- Click Save.
Required permission: users.notes.
Endpoint: POST <admin-base>/users/{user_id}/notes.
View notes
Notes are displayed in the profile with content, author, timestamp, category, and edit history.
Endpoint: GET <admin-base>/users/{user_id}/notes.
Edit a note
- Find the note.
- Click Edit.
- Update the content.
- Save your changes.
The previous version is preserved in the audit trail.
Required permission: users.notes.
Run bulk operations
Apply bulk actions
- Go to User Management.
- Select users with the checkboxes.
- Choose an action from the bulk actions menu: lock, unlock, change tier, add badges, or send notifications.
- Configure the parameters.
- Confirm the action.
Required permission: Depends on the selected action.
Import users from CSV
- Go to User Management.
- Click Import Users.
- Upload a CSV file with the required columns.
- Map the CSV columns to user fields.
- Review the preview.
- Confirm the import.
Required permission: users.create (if enabled in your deployment).
Monitor activity
View user activity
Profiles show last login, last activity, recent messages, server memberships, and a history of account changes.
Generate activity reports
- Go to User Management.
- Click Activity Reports.
- Select a date range.
- Choose a report type: login activity, message activity, server activity, or account changes.
- Generate and optionally export the report.
Required permission: users.read.
Troubleshooting
| Symptom | Check |
|---|---|
| User cannot log in | Verify the account is not locked, not in scheduled deletion, and not pending a forced password or username change. Review audit logs and POST <admin-base>/security/lock-user history. |
| User not found in search | Verify the Snowflake ID, check for typos, and confirm the account has not been purged. |
| Cannot modify a user | Confirm you have the required scope, that the approval workflow is not blocking the action, and that the target is not a protected system account. |
| Changes do not appear | Refresh the profile, check server logs, and verify the API response was 200. Some changes require the user to re-authenticate. |
Best practices
- Always provide a reason when you change an account. Reasons are stored in the audit log.
- Add an internal note for context that other admins need.
- Regularly review locked accounts and scheduled deletions.
- Notify users of significant changes when appropriate.
- Export user data before deletion if retention policies require it. Use the DSAR endpoints under
GET <admin-base>/data-export.