Unlinking accounts from users
Developers can use Privy to prompt users to unlink their linked accounts (such as a wallet or Discord profile) at any point in their user journey. This might be useful whenever the user has either created a new external account (such as a new Twitter profile or email address) and want to remove the old linked account from their user.
The React SDK supports unlinking all supported account types via our modal-guided link methods.
To prompt a user to unlink an account, use the respective method from the usePrivy
hook:
Method | Description |
---|---|
unlinkEmail | unlinks email address |
unlinkPhone | unlinks phone number |
unlinkWallet | unlinks external wallet |
unlinkGoogle | unlinks Google account |
unlinkApple | unlinks Apple account |
unlinkTwitter | unlinks Twitter account |
unlinkDiscord | unlinks Discord account |
unlinkGithub | unlinks Github account |
unlinklinkedIn | unlinks LinkedIn account |
unlinkTikTok | unlinks TikTok account |
unlinkSpotify | unlinks Spotify account |
unlinkInstagram | unlinks Instagram account |
unlinkTelegram | unlinks Telegram account |
unlinkFarcaster | unlinks Farcaster account |
unlinkPasskey | unlinks passkey |
Users are only permitted to unlink an account so long as they have at least one more linked account.
Below is an example button for prompting a user to unlink certain linked accounts:
The React SDK supports unlinking all supported account types via our modal-guided link methods.
To prompt a user to unlink an account, use the respective method from the usePrivy
hook:
Method | Description |
---|---|
unlinkEmail | unlinks email address |
unlinkPhone | unlinks phone number |
unlinkWallet | unlinks external wallet |
unlinkGoogle | unlinks Google account |
unlinkApple | unlinks Apple account |
unlinkTwitter | unlinks Twitter account |
unlinkDiscord | unlinks Discord account |
unlinkGithub | unlinks Github account |
unlinklinkedIn | unlinks LinkedIn account |
unlinkTikTok | unlinks TikTok account |
unlinkSpotify | unlinks Spotify account |
unlinkInstagram | unlinks Instagram account |
unlinkTelegram | unlinks Telegram account |
unlinkFarcaster | unlinks Farcaster account |
unlinkPasskey | unlinks passkey |
Users are only permitted to unlink an account so long as they have at least one more linked account.
Below is an example button for prompting a user to unlink certain linked accounts:
To prompt a user to unlink an account, use the respective functions and hooks:
Account type | Description | Hook to invoke |
---|---|---|
Wallet | Unlinks external wallet | useUnlinkWallet |
Google | Unlinks Google account | useUnlinkOAuth |
Apple | Unlinks Apple account | useUnlinkOAuth |
Twitter | Unlinks Twitter account | useUnlinkOAuth |
Discord | Unlinks Discord account | useUnlinkOAuth |
Github | Unlinks Github account | useUnlinkOAuth |
LinkedIn | Unlinks LinkedIn account | useUnlinkOAuth |
TikTok | Unlinks TikTok account | useUnlinkOAuth |
Spotify | Unlinks Spotify account | useUnlinkOAuth |
Instagram | Unlinks Instagram account | useUnlinkOAuth |
Farcaster | Unlinks Farcaster account | useUnlinkFarcaster |
Users are only permitted to unlink an account so long as they have at least one more linked account.
Below is an example button for prompting a user to unlink an email from their account:
We are actively working on building out other unlink methods for Expo! If there is an unsupported unlink method that is needed for your application, please make use of the REST API or dashboard to programmatically unlink accounts for your users.
Make a POST
request to:
Replace <privy-app-id>
with your Privy app ID and pass in the following parameters:
Parameter | Type | Description |
---|---|---|
user_id | string | Privy DID of the user |
type | string | Linked account type (see supported types below) |
handle | string | The identifier for the account (e.g., email address, wallet address) |
provider | string | (Only required for cross app unlinking) The cross app provider id, prefixed with 'privy:' |
Supported Account Types
The following account types can be unlinked via the API:
email
- Email accountsphone
- Phone number accountswallet
- Externally connected wallets (Ethereum or Solana)smart_wallet
- Smart contract walletsfarcaster
- Farcaster accountstelegram
- Telegram accountscross_app
- Cross app accounts- OAuth providers:
google_oauth
discord_oauth
twitter_oauth
github_oauth
linkedin_oauth
apple_oauth
spotify_oauth
instagram_oauth
tiktok_oauth
The API does not support unlinking passkey
, custom_auth
, cross_app
, or guest
account
types.
Example Requests
Response
If the unlinking is successful, the API will return a 200 status code.
If there’s no account associated with the Privy DID that matches the type and handle, the API will return a 400 status code.
To unlink via the dashboard:
- Navigate to the Users page
- Select the user
- Click the button beside the account you want to unlink
- Click
Unlink account
The unlink option won’t appear if unlinking is not available for the account.