curl --request POST \
--url https://api.monaco.com/v1/contacts/{contact_id}/merge \
--header 'Content-Type: application/json' \
--data '
{
"source_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirm_sequence_stop": false
}
'import requests
url = "https://api.monaco.com/v1/contacts/{contact_id}/merge"
payload = {
"source_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirm_sequence_stop": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
source_contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
confirm_sequence_stop: false
})
};
fetch('https://api.monaco.com/v1/contacts/{contact_id}/merge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.monaco.com/v1/contacts/{contact_id}/merge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'confirm_sequence_stop' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.monaco.com/v1/contacts/{contact_id}/merge"
payload := strings.NewReader("{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirm_sequence_stop\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.monaco.com/v1/contacts/{contact_id}/merge")
.header("Content-Type", "application/json")
.body("{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirm_sequence_stop\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/contacts/{contact_id}/merge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirm_sequence_stop\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"target_contact_id": "<string>",
"source_contact_id": "<string>",
"plays_moved": 123,
"user_tasks_moved": 123,
"tags_merged": 123,
"fields_filled_from_source": [
"<string>"
],
"audience_memberships_moved": 123,
"opportunity_links_moved": 123,
"custom_fields_filled": 123,
"sequences_stopped": [
"<string>"
],
"sequences_dismissed": [
"<string>"
],
"deleted_at": "2023-11-07T05:31:56Z"
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"blocking_sequence_count": 123
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"blocking_sequence_count": 123
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}Merge Contacts
Merges the contact source_contact_id into the contact in the path. This is irreversible, like deleting a contact: the source contact is deleted, the kept contact’s empty fields are filled from it, its notes are appended, its sequences, tasks, tags, audience memberships, opportunity links, custom field values move to the kept contact, and its live sequences are stopped.
When live sequences would be stopped the request is rejected with 409 sequence_stop_confirmation_required unless confirm_sequence_stop is true. The merge runs in one transaction: on 422 merge_failed nothing was changed. Retrying a merge that already completed returns 404, because the source contact no longer exists.
curl --request POST \
--url https://api.monaco.com/v1/contacts/{contact_id}/merge \
--header 'Content-Type: application/json' \
--data '
{
"source_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirm_sequence_stop": false
}
'import requests
url = "https://api.monaco.com/v1/contacts/{contact_id}/merge"
payload = {
"source_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirm_sequence_stop": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
source_contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
confirm_sequence_stop: false
})
};
fetch('https://api.monaco.com/v1/contacts/{contact_id}/merge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.monaco.com/v1/contacts/{contact_id}/merge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'confirm_sequence_stop' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.monaco.com/v1/contacts/{contact_id}/merge"
payload := strings.NewReader("{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirm_sequence_stop\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.monaco.com/v1/contacts/{contact_id}/merge")
.header("Content-Type", "application/json")
.body("{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirm_sequence_stop\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/contacts/{contact_id}/merge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirm_sequence_stop\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"target_contact_id": "<string>",
"source_contact_id": "<string>",
"plays_moved": 123,
"user_tasks_moved": 123,
"tags_merged": 123,
"fields_filled_from_source": [
"<string>"
],
"audience_memberships_moved": 123,
"opportunity_links_moved": 123,
"custom_fields_filled": 123,
"sequences_stopped": [
"<string>"
],
"sequences_dismissed": [
"<string>"
],
"deleted_at": "2023-11-07T05:31:56Z"
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"blocking_sequence_count": 123
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"blocking_sequence_count": 123
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}Path Parameters
Body
ID of the contact to merge into the contact in the path. It is deleted when the merge is applied. Both contacts must be on the same account.
Confirms that the live sequences listed under blocking_sequences in the preview may be stopped. Without it, a merge that would stop live sequences is rejected with sequence_stop_confirmation_required.