# Account linking with Auth0 actions

**URL:** <https://community.auth0.com/t/account-linking-with-auth0-actions/60676>\
**Category:** Get Help\
**Tags:** actions\
**Created:** [April 7, 2021, 8:24am UTC](https://community.auth0.com/t/account-linking-with-auth0-actions/60676 "2021-04-07T08:24:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 7, 2021, 7:07pm UTC](https://community.auth0.com/t/account-linking-with-auth0-actions/60676/2 "2021-04-07T19:07:38Z")

</div>

Thank you for sharing your solution with the Community @alexab!

Quoting your solution here for others to see! 🙂 :

> [@alexab](#):
>
> I now have a working action that does the account linking. Works pretty good, so I will recommended using an action. Because of some logging limitations in auth0 custom actions, I have decided to move the actual code to a server-function we host, and then let the action call this endpoint.
> 
> If requested, I can add specific code snippets, but the most important part is to use the mgmt API to link the users, and then return the “new” primary user like this:
> 
> ```auto
> event.user = primaryUserAfterAccountLink;
> return {
> user: primaryUserAfterAccountLink
> }
> 
> ```

---

_[View the full topic](https://community.auth0.com/t/account-linking-with-auth0-actions/60676)._
