The admin backend provides comprehensive user management, role assignment, bulk operations, and notification capabilities for SOBIE Conference administrators and organizers.
Get comprehensive dashboard statistics including user counts, registration trends, and activity metrics.
Response:
{
"success": true,
"data": {
"overview": {
"totalUsers": 150,
"activeUsers": 145,
"verifiedUsers": 140,
"inactiveUsers": 5,
"unverifiedUsers": 10,
"verificationRate": "93.33"
},
"usersByType": {
"student": 75,
"academic": 50,
"industry": 20,
"other": 5
},
"usersByRole": {
"attendee": 120,
"presenter": 30,
"reviewer": 15,
"organizer": 5
},
"recentRegistrations": [
{"_id": "2025-08-10", "count": 5},
{"_id": "2025-08-11", "count": 8}
],
"loginActivity": [
{"_id": "2025-08-10", "count": 45},
{"_id": "2025-08-11", "count": 52}
]
}
}
Get all users with advanced filtering, pagination, and search capabilities.
Query Parameters:
page
(number): Page number (default: 1)limit
(number): Results per page (max: 100, default: 50)search
(string): Search across name, email, organizationuserType
(string): Filter by user type (student, academic, industry, other)studentLevel
(string): Filter by student level (undergraduate, graduate, doctorate)organization
(string): Filter by organizationisActive
(boolean): Filter by active statusisEmailVerified
(boolean): Filter by email verification statusroles
(string): Comma-separated roles to filter bysortBy
(string): Sort field (createdAt, email, name.lastName, etc.)sortOrder
(string): Sort order (asc, desc)Example:
GET /api/admin/users?search=john&userType=student&isActive=true&page=1&limit=25
Get detailed information for a specific user.
Create a new user manually.
Request Body:
{
"email": "newuser@example.com",
"password": "SecurePass123!",
"name": {
"firstName": "John",
"lastName": "Doe"
},
"userType": "academic",
"affiliation": {
"organization": "University of Example",
"jobTitle": "Professor",
"department": "Computer Science"
},
"roles": ["attendee", "reviewer"],
"skipEmailVerification": true
}
Update user information.
Delete or deactivate a user.
Query Parameters:
permanent
(boolean): If true, permanently delete user; if false, deactivate (default: false)Assign or remove roles from a user.
Request Body:
{
"roles": ["organizer", "reviewer"],
"action": "add" // "set", "add", or "remove"
}
Valid Roles:
organizer
: Conference organizers with administrative privilegesreviewer
: Paper/proposal reviewerspresenter
: Conference presentersattendee
: General conference attendeessponsor
: Conference sponsorsvolunteer
: Conference volunteersUpdate multiple users at once.
Request Body:
{
"userIds": ["userId1", "userId2", "userId3"],
"updateData": {
"isActive": true,
"roles": ["attendee"]
}
}
Send notifications to users or groups.
Request Body:
{
"recipients": "all", // "all", "filtered", or array of user IDs
"filters": { // Only used when recipients = "filtered"
"userType": "student",
"isActive": true
},
"subject": "Important Conference Update",
"message": "Dear conference participants,\n\nWe have an important update...",
"type": "email", // "email" or "sms"
"priority": "normal" // "low", "normal", "high"
}
Recipients Options:
"all"
: Send to all active users"filtered"
: Send to users matching the filters["userId1", "userId2"]
: Send to specific user IDsExport user data in JSON or CSV format.
Query Parameters:
format
(string): Export format (βjsonβ or βcsvβ, default: βjsonβ)filters
(object): MongoDB filters to applyCSV Export Example:
GET /api/admin/users/export?format=csv&userType=student
All endpoints return consistent error responses:
{
"success": false,
"message": "Error description",
"code": "ERROR_CODE",
"errors": [ // For validation errors
{
"field": "email",
"message": "Valid email is required",
"value": "invalid-email"
}
]
}
# First, login to get your JWT token
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "barrycumbie@gmail.com",
"password": "CatCat123!"
}'
# Use the returned token for admin requests
export TOKEN="your-jwt-token-here"
# Test admin dashboard
curl -X GET http://localhost:3000/api/admin/dashboard/stats \
-H "Authorization: Bearer $TOKEN"
curl -X POST http://localhost:3000/api/admin/users \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "testuser@example.com",
"password": "TestPass123!",
"name": {
"firstName": "Test",
"lastName": "User"
},
"userType": "student",
"studentLevel": "graduate",
"affiliation": {
"organization": "Test University",
"department": "Computer Science"
},
"roles": ["attendee"],
"skipEmailVerification": true
}'
curl -X GET "http://localhost:3000/api/admin/users?search=test&userType=student&limit=10" \
-H "Authorization: Bearer $TOKEN"
curl -X POST http://localhost:3000/api/admin/notifications/send \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"recipients": "filtered",
"filters": {
"userType": "student",
"isActive": true
},
"subject": "Welcome Students!",
"message": "Welcome to the SOBIE Conference! We are excited to have you join us.",
"priority": "normal"
}'
curl -X PUT http://localhost:3000/api/admin/users/USER_ID/roles \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"roles": ["presenter", "reviewer"],
"action": "add"
}'
Consider implementing: