Merge Contacts
POST/accounts/:account_id/actions/contact_merge
Merges the mergee contact into the base contact, then deletes the mergee.
The base contact takes over all conversations, messages, contact inboxes, list memberships, form submissions, notes, tickets, CSAT responses, files and labels. For attributes, the base contact's non-empty values win, and empty ones are filled from the mergee. An active block on the mergee is carried over if it is longer than the base contact's.
| Setting | Value |
|---|---|
| Method | POST |
| Path | /api/v1/accounts/{account_id}/actions/contact_merge |
| Authorization | User token. Requires delete permission on the mergee and update permission on the base contact (legacy: administrator; new rules: Contacts → delete and Contacts → update). Agent-bot tokens: not allowed. |
Body parameters (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
base_contact_id | integer | Yes | Contact that is kept. |
mergee_contact_id | integer | Yes | Contact that is merged and then deleted. |
Example request
curl -X POST 'https://online.99digital.co.il/api/v1/accounts/12/actions/contact_merge' \
-H 'api_access_token: <YOUR_API_ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{ "base_contact_id": 801, "mergee_contact_id": 802 }'
Example response (200 OK): the base contact. It is not wrapped in payload, and has no contact_inboxes.
{
"additional_attributes": {
"company_name": "Example Ltd",
"city": "Tel Aviv"
},
"availability_status": "offline",
"email": "dana.cohen@example.com",
"id": 801,
"name": "Dana Cohen",
"phone_number": "+972501234567",
"identifier": "crm-801",
"thumbnail": "",
"custom_attributes": {
"customer_tier": "gold"
},
"blocked": false,
"is_whatsapp_contact": false,
"created_at": 1794470500
}
After the merge, GET /contacts/802 returns 404.
Request
Responses
- 200
- 401
- 403
The base contact after the merge.
The access token is missing or wrong, or its user does not belong to this account.
The token's role does not have the permission this endpoint needs, or the endpoint is not open to agent-bot tokens. See Authorization.