# 4.22. Organisation Approver - Recover organisation users marked for deletion

<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.22.</td></tr><tr style="height: 94px;"><td style="height: 94px;">**Description**</td><td style="height: 94px;">As an **<span class="notion-enable-hover" data-token-index="1">Organisation Administrator</span>**,

I want to be able to recover a user marked for deletion that belongs to my organisation,

So that I can recover the access of a user that was deleted by mistake.

</td></tr><tr style="height: 29px;"><td style="height: 29px;">**Priority**</td><td style="height: 29px;"><span style="color: rgb(35, 111, 161);">**Low**</span></td></tr><tr style="height: 29px;"><td style="height: 29px;">**Actors**</td><td style="height: 29px;">Organisation Administrator</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 **Organisation Administrator** role.
2. The system must have a list of predefined roles available for assignment.
3. The user to be recovered must belong to the Organisation Administrator’s organisation, be marked for deletion and not yet be deleted.

### Postconditions

1. The user is not marked as inactive any more.
2. The user is enabled and can again login and use the system in accordance with the assigned roles.

### Main flow

1. The **Organisation Administrator** retrieves the user that belongs to his organisation and is marked for deletion (GET).
2. The **Organisation Administrator** uses an API to recover the user removing the flag “marked for deletion” (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 **Organisation Administrator** attempts to recover a user that does not exist or does not belong to his organisation, the system returns an error and prevents the action.

#### \[409 Not marked for deletion\] User not marked for deletion

If the **Organisation Administrator** attempts to recover a user that is not marked for deleting, 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.