# Merge User Accounts

Use the `mergeUser` mutation to merge two user accounts.

This process will move labs and notes from an *origin user* into the *target user's* profile. The origin user will not be automatically deleted. If you wish to delete an account, you can use the [deleteProfile](https://docs.suggestic.com/graphql/query/mutations/user-profile/delete-a-user-account) mutation.

{% hint style="warning" %}
The merge will fail if the *origin user* has appointments scheduled for a future date.
{% endhint %}

## Arguments

<table data-header-hidden><thead><tr><th>Argument</th><th>Type</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>Argument</td><td>Type</td><td>Description</td><td></td></tr><tr><td><pre><code>userOrigin
</code></pre></td><td>base64UserId!</td><td>The ID of the user whose profile data will be merged.</td><td></td></tr><tr><td><pre><code>userTarget
</code></pre></td><td>base64UserID!</td><td>The ID of the user who will receive the merged data.</td><td></td></tr></tbody></table>

## Example

{% code overflow="wrap" %}

```graphql
mutation {
  mergeUser(
    userOrigin: "TWVtYmVyOjBhMTA3YWM5LTg4Y2EtNGJkYy1iOTdhLWIyODE4NDA1ODVjZX=="
    userTarget: "TWVtYmVyOjBhMTA3YWM7LTg4Y2EtNGJkYy1hOTdhLWIyODE4NDA19DVjZX=="
  ) {
    success
    message
    errors {
      field
      messages
    }
  }
}
```

{% endcode %}
