Linked Accounts not Unlinking Even with Success Log

Problem statement

We are attempting to unlink two user accounts with the following endpoint:

[DELETE /api/v2/users/{id}/identities/{provider}/{user_id}]

https://auth0.com/docs/api/management/v2/users/delete-user-identity-by-user-idendpoint

We are getting status code 200 responses and there is a tenant log with “type”: “sapi” and “description”: “Unlink a User Identity”, however the user account is still linked.

Here is an example of the path we are using:

/api/v2/users/auth0%[7Ctest.user@auth0.com](mailto:7Ctest.user@auth0.com)/identities/auth0/auth0%7C123456789081523216417

Cause

The accounts are not being unlinked because the path requirement is /api/v2/users/{id}/identities/{provider}/{user_id} where the user_id value must be the ID of the secondary linked account (e.g. 123456789081523216417 part after the | in auth0|123456789081523216417).

Solution

For the accounts to be successfully unlinked, you must use this path with the following path parameters: /api/v2/users/{id}/identities/{provider}/{user_id}

id: ID of the primary user account.

provider: Identity provider name of the secondary linked account (e.g. google-oauth2).

user_id: ID of the secondary linked account (e.g. 123456789081523216417 part after the | in google-oauth2|123456789081523216417).

API Reference:

https://auth0.com/docs/api/management/v2/users/delete-user-identity-by-user-id