# User management

Use `User` methods to manage the current user's account. You can access the current user reactively with `Clerk.userFlow` or directly with `Clerk.activeUser`.

### Reload user

```kotlin
val refreshedUser = user.reload()
```

### Update user

```kotlin
val updatedUser = user.update {
    username = "janedoe"
    firstName = "Jane"
    lastName = "Doe"
}
```

### Create email address

```kotlin
val emailAddress = user.createEmailAddress("jane@example.com")
```

### Create phone number

```kotlin
val phoneNumber = user.createPhoneNumber("+15551234567")
```

### Create external account with OAuth

Create an external account with an OAuth provider (e.g., Google, GitHub, see [all providers](https://clerk.com/docs/android/guides/configure/auth-strategies/social-connections/overview.md#supported-social-providers)):

```kotlin
when (
    val result =
        user.createExternalAccount(
            User.CreateExternalAccountParams(
                provider = OAuthProvider.GOOGLE,
                redirectUrl = "myapp://callback"
            )
        )
) {
    is ClerkResult.Success -> {
        val externalAccountOAuth = result.value
    }
    is ClerkResult.Failure -> {
        // Handle the failure.
    }
}
```

### Create passkey

```kotlin
val passkey = user.createPasskey()
```

### Create TOTP secret

```kotlin
val totp = user.createTOTP()
```

### Verify TOTP code

```kotlin
val verifiedTotp = user.verifyTOTP(code = "123456")
```

### Disable TOTP

```kotlin
val deletedTotp = user.disableTOTP()
```

### Create backup codes

```kotlin
val backupCodes = user.createBackupCodes()
```

### List Organization invitations

The `User.getOrganizationInvitations()` companion helper is also available when you don't have a `User` instance in scope.

```kotlin
when (val result = user.getOrganizationInvitations(limit = 20, offset = 0, status = "pending")) {
    is ClerkResult.Success -> {
        val invitations = result.value.data
    }
    is ClerkResult.Failure -> {
        // Handle the failure.
    }
}
```

### List Organization memberships

```kotlin
when (val result = user.getOrganizationMemberships(limit = 20, offset = 0)) {
    is ClerkResult.Success -> {
        val memberships = result.value.data
    }
    is ClerkResult.Failure -> {
        // Handle the failure.
    }
}
```

### List Organization suggestions

The `User.getOrganizationSuggestions()` companion helper is also available when you don't have a `User` instance in scope.

```kotlin
when (val result = user.getOrganizationSuggestions(statuses = listOf("pending"))) {
    is ClerkResult.Success -> {
        val suggestions = result.value.data
    }
    is ClerkResult.Failure -> {
        // Handle the failure.
    }
}
```

### Get Organization creation defaults

```kotlin
when (val result = user.getOrganizationCreationDefaults()) {
    is ClerkResult.Success -> {
        val creationDefaults = result.value
    }
    is ClerkResult.Failure -> {
        // Handle the failure.
    }
}
```

### List sessions

```kotlin
val sessions = user.getSessions()
```

### Update user password

```kotlin
when (
    val result =
        user.updatePassword(
            User.UpdatePasswordParams(
                currentPassword = "old-password",
                newPassword = "new-password",
                signOutOfOtherSessions = true
            )
        )
) {
    is ClerkResult.Success -> {
        val updatedUser = result.value
    }
    is ClerkResult.Failure -> {
        // Handle the failure.
    }
}
```

### Set profile image

```kotlin
when (val result = user.setProfileImage(file)) {
    is ClerkResult.Success -> {
        val profileImage = result.value
    }
    is ClerkResult.Failure -> {
        // Handle the failure.
    }
}
```

### Delete profile image

```kotlin
val deletedProfileImage = user.deleteProfileImage()
```

### Delete user

```kotlin
val deletedUser = user.delete()
```

---

## Sitemap

[Overview of all docs pages](https://clerk.com/docs/llms.txt)
