---
title: "Delete user account"
section: "frontend/auth"
platforms: ["android", "angular", "flutter", "javascript", "nextjs", "react", "react-native", "swift", "vue"]
gen: 2
last-updated: "2026-03-25T17:40:00.000Z"
url: "https://docs.amplify.aws/react/frontend/auth/delete-user-account/"
---

export async function getStaticPaths() {
  return getCustomStaticPath(meta.platforms);
}

Empowering users to delete their account can improve trust and transparency. You can programmatically enable self-service account deletion with Amplify Auth.

If you have not yet created an Amplify Gen 2 app, visit the [quickstart](/[platform]/start/quickstart).

## Allow users to delete their account

You can quickly set up account deletion for your users with the Amplify Libraries. Invoking the `deleteUser` API to delete a user from the Auth category will also sign out your user.

If your application uses a Cognito User Pool, which is the default configuration, this action will only delete the user from the Cognito User Pool. It will have no effect if you are federating with a Cognito Identity Pool alone.

> **Warning:** Before invoking the `deleteUser` API, you may need to first delete associated user data that is not stored in Cognito. For example, if you are using Amplify Data to persist user data, you could follow [these instructions](https://gist.github.com/aws-amplify-ops/27954c421bd72930874d48c15c284807) to delete associated user data. This allows you to address any guidelines (such as GDPR) that require your app to delete data associated with a user who deletes their account.

You can enable account deletion using the following method:

<!-- Platform: javascript,  react-native, angular, nextjs, react, vue -->
```ts
import { deleteUser } from 'aws-amplify/auth';

async function handleDeleteUser() {
  try {
    await deleteUser();
  } catch (error) {
    console.log(error);
  }
}
```
<!-- /Platform -->
<!-- Platform: flutter -->
```dart
Future<void> deleteUser() async {
  try {
    await Amplify.Auth.deleteUser();
    safePrint('Delete user succeeded');
  } on AuthException catch (e) {
    safePrint('Delete user failed with error: $e');
  }
}
```
<!-- /Platform -->
<!-- Platform: android -->

#### [Java]

```java
Amplify.Auth.deleteUser(
    () -> Log.i("AuthQuickStart", "Delete user succeeded"),
    error -> Log.e("AuthQuickStart", "Delete user failed with error " + error.toString())
);
```

#### [Kotlin - Callbacks]

```kotlin
Amplify.Auth.deleteUser(
    { Log.i("AuthQuickStart", "Delete user succeeded") },
    { Log.e("AuthQuickStart", "Delete user failed with error", it) }
)
```

#### [Kotlin - Coroutines]

```kotlin
try {
    Amplify.Auth.deleteUser()
    Log.i("AuthQuickStart", "Delete user succeeded")
} catch (error: AuthException) {
    Log.e("AuthQuickStart", "Delete user failed with error", error)
}
```

#### [RxJava]

```java
RxAmplify.Auth.deleteUser()
    .subscribe(
      () -> Log.i("AuthQuickStart", "Delete user succeeded"),
      error -> Log.e("AuthQuickStart", "Delete user failed with error " + error.toString())
    );
```

<!-- /Platform -->
<!-- Platform: swift -->

#### [Async/Await]

```swift
func deleteUser() async {
    do {
        try await Amplify.Auth.deleteUser()
        print("Successfully deleted user")
    } catch let error as AuthError {
        print("Delete user failed with error \(error)")
    } catch {
        print("Unexpected error: \(error)")
    }
}
```

#### [Combine]

```swift
func deleteUser() -> AnyCancellable {
    Amplify.Publisher.create {
        try await Amplify.Auth.deleteUser()
    }.sink {
            if case let .failure(authError) = $0 {
                print("Delete user failed with error \(authError)")
            }
        }
        receiveValue: {
            print("Successfully deleted user")
        }
}
```

<!-- /Platform -->

We recommend you update your UI to let your users know that their account is deleted and test the functionality with a test user. Note that your user will be signed out of your application when they delete their account.
