Preview a Contact Merge
curl --request POST \
--url https://api.monaco.com/v1/contacts/{contact_id}/merge/preview \
--header 'Content-Type: application/json' \
--data '
{
"source_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.monaco.com/v1/contacts/{contact_id}/merge/preview"
payload = { "source_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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'})
};
fetch('https://api.monaco.com/v1/contacts/{contact_id}/merge/preview', 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/preview",
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'
]),
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/preview"
payload := strings.NewReader("{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/preview")
.header("Content-Type", "application/json")
.body("{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/contacts/{contact_id}/merge/preview")
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}"
response = http.request(request)
puts response.read_body{
"data": {
"target_contact": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"linkedin_url": "<string>",
"title": "<string>",
"archived": false
},
"source_contact": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"linkedin_url": "<string>",
"title": "<string>",
"archived": false
},
"merged_contact": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"linkedin_url": "<string>",
"title": "<string>",
"archived": false
},
"fields_filled_from_source": [
"<string>"
],
"notes_appended": true,
"counts": {
"plays_moved": 123,
"user_tasks_moved": 123,
"tags_added": 123,
"audience_memberships_moved": 123,
"opportunity_links_moved": 123,
"custom_fields_filled": 123
},
"blocking_sequences": [
{
"sequence_id": "<string>",
"status": "<string>",
"contact": {
"id": "<string>",
"name": "<string>",
"email": "<string>"
},
"name": "<string>",
"campaign_name": "<string>"
}
],
"requires_sequence_stop": true
},
"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"
}
}Contacts
Preview a Contact Merge
Read-only preview of merging the contact source_contact_id into the contact in the path. Nothing is changed. Returns how the kept contact will look, which of its empty fields the source fills, what moves over (sequences, tasks, tags, audience memberships, opportunity links, custom field values) and the live sequences that would be stopped. Requires only the api:read scope.
Both contacts must be on the same account, and when both have an email or both have a LinkedIn URL those must match; otherwise the request is rejected with 422 merge_invalid and a message naming the rule.
POST
/
v1
/
contacts
/
{contact_id}
/
merge
/
preview
Preview a Contact Merge
curl --request POST \
--url https://api.monaco.com/v1/contacts/{contact_id}/merge/preview \
--header 'Content-Type: application/json' \
--data '
{
"source_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.monaco.com/v1/contacts/{contact_id}/merge/preview"
payload = { "source_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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'})
};
fetch('https://api.monaco.com/v1/contacts/{contact_id}/merge/preview', 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/preview",
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'
]),
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/preview"
payload := strings.NewReader("{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/preview")
.header("Content-Type", "application/json")
.body("{\n \"source_contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/contacts/{contact_id}/merge/preview")
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}"
response = http.request(request)
puts response.read_body{
"data": {
"target_contact": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"linkedin_url": "<string>",
"title": "<string>",
"archived": false
},
"source_contact": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"linkedin_url": "<string>",
"title": "<string>",
"archived": false
},
"merged_contact": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"linkedin_url": "<string>",
"title": "<string>",
"archived": false
},
"fields_filled_from_source": [
"<string>"
],
"notes_appended": true,
"counts": {
"plays_moved": 123,
"user_tasks_moved": 123,
"tags_added": 123,
"audience_memberships_moved": 123,
"opportunity_links_moved": 123,
"custom_fields_filled": 123
},
"blocking_sequences": [
{
"sequence_id": "<string>",
"status": "<string>",
"contact": {
"id": "<string>",
"name": "<string>",
"email": "<string>"
},
"name": "<string>",
"campaign_name": "<string>"
}
],
"requires_sequence_stop": true
},
"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"
}
}Path Parameters
Body
application/json
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.