docs(api): add contact merge endpoint to swagger documentation

Add API documentation for POST /api/v1/accounts/{account_id}/actions/contact_merge

This endpoint allows merging two contacts, where the base contact survives
and receives all data from the mergee contact.

Closes chatwoot/docs#243
This commit is contained in:
salmonumbrella
2026-01-02 01:42:52 -08:00
parent fd8919b901
commit 4f503f33e1
2 changed files with 62 additions and 0 deletions
@@ -0,0 +1,56 @@
post:
tags:
- Contacts
operationId: contactMerge
summary: Merge Contacts
security:
- userApiKey: []
description: |
Merge two contacts into one. The base contact survives and receives all data
from the mergee contact. The mergee contact is permanently deleted after the merge.
This operation is irreversible. All conversations, labels, and custom attributes
from the mergee contact will be transferred to the base contact.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- base_contact_id
- mergee_contact_id
properties:
base_contact_id:
type: integer
description: ID of the contact that will survive the merge and receive all data
example: 1
mergee_contact_id:
type: integer
description: ID of the contact that will be merged into the base contact and deleted
example: 2
responses:
'200':
description: Contacts merged successfully
content:
application/json:
schema:
$ref: '#/components/schemas/contact_base'
'400':
description: Bad request - invalid contact IDs or contacts cannot be merged
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: One or both contacts not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
+6
View File
@@ -275,6 +275,12 @@
/api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes:
$ref: ./application/contactable_inboxes/get.yml
# Contact Merge
/api/v1/accounts/{account_id}/actions/contact_merge:
parameters:
- $ref: '#/components/parameters/account_id'
post:
$ref: ./application/contacts/merge.yml
# Automation Rule
/api/v1/accounts/{account_id}/automation_rules: