Update a user
PATCH/api/users/:id
Updates a user: names, admin flag, active status, timezone, and avatar. Accepts either JSON or multipart/form-data (the latter carries the avatar file). A user may edit themselves; only admins may edit others or change the admin flag. Deactivation is blocked while the user is still on a published, unarchived course. Field-level changes are recorded (before → after) in the audit log.
Auth: required
Request
Responses
- 200
- 400
- 401
- 403
- 409
- 413
- 500
The updated user.
Invalid timezone.
Not signed in.
Not allowed to edit this user, or deactivating an actively-enrolled user.
The change would remove the last active administrator, or the new email is already in use.
Avatar exceeds the system upload limit.
Server error.