Merge Account
Merges a source account into a target account. All leads and deals belonging to the source account are reassigned to the target account, and the source account is archived. The merge is recorded in the audit log.
This is useful when the same company exists under two different account records — for example, after an import created a duplicate, or when two subsidiaries should be consolidated.
POST /accounts/{id}/merge
Merges the account identified by {id} (the source) into a target account you specify.
This action is permanent and cannot be undone. The source account will be archived and will no longer appear in the accounts list.
What happens during a merge:
- All leads associated with the source account are reassigned to the target account.
- All deals linked to the source account are reassigned to the target account.
- The source account is archived and removed from the active accounts list.
- The merge is captured in the audit log with the user who performed it.
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The source account ID to be archived (path parameter) |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
target_id | string | Yes | The ID of the account that will receive all leads and deals |
{
"target_id": "acct_def456"
}
Response
200 OK
{
"leads_reassigned": 8,
"deals_reassigned": 3
}
| Field | Type | Description |
|---|---|---|
leads_reassigned | integer | Number of leads moved to the target account |
deals_reassigned | integer | Number of deals moved to the target account |
Example
curl -X POST "https://api.kenbun.io/accounts/acct_abc123/merge" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"target_id": "acct_def456"
}'
Common Errors
| Status | Meaning | Solution |
|---|---|---|
| 400 | Bad Request | target_id is missing, or source and target are the same account |
| 401 | Unauthorized | Check authentication credentials |
| 404 | Not Found | Source or target account does not exist in this OU |
| 500 | Server Error | Contact support if the issue persists |
Notes
- Both accounts must belong to the same Organizational Unit. Cross-OU merges are not supported.
- After merging, the source account's historical data (leads, deals) appears under the target account.
- The merge is recorded in the Audit Log with the email of the user who initiated the action.
- To merge two accounts from the UI, open the account you want to archive (the source), then click Merge Account from the account detail page.
Related Endpoints
- GET /accounts - List all accounts
- GET /accounts/{id} - View account details
- PATCH /accounts/{id}/metadata - Update account name and metadata
Related Documentation
- Account Management - Merging accounts from the UI
- ABM Overview - Understanding Account-Based Marketing