Duplicate Accounts
Learn to detect and delete duplicate accounts using the Argyle API.
Argyle recommends identifying, removing, and preventing duplicate accounts in order to keep better data consistency and avoid redundant information.
How are duplicate accounts created?#
If a user returns to Link and user tokens are not utilized correctly, the API does not recognize the previously connected user and creates a new, duplicate user. This duplicate user is then able to connect their account(s) again, leading to account duplication. The data is identical in the duplicate accounts but they are treated as separate connected accounts, as Argyle treats all accounts agnostically.
The user token is a necessary tool to prevent duplicate account connections. User tokens are temporary access keys that allow you to take users to the correct spot within the Argyle flow. Whenever you initialize Argyle Link, you must utilize user tokens in the Link configuration.
There are edge cases where you may have multiple users (for example, spouses) creating duplicate accounts using the same credentials. Utilizing the /duplicates
endpoint will help you identify these duplicate accounts, enabling you to decide which user or account to delete.
Identify existing duplicate accounts#
Use this request to discover duplicate user accounts based on an account ID:
GET http://api.argyle.com/v1/accounts/{id}/duplicates
If duplicates are found, the endpoint returns the list of duplicate account IDs and the user IDs associated with them.
1[ 2 { 3 "account_id": "017aa93f-b525-4720-d561-23d00a53cd67", 4 "user_id": "017cb11f-b4a4-54b9-198a-ebfe86ecd5ef" 5 }, 6 { 7 "account_id": "017c553f-0cae-ce98-4ade-097cd47e2042", 8 "user_id": "017cb915-0c20-55d7-409a-0fee5bda4ad9" 9 }, 10 { 11 "account_id": "017cca3e-d828-92e1-f0e2-a62b0c09c322", 12 "user_id": "017cb911-d797-7941-d315-521fe037bf0d" 13 } 14]
If no duplicates are found, an empty array is returned.
Call the duplicates endpoint#
You can call this endpoint when the accounts.added
webhook is triggered to immediately discover whether the account that was added is a duplicate or not.
You can also use the /duplicates
endpoint to check already existing accounts.
Delete duplicate accounts#
To delete duplicate accounts:
- Use the
onAccountCreated
callback to notify your backend about a new account. - Call the GET
/accounts/{id}/duplicates
endpoint. This endpoint returns all the duplicate accounts. - Delete the duplicate account using one of the following endpoints:
- DELETE
/accounts/{id}
to delete a specific account. - DELETE
/users/{id}
to delete a user and its connected data.
- DELETE