Skip to main content
PUT
Update a user's department
Admin-only endpoint to set a user’s department by department ID.

Request

Headers

Request Body

Request Body Schema

Response

200 OK - Successfully updated department

400 Bad Request

401 Unauthorized

404 Not Found

500 Internal Server Error

Example

Notes

  • This is an admin-only endpoint - requires administrative privileges
  • Both user ID and department ID must be valid MongoDB ObjectIds
  • The department ID must correspond to an existing department
  • Users can be moved between departments using this endpoint
  • Only administrators can update other users’ departments
  • This may affect the user’s permissions if departments have role-based access

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
payload
object

Response

Successfully updated department

message
string
data
object