# 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](/graphql/query/mutations/user-profile/delete-a-user-account.md) 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suggestic.com/graphql/query/mutations/user-profile/merge-user-accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
