

# User pool deletion protection
<a name="user-pool-settings-deletion-protection"></a>

To make it so that your administrators don't accidentally delete your user pool, activate deletion protection. With deletion protection active, you can only delete your user pool after you confirm that you want to delete it. When you delete a user pool in the Amazon Web Services Management Console, you can deactivate deletion protection at the same time. When you accept the prompt to deactivate deletion protection and confirm your intention to delete, as shown in the following image, Amazon Cognito deletes your user pool.

![A screenshot from the Amazon Web Services Management Console showing a prompt to delete a user pool with an included prompt to also deactivate deletion protection.](http://docs.amazonaws.cn/en_us/cognito/latest/developerguide/images/amazon-cognito-delete-user-pool-deactivate-deletion-protection.png)


When you want to delete a user pool with an Amazon Cognito API request, you must first change `DeletionProtection` to `Inactive` in an [UpdateUserPool](https://docs.amazonaws.cn/cognito-user-identity-pools/latest/APIReference/API_UpdateUserPool.html) request. If you don't deactivate deletion protection, Amazon Cognito returns an `InvalidParameterException` error. After you deactivate deletion protection, you can delete the user pool in a [DeleteUserPool](https://docs.amazonaws.cn/cognito-user-identity-pools/latest/APIReference/API_DeleteUserPool.html) request.

Amazon Cognito activates **Deletion protection** by default when you create a new user pool in the Amazon Web Services Management Console. When you create a user pool with the `CreateUserPool` API, deletion protection is inactive by default. To use this feature in user pools that you create with the Amazon CLI or an Amazon SDK, set the `DeletionProtection` parameter to `True`.

You can activate or deactivate deletion protection status in the **Deletion protection** container in the **Settings** menu in the Amazon Cognito console.

**To configure deletion protection**

1. Go to the [Amazon Cognito console](https://console.amazonaws.cn/cognito/home). You might be prompted for your Amazon credentials.

1. Choose **User Pools**.

1. Choose an existing user pool from the list, or [create a user pool](https://docs.amazonaws.cn/cognito/latest/developerguide/cognito-user-pool-as-user-directory.html).

1. Choose the **Settings** menu, navigate to the **User pool security** tab, and locate **Deletion Protection**. Select **Activate** or **Deactivate**.

1. Confirm your choice in the next dialogue.