# 3.36. Editor - Delete a block

<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.36.</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"> **Editor**</span>,

I want to be able to delete a block that was created by mistake,

So that I can improve the quality and reliability of the register.

</td></tr><tr style="height: 29px;"><td style="height: 29px;">**Priority**</td><td style="height: 29px;"><span style="color: rgb(230, 126, 35);">**Medium**</span></td></tr><tr style="height: 29px;"><td style="height: 29px;">**Actors**</td><td style="height: 29px;">Editor</td></tr><tr style="height: 29px;"><td style="height: 29px;">**API Calls**</td><td style="height: 29px;">**DELETE** /blocks/&lt;block-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 **Editor** role.
2. The User has a block id that he wants to delete
3. The site for which the block is being deleted has more than one block.
4. The User has a valid reason to delete the block

### Postconditions

1. The system returns a confirmation that the block has been marked as “to be deleted”.

### Main flow

1. The **Organisation Editor** uses an API call to delete a specific block by ID (DELETE).
2. The system validates the input parameters.
3. The system marks the block, its units as well as their connections as “to be deleted”. **WARNING: If the block is already used somewhere in the system, the block gets marked as deleted but is kept in the database.**
4. The system returns a confirmation that the block has been marked as “to be deleted”.

### Exceptions

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

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

#### \[404 Not Found\] Block not found

Error returned by the system if the given block does not exist.

#### \[409 Conflict\] Site must have at least one block

Error returned by the system if the given block is the only block of a site. A site must always have at least one block attached to.

#### \[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.