curl --request POST \
--url https://api.monaco.com/v1/accounts/{account_id}/merge \
--header 'Content-Type: application/json' \
--data '
{
"source_account_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"confirm_sequence_stop": false
}
'import requests
url = "https://api.monaco.com/v1/accounts/{account_id}/merge"
payload = {
"source_account_ids": ["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_account_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
confirm_sequence_stop: false
})
};
fetch('https://api.monaco.com/v1/accounts/{account_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/accounts/{account_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_account_ids' => [
'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/accounts/{account_id}/merge"
payload := strings.NewReader("{\n \"source_account_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\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/accounts/{account_id}/merge")
.header("Content-Type", "application/json")
.body("{\n \"source_account_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"confirm_sequence_stop\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/accounts/{account_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_account_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"confirm_sequence_stop\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"target_account_id": "<string>",
"source_account_ids": [
"<string>"
],
"contacts_moved": 123,
"contacts_merged": 123,
"source_accounts_deleted": 123,
"source_accounts_already_merged": 123,
"opportunities_reassigned": 123,
"opportunities_deduped": 123,
"tags_added": 123,
"domains_moved": 123
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"completed_steps": [
"<string>"
],
"source_accounts_deleted": 123,
"blocking_sequence_count": 123
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"completed_steps": [
"<string>"
],
"source_accounts_deleted": 123,
"blocking_sequence_count": 123
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}Merge Accounts
Merges the accounts in source_account_ids into the account in the path. This is irreversible, like deleting an account: each source account is deleted, its contacts, opportunities, tasks, tags and domains move to the target, and its live sequences are stopped. Call preview_account_merge first.
When live sequences would be stopped the request is rejected with 409 sequence_stop_confirmation_required unless confirm_sequence_stop is true. If a merge fails part-way, 409 merge_failed says which steps already committed; retrying the same request resumes it. Retrying a merge that already completed succeeds with zero new changes and a positive source_accounts_already_merged count. source_account_ids in the response echo the ids as resolved at request time, so a retry that names an already-deleted source by its AccountICP id echoes that id rather than the account id.
curl --request POST \
--url https://api.monaco.com/v1/accounts/{account_id}/merge \
--header 'Content-Type: application/json' \
--data '
{
"source_account_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"confirm_sequence_stop": false
}
'import requests
url = "https://api.monaco.com/v1/accounts/{account_id}/merge"
payload = {
"source_account_ids": ["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_account_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
confirm_sequence_stop: false
})
};
fetch('https://api.monaco.com/v1/accounts/{account_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/accounts/{account_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_account_ids' => [
'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/accounts/{account_id}/merge"
payload := strings.NewReader("{\n \"source_account_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\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/accounts/{account_id}/merge")
.header("Content-Type", "application/json")
.body("{\n \"source_account_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"confirm_sequence_stop\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/accounts/{account_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_account_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"confirm_sequence_stop\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"target_account_id": "<string>",
"source_account_ids": [
"<string>"
],
"contacts_moved": 123,
"contacts_merged": 123,
"source_accounts_deleted": 123,
"source_accounts_already_merged": 123,
"opportunities_reassigned": 123,
"opportunities_deduped": 123,
"tags_added": 123,
"domains_moved": 123
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"completed_steps": [
"<string>"
],
"source_accounts_deleted": 123,
"blocking_sequence_count": 123
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"completed_steps": [
"<string>"
],
"source_accounts_deleted": 123,
"blocking_sequence_count": 123
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}Path Parameters
Body
IDs of the accounts to merge into the account in the path. Each is deleted when the merge is applied. At most 100 per request.
1 - 100 elementsSet to true only after the user approved stopping the live sequences the preview lists under blocking_sequences. Without it, a merge that would stop live sequences is rejected with sequence_stop_confirmation_required.