# 4.5. Application Administrator - Update users

<table border="1" id="bkmrk-id-4.1.-description-" style="border-collapse: collapse; width: 100%; height: 268px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29px;"><td style="height: 29px;">**Id**</td><td style="height: 29px;">4.5.</td></tr><tr style="height: 94px;"><td style="height: 94px;">**Description**</td><td style="height: 94px;">As a **<span class="notion-enable-hover" data-token-index="1">Application Administrator</span>**,   
  
I must be able to update user accounts and re-assign them appropriate roles,   
  
So that I can control access to the system and ensure that each user has the correct permissions based on their responsibilities.</td></tr><tr style="height: 29px;"><td style="height: 29px;">**Priority**</td><td style="height: 29px;">**<span style="color: rgb(224, 62, 45);">High</span>**</td></tr><tr style="height: 29px;"><td style="height: 29px;">**Actors**</td><td style="height: 29px;">User</td></tr><tr style="height: 29px;"><td style="height: 29px;">**API Calls**</td><td style="height: 29px;">**GET** /admin/api-users/&lt;user-id&gt;   
**PUT** /admin/api-users/&lt;user-id&gt;   
**PATCH** /admin/api-users/&lt;user-id&gt;</td></tr><tr style="height: 29px;"><td style="height: 29px;">**Linked Processes**</td><td style="height: 29px;">  
</td></tr><tr style="height: 29px;"><td style="height: 29px;">**Status**</td><td style="height: 29px;">**<span style="color: rgb(22, 145, 121);">Implemented</span>**</td></tr></tbody></table>

### Preconditions

1. The User must be authenticated and have the **Application Administrator** role.
2. The system must have a list of predefined roles available for assignment.
3. The user to be modified must exist on the platform

### Postconditions

1. The user list is updated with the modified accounts.
2. All assigned roles are correctly enforced by the system.

### Main flow

1. The **Application Administrator** retrieves a list of existing users with their details and roles (GET).
2. The **Application Administrator** uses an API to modify an existing user by modifying the required details (e.g., name, email) and assigning roles (PUT/PATCH).
3. The system validates the input data.
4. The system saves the changes and updates the user list.

### Exceptions

#### \[400 Bad Request\] Invalid input:

If mandatory fields are missing or invalid, the system returns an error message.

#### \[404 Not found\] User not found

If the **Application Administrator** attempts to modify a user that does not exist, the system returns an error and prevents the action.

#### \[500 Internal Server Error\] System Error

If the system fails to save changes due to an internal error, it displays an appropriate message and logs the error for further investigation.