Users API
The Users module manages system user accounts for administrators, teachers, and staff.
Model
{
"id": "uuid",
"email": "user@school.edu",
"name": "John Admin",
"avatar": "https://...",
"status": "active",
"last_login": "2024-01-15T10:00:00Z",
"teams": [...],
"roles": [...],
"team_id": "team-uuid",
"created_at": "2024-01-01T00:00:00Z"
}
Status Values
Status |
Description |
|---|---|
|
Active user account |
|
Disabled account |
|
Awaiting activation |
Endpoints
List Users
Endpoint: POST /api/users/list
!!! note “Permission Required” Listing users requires appropriate role permissions.
Get User by ID
Endpoint: GET /api/users/:id
Create User
Endpoint: POST /api/users
!!! warning “Admin Only” User creation requires admin role.
Request:
{
"email": "newuser@school.edu",
"name": "New User",
"password": "initialPassword123",
"role_ids": ["role-uuid"]
}
Update User
Endpoint: PUT /api/users/:id
Delete User
Endpoint: DELETE /api/users/:id
Role Assignment
Assign Role to User
Endpoint: PUT /api/roles/:id/assign
Request:
{
"user_ids": ["user-uuid-1", "user-uuid-2"]
}
Remove Role from User
Endpoint: PUT /api/roles/:id/remove
Request:
{
"user_ids": ["user-uuid-1"]
}
Team Assignment
Assign User to Team
Endpoint: PUT /api/teams/:id/assign
Request:
{
"user_ids": ["user-uuid-1", "user-uuid-2"]
}
Remove User from Team
Endpoint: PUT /api/teams/:id/remove
Password Management
Reset Password (Admin)
Endpoint: POST /api/admin/reset-password/:userid
Resets user password to the default value configured in environment.
Change Password (Self)
Endpoint: POST /api/auth/change-password
See Authentication for details.