---
title: "Merge two ACF customer masters"
description: "Moves mappings from targetMasterId to sourceMasterId. Requires an elevated merge scope and an auditable reason."
---

> Documentation Index
> Fetch the complete documentation index at: https://staging.caretlegal.net/docs/llms.txt
> Use this file to discover all available pages before exploring further.

Path: External Customer Access API

`POST /integrations/external-clients/customers/merge`

Moves mappings from targetMasterId to sourceMasterId. Requires an elevated merge scope and an auditable reason.

## Authentication

- `PartnerApiKey`, http, header `Authorization`

## Header parameters

- `x-organization-id` (`mergeAcfCustomerMasters.header.x-organization-id`; string, required)

## Request body

_Required._

- `sourceMasterId` (`mergeAcfCustomerMasters.sourceMasterId`; string, required) — ACF masterId to keep.
  - format `uuid`
- `targetMasterId` (`mergeAcfCustomerMasters.targetMasterId`; string, required) — ACF masterId to merge into sourceMasterId.
  - format `uuid`
- `reason` (`mergeAcfCustomerMasters.reason`; string, required) — Auditable reason for the merge.

## Example request

```json
{
  "sourceMasterId": "fc6918af-80d6-4ac6-bb6b-d490eba07bb2",
  "targetMasterId": "5d8777e4-f10d-4fb5-85a9-c6636d70a705",
  "reason": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.caretlegal.net/integrations/external-clients/customers/merge \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-organization-id: string' \
  --data '
{
  "sourceMasterId": "fc6918af-80d6-4ac6-bb6b-d490eba07bb2",
  "targetMasterId": "5d8777e4-f10d-4fb5-85a9-c6636d70a705",
  "reason": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.caretlegal.net/integrations/external-clients/customers/merge';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-organization-id': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({
    sourceMasterId: 'fc6918af-80d6-4ac6-bb6b-d490eba07bb2',
    targetMasterId: '5d8777e4-f10d-4fb5-85a9-c6636d70a705',
    reason: 'string'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.caretlegal.net/integrations/external-clients/customers/merge"

payload = {
    "sourceMasterId": "fc6918af-80d6-4ac6-bb6b-d490eba07bb2",
    "targetMasterId": "5d8777e4-f10d-4fb5-85a9-c6636d70a705",
    "reason": "string"
}
headers = {
    "Content-Type": "application/json",
    "x-organization-id": "string",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Masters merged

#### Example

```json
{
  "success": true,
  "data": {
    "sourceMasterId": "fc6918af-80d6-4ac6-bb6b-d490eba07bb2",
    "targetMasterId": "5d8777e4-f10d-4fb5-85a9-c6636d70a705",
    "merged": 0,
    "reason": "string",
    "initiatedBy": "string"
  }
}
```

- `success` (`mergeAcfCustomerMasters.response.200.success`; boolean, required)
- `data` (`mergeAcfCustomerMasters.response.200.data`; object, required)
  - `sourceMasterId` (`mergeAcfCustomerMasters.response.200.data.sourceMasterId`; string, optional)
    - format `uuid`
  - `targetMasterId` (`mergeAcfCustomerMasters.response.200.data.targetMasterId`; string, optional)
    - format `uuid`
  - `merged` (`mergeAcfCustomerMasters.response.200.data.merged`; integer, optional)
  - `reason` (`mergeAcfCustomerMasters.response.200.data.reason`; string, optional)
  - `initiatedBy` (`mergeAcfCustomerMasters.response.200.data.initiatedBy`; string, optional)

### 400

Invalid request

#### Example

```json
{
  "success": false,
  "error": "string",
  "details": [
    {}
  ]
}
```

- `success` (`mergeAcfCustomerMasters.response.400.success`; boolean, required)
- `error` (`mergeAcfCustomerMasters.response.400.error`; string, required)
- `details` (`mergeAcfCustomerMasters.response.400.details`; array<object>, optional)

### 401

Invalid API key

#### Example

```json
{
  "success": false,
  "error": "string",
  "details": [
    {}
  ]
}
```

- `success` (`mergeAcfCustomerMasters.response.401.success`; boolean, required)
- `error` (`mergeAcfCustomerMasters.response.401.error`; string, required)
- `details` (`mergeAcfCustomerMasters.response.401.details`; array<object>, optional)

### 403

Missing merge scope

#### Example

```json
{
  "success": false,
  "error": "string",
  "details": [
    {}
  ]
}
```

- `success` (`mergeAcfCustomerMasters.response.403.success`; boolean, required)
- `error` (`mergeAcfCustomerMasters.response.403.error`; string, required)
- `details` (`mergeAcfCustomerMasters.response.403.details`; array<object>, optional)


Source: https://staging.caretlegal.net/docs/reference/external-clients/mergeAcfCustomerMasters/index.md
