---
title: "Merge CRM entities"
method: POST
path: "/crm/v1/entities/{entity}/merge"
tags: ["items"]
---

# Merge CRM entities

`POST /crm/v1/entities/{entity}/merge`

## Request

- Base URL: `https://{domain}.uspacy.ua`
- URL: `https://{domain}.uspacy.ua/crm/v1/entities/{entity}/merge`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/uspacy/apis/crm-service-2/docs/crm/v1/entities/:entity/merge/post.ts> (a function with typed inputs; its response is checked against the schema)

Merges two or more CRM entity items into one. The primary entity retains its ID and is enriched with data from secondary entities, which are then deleted.
Example: `POST /crm/v1/entities/contacts/merge`

## Request body

- object
  - `primary_id` integer: ID of the entity to keep
  - `secondary_ids` integer[]: IDs of entities to merge into primary

## Response `200`

OK

## Other responses

- `401`: Access token is missing or invalid
- `422`: Validation error response

---

[API](https://skmtc.dev/uspacy/apis/crm-service-2.md) - [All operations](https://skmtc.dev/uspacy/apis/crm-service-2/llms.txt) - [OpenAPI document](https://skmtc.dev/uspacy/apis/crm-service-2/revisions/f80578d43845?raw)
