# Merging Accounts/Contacts

This tutorial should help you merge Accounts or Contact. Before moving forward, make sure your [**Authentication** ](https://developers.pipelinersales.com/api-docs/overview/authentication)works and you understand the [**Key Concepts**](https://developers.pipelinersales.com/api-docs/core-api-concepts/understanding-the-crm-concept) of the Pipeliner API, and make sure you know how to use [**API parameters**](https://developers.pipelinersales.com/api-docs/core-api-concepts/api-parameters)

When you have two similar Accounts or Contacts you can use merge functionality to move all data from a duplicate to the master record. The Duplicate will be deleted at the same time

#### Merging Accounts

{% openapi src="<https://3470708952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFpjbhrh1xo0SPAbAc7Ny%2Fuploads%2FOlNVdYj1h5GSxQmLHAjz%2Fopenapi%20(1).json?alt=media&token=4be07353-5170-4a95-9100-4f16545d47b0>" path="/entities/Accounts/merge" method="post" %}
[openapi (1).json](https://3470708952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFpjbhrh1xo0SPAbAc7Ny%2Fuploads%2FOlNVdYj1h5GSxQmLHAjz%2Fopenapi%20\(1\).json?alt=media\&token=4be07353-5170-4a95-9100-4f16545d47b0)
{% endopenapi %}

#### Merging Contacts

{% openapi src="<https://3470708952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFpjbhrh1xo0SPAbAc7Ny%2Fuploads%2FOlNVdYj1h5GSxQmLHAjz%2Fopenapi%20(1).json?alt=media&token=4be07353-5170-4a95-9100-4f16545d47b0>" path="/entities/Contacts/merge" method="post" %}
[openapi (1).json](https://3470708952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFpjbhrh1xo0SPAbAc7Ny%2Fuploads%2FOlNVdYj1h5GSxQmLHAjz%2Fopenapi%20\(1\).json?alt=media\&token=4be07353-5170-4a95-9100-4f16545d47b0)
{% endopenapi %}

**Example of Account Merging**

The merging functionality through API works in the same way as[ **in the Application.**](https://help.pipelinersales.com/en/articles/3834458-merging-accounts-and-contacts)

```
/POST /entities/Accounts/merge
{
    "master": {
        "id": "4590b5a8-134a-404e-96f5-b40256bebc39"
    },
    "secondary_ids": [
        "109e5d1c-6d10-449b-b244-28438a428926"
    ]
}
```

`master-` This record will inherit data from a duplicate defined in secondary\_ids

`secondary_ids -` An Array of Duplicates, use Account IDs to specify the Account&#x73;**.** All duplicates are automatically deleted
