Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Ishaq74/concordia/llms.txt
Use this file to discover all available pages before exploring further.
Users API
The Users API provides administrative endpoints for managing user accounts, roles, bans, and sessions. All endpoints require admin authentication.Authentication
All endpoints require:- Valid session with admin role
- Admin guard (
isAdminUsercheck)
List users
Page number for pagination
Number of users per page
Search query for filtering users
Filter by role (e.g., “admin”, “moderator”)
Array of user objects
Total number of users
Current page number
Users per page
User management actions
All user management operations use the same endpoint with different action parameters. Endpoint:POST /api/admin/users
Set user role
Assign a role to a user.Must be
"set-role"Target user ID
Role to assign:
"admin", "moderator", "author", "owner", "citizen"Ban user
Ban a user account.Must be
"ban"User ID to ban
Reason for ban (optional but recommended)
Unban user
Remove ban from a user account.List user sessions
Get all active sessions for a specific user.Revoke user sessions
Revoke all active sessions for a user (force logout).Response codes
Operation successful
Invalid request (missing action, userId, or role)
Forbidden - requires admin role
User not found
Internal server error
Error responses
Implementation reference
Source:/src/pages/api/admin/users.ts
The implementation uses the following admin utilities:
listUsers()- From@lib/admin/userssetUserRole()- Role assignment with validationbanUser()- Ban with optional reasonunbanUser()- Remove banlistUserSessions()- Session enumerationrevokeUserSessions()- Force logout