diff --git a/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx b/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx index 6e92bd3ad0..5e5bc807f3 100644 --- a/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx +++ b/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx @@ -498,6 +498,28 @@ def unmerge_provisional_account(external_auth_token): If you have a server backend, you'll want to use the server-to-server unmerge endpoint rather than the SDK helper method to maintain better security and control over the unmerge process. ::: +#### Unmerging with Bot Token Endpoint + +If you're using the [Bot Token Endpoint](/docs/discord-social-sdk/development-guides/using-provisional-accounts#server-authentication-with-bot-token-endpoint) for authentication, you can unmerge accounts without an external auth token. + +```python +import requests + +API_ENDPOINT = 'https://discord.com/api/v10' +BOT_TOKEN = 'YOUR_BOT_TOKEN' + +def unmerge_provisional_account(external_user_id): + data = { + 'external_user_id': external_user_id # identifier used in the /token/bot endpoint + } + headers = { + 'Content-Type': 'application/json', + 'Authorization': f'Bot {BOT_TOKEN}' + } + r = requests.post('%s/provisional-accounts/unmerge/bot' % API_ENDPOINT, json=data, headers=headers) + r.raise_for_status() +``` + ### Unmerging Provisional Accounts for Public Clients @@ -619,4 +641,4 @@ Now that you've set up provisional accounts for your game, you can explore more [`Client::GetTokenFromProvisionalMerge`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a41062b7dafa331ddd2320daf1b4b273b [`Client::SetTokenExpirationCallback`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#aab5bfc76809ea22e79f2f7a067ac4519 [`Client::UnmergeIntoProvisionalAccount`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a2da21ae8a3015e0e5e42c1a7226b256f -[`Client::UpdateProvisionalAccountDisplayName`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a7485979ab2d4c533b75f8efd5e50bc60 \ No newline at end of file +[`Client::UpdateProvisionalAccountDisplayName`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a7485979ab2d4c533b75f8efd5e50bc60