Update a user's department role
Profile Management
Update Department Role
Admin-only endpoint to update a user’s department role by user ID.
PUT
Update a user's department role
Admin-only endpoint to update a user’s department role by user ID.
Request
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token |
| Content-Type | string | Yes | application/json |
Request Body
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
| payload | object | Yes | Update payload |
| payload.userId | string | Yes | User ID to update |
| payload.departmentRole | string | Yes | New department role |
Response
200 OK - Successfully updated department role
400 Bad Request
401 Unauthorized
404 Not Found
500 Internal Server Error
Example
Notes
- This is an admin-only endpoint - requires administrative privileges
- The user ID must be a valid MongoDB ObjectId
- Department roles can include: “manager”, “supervisor”, “agent”, “admin”, etc.
- The role may affect the user’s permissions within their department
- Only administrators can update other users’ department roles
- Role names should match predefined roles in your system