---
title: "Merge duplicate people"
method: POST
path: "/api/v1/merge_customers"
tags: ["Track Customers"]
---

# Merge duplicate people

`POST /api/v1/merge_customers`

Merge two customer profiles together. The payload contains `primary` and `secondary` profile objects. The primary profile remains after the merge and the secondary is deleted. This operation is _not_ reversible. 

The primary profile must already exist in Customer.io for the merge operation to work. If the primary profile doesn't exist, your request won't do anything. 

If you perform requests concurrently or in rapid succession, you could create a race condition where the primary profile doesn't exist yet. For example, if you identify a person and send a request to this endpoint immediately, the primary profile might not exist when we process your merge request.

The following information is merged into the primary profile from the secondary profile:
* Attributes that are not set, or are empty, on the primary.
* The most recent 30-days of event history. Events merged from the secondary person cannot trigger automations.
* Manual segments that the primary person did not already belong to.
* Message delivery history. 
* Automation journeys that the primary person has not entered. If the secondary person has started a journey that the primary person has not, the primary person continues on that automation journey after the merge. If the secondary person has completed journeys that the primary person has not, the primary person gains these historical journeys after the merge. This may be important for determining entry (or re-entry) criteria for subsequent automations, segments, etc.

## Request body

- object — Provide identifiers for the `primary` and `secondary` people you want to merge together.
  - `primary` union, required — The person that you want to remain after the merge, identified by one of `id`, `email`, or `cio_id`. This person receives information from the secondary person in the merge. If email is disabled as an identifier in your [workspace settings](https://fly.customer.io/workspaces/last/settings/edit), then you must reference people by `id` or `cio_id`. Under How to Modify, `id` must be set to "Reference people by cio_id" for a successful merge.
    - object
      - `id` string — The ID of a customer profile, analogous to a "person" in the UI.
    - object
      - `email` string — The email address of the customer.
    - object
      - `cio_id` string — A unique identifier set by Customer.io, used to reference a person if you want to update their identifiers.
  - `secondary` union, required — The person that you want to delete after the merge, identified by one of `id`, `email`, or `cio_id`. This person's information is merged into the primary person's profile and then it is deleted. If email is disabled as an identifier in your [workspace settings](https://fly.customer.io/workspaces/last/settings/edit), then you must reference people by `id` or `cio_id`. Under How to Modify, `id` must be set to "Reference people by cio_id" for a successful merge.
    - object
      - `id` string — The ID of a customer profile, analogous to a "person" in the UI.
    - object
      - `email` string — The email address of the customer.
    - object
      - `cio_id` string — A unique identifier set by Customer.io, used to reference a person if you want to update their identifiers.

## Response `200`

A successful request returns an empty object response.

## Other responses

- `400` — The request was malformed. You cannot have multiple identifiers (id, email, etc) in the `primary` or `secondary` objects.
- `401` — Unauthorized request. Make sure that you provided the right credentials.

---

[API](https://skmtc.dev/customer/apis/customer-io-journeys-api-reference.md) · [All operations](https://skmtc.dev/customer/apis/customer-io-journeys-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/customer/customer-io-journeys-api-reference/revisions/4b391af7cb06/schema)
