Skip to main content

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

ParameterTypeRequiredDescription
idstringYesThe source account ID to be archived (path parameter)

Request Body

FieldTypeRequiredDescription
target_idstringYesThe ID of the account that will receive all leads and deals
{
"target_id": "acct_def456"
}

Response

200 OK

{
"leads_reassigned": 8,
"deals_reassigned": 3
}
FieldTypeDescription
leads_reassignedintegerNumber of leads moved to the target account
deals_reassignedintegerNumber 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

StatusMeaningSolution
400Bad Requesttarget_id is missing, or source and target are the same account
401UnauthorizedCheck authentication credentials
404Not FoundSource or target account does not exist in this OU
500Server ErrorContact 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.