Update User API
Overview
Updates an employee user profile, department, or band.
- Endpoint:
/api/users/update - Method:
POST - Access: Corporate Admin / User
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
id | String (UUID) | Yes | Target user ID |
firstName | String | No | Updated first name |
lastName | String | No | Updated last name |
departmentId | String (UUID) | No | Updated department ID |
bandId | String (UUID) | No | Updated Employee Band ID |
Request Body Example
{
"id": "u9876543-21ba-fedc-3210-9876543210fe",
"departmentId": "d1234567-89ab-cdef-0123-456789abcdef",
"bandId": "b1234567-89ab-cdef-0123-456789abcdef"
}
Success Response (200 OK)
{
"success": true,
"message": "User updated successfully",
"data": {
"id": "u9876543-21ba-fedc-3210-9876543210fe",
"firstName": "Vikram",
"lastName": "Singh",
"employeeBand": "Band 1",
"band": {
"id": "b1234567-89ab-cdef-0123-456789abcdef",
"name": "Band 1"
}
}
}
Database Impact
- Table:
users - Operations:
UPDATErecord by ID.