Get All Company Merges
curl --request GET \
--url https://api.affinity.co/v2/company-merges \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/company-merges"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.affinity.co/v2/company-merges', 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.affinity.co/v2/company-merges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.affinity.co/v2/company-merges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.affinity.co/v2/company-merges")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/company-merges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 12,
"status": "success",
"taskId": "789e0123-e45b-67c8-d901-234567890123",
"startedAt": "2025-06-03T10:30:00Z",
"primaryCompanyId": 12345,
"duplicateCompanyId": 67890,
"completedAt": "2025-06-03T10:32:15Z",
"errorMessage": null
},
{
"id": 13,
"status": "failed",
"taskId": "456e7890-1234-5678-9012-345678901234",
"startedAt": "2025-06-03T09:15:00Z",
"primaryCompanyId": 54321,
"duplicateCompanyId": 98765,
"completedAt": "2025-06-03T09:16:30Z",
"errorMessage": "Primary company not found"
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/companies/merge?cursor=eyJpZCI6NDU2ZTc4OTAtZTEyYi0zNGM1LWQ2NzgtOTAxMjM0NTY3ODkwfQ==",
"prevUrl": null
}
}{
"errors": [
{
"code": "bad-request",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authorization",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authentication",
"message": "<string>"
}
]
}Company Merges
Get All Company Merges
Retrieve paginated company merges for the organization.
Returns all company merges initiated by users in your organization, including their current
status, the companies involved, and merge details. You can filter company merges using the filter query parameter. The filter parameter is a string that you can specify conditions based on the following properties:
| Property Name | Type | Allowed Operators | Examples |
|---|---|---|---|
status | enum | = | status=in-progress, status=success, status=failed |
taskId | text | = | taskId=789e0123-e45b-67c8-d901-234567890123 |
Company merges are returned in reverse chronological order (most recent first).
Requires the “Manage duplicates” permission and organization admin role.
GET
/
v2
/
company-merges
Get All Company Merges
curl --request GET \
--url https://api.affinity.co/v2/company-merges \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/company-merges"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.affinity.co/v2/company-merges', 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.affinity.co/v2/company-merges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.affinity.co/v2/company-merges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.affinity.co/v2/company-merges")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/company-merges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 12,
"status": "success",
"taskId": "789e0123-e45b-67c8-d901-234567890123",
"startedAt": "2025-06-03T10:30:00Z",
"primaryCompanyId": 12345,
"duplicateCompanyId": 67890,
"completedAt": "2025-06-03T10:32:15Z",
"errorMessage": null
},
{
"id": 13,
"status": "failed",
"taskId": "456e7890-1234-5678-9012-345678901234",
"startedAt": "2025-06-03T09:15:00Z",
"primaryCompanyId": 54321,
"duplicateCompanyId": 98765,
"completedAt": "2025-06-03T09:16:30Z",
"errorMessage": "Primary company not found"
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/companies/merge?cursor=eyJpZCI6NDU2ZTc4OTAtZTEyYi0zNGM1LWQ2NzgtOTAxMjM0NTY3ODkwfQ==",
"prevUrl": null
}
}{
"errors": [
{
"code": "bad-request",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authorization",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authentication",
"message": "<string>"
}
]
}Authorizations
A static Affinity API key, presented as a bearer token.
Query Parameters
Cursor for the next or previous page
Number of items to include in the page
Required range:
1 <= x <= 100Filter company merges using Affinity Filtering Language
Was this page helpful?