---
title: "Merge contacts"
method: POST
path: "/orgs/contacts/{contact_id}/merge"
tags: ["Contacts"]
---

# Merge contacts

`POST /orgs/contacts/{contact_id}/merge`

## Request

- Base URL: `https://api.useinvent.com`
- URL: `https://api.useinvent.com/orgs/contacts/{contact_id}/merge`
- Auth: HTTP bearer

Merge other contacts INTO the contact in the URL. If `source_contact_ids` is provided, those exact contacts are merged in; otherwise every auto-detected duplicate is merged. Source contacts are deleted.

## Path parameters

- `contact_id` string, required

## Request body

- MergeContactsSchema
  - `source_contact_ids` string[]: Contacts to merge into the primary. Omit to merge all auto-detected duplicates.

## Response `200`

- MergeContactsResultSchema
  - `merged` ContactSchema, required: Schema for the contact
    - `id` string, required
    - `name` string, nullable, required
    - `blocked` boolean, required
    - `blocked_at` string, date-time
    - `unsubscribed` boolean, required
    - `unsubscribed_at` string, date-time
    - `unsubscribe_reason` string
    - `unsubscribe_feedback` string
    - `ai_replies` boolean, required
    - `ai_replies_at` string, date-time
    - `is_admin` boolean, required
    - `channels` ContactChannelSchema[], required
      - `id` string, required
      - `type` 'internal' | 'org' | 'agent' | 'custom' | 'whatsapp_bot' | 'messenger_bot' | 'instagram_dm' | 'tiktok_dm' | 'telegram_bot' | 'slack_bot' | 'teams_bot' | 'gmail' | 'outlook' | 'twilio' | 'telnyx' | 'email' | 'smpp', required: The channel type
      - `user_id` string, required: The unique identifier for the contact channel, e.g Phone Number or User ID
      - `avatar` string, nullable, required: The avatar for the contact channel, e.g X Avatar URL
      - `name` string, nullable, required: The name for the contact channel, e.g Full Name
      - `username` string, nullable, required: The username for the contact channel, e.g Username
      - `email` string, nullable, required: The email for the contact channel, e.g Email
      - `phone` string, nullable, required: The phone number for the contact channel, e.g Phone Number
      - `country` string, nullable, required: The country code associated with the contact channel, e.g US for United States
      - `agent` string, nullable, required: The user agent associated with the contact channel
      - `ip` string, nullable, required: The IP address associated with the contact channel
      - `language` string, nullable, required: The language code associated with the contact channel, e.g en for English
      - `link` string: A link to the contact channel, e.g a link to the social media profile
      - `created_at` string, date-time, required
      - `updated_at` string, date-time, required
    - `segments` SegmentLimitedSchema[], required
      - `id` string, required
      - `name` string, required
      - `color` 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'neutral', required: Accent color, by name
      - `contacts_count` number, required
      - `created_at` string, date-time, required
      - `updated_at` string, date-time, required
    - `fields` object, required: Map of contact field key → value.
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `merged_contact_ids` string[], required

---

[API](https://skmtc.dev/useinvent/apis/invent-api.md) · [All operations](https://skmtc.dev/useinvent/apis/invent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/useinvent/apis/invent-api/revisions/98824f3fde82?raw)
