curl --request GET \
--url https://api.affinity.co/v2/duplicates/company-suggestions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/duplicates/company-suggestions"
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/duplicates/company-suggestions', 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/duplicates/company-suggestions",
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/duplicates/company-suggestions"
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/duplicates/company-suggestions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/duplicates/company-suggestions")
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": "12345",
"primaryProfile": {
"id": 1,
"name": "Horizon Technologies",
"domain": "horizontech.com",
"domains": [
"horizontech.com"
],
"isGlobal": true,
"isEnriched": true
},
"duplicateProfiles": [
{
"id": 1,
"name": "Horizon Technologies",
"domain": "horizontech.com",
"domains": [
"horizontech.com"
],
"isGlobal": true,
"isEnriched": true
}
],
"matchCriteria": "domain-match"
}
],
"pagination": {
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw",
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"totalCount": 42
}
}{
"errors": [
{
"code": "bad-request",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authorization",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authentication",
"message": "<string>"
}
]
}Get All Company Duplicate Suggestions
| ⚠️ This endpoint is currently in BETA |
|---|
Retrieves company duplicate suggestions detected for your organization.
Each suggestion contains a recommended primaryProfile and a duplicateProfiles array
containing the single company profile Affinity has identified as a likely duplicate, along
with the matchCriteria that produced the suggestion. The full company payload is returned
for both sides so that an automated agent can evaluate the suggestion without additional
lookups.
Only actionable suggestions are returned: pairs that have no feedback recorded yet (not merged, not marked as not-duplicates, and not skipped) and whose underlying company profiles are still active and eligible to be merged. Suggestions that have already been acted on are omitted.
You can narrow the results using the filter query parameter, which accepts the Affinity
Filtering Language. The filterable properties are:
| Property Name | Type | Allowed Operators | Examples |
|---|---|---|---|
matchCriteria | enum | = | matchCriteria=name, matchCriteria=domain-redirect, matchCriteria=domain-match |
To act on a suggestion, call POST /v2/company-merges with the id of the primaryProfile
and the id of the entry in duplicateProfiles.
Once the merge is applied, the suggestion stops being returned by this endpoint immediately. Marking the pair as not duplicates has the same permanent effect. There is currently no way to retrieve a suggestion after either action.
Skipping a suggestion is not permanent and works differently. It hides a name match
suggestion from the user who skipped it for two weeks, after which the suggestion is returned
again. It does not change what other users see, and it does not apply to the other match
criteria.
Requires the “Manage duplicates” permission, which is granted to organization admins.
curl --request GET \
--url https://api.affinity.co/v2/duplicates/company-suggestions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/duplicates/company-suggestions"
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/duplicates/company-suggestions', 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/duplicates/company-suggestions",
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/duplicates/company-suggestions"
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/duplicates/company-suggestions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/duplicates/company-suggestions")
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": "12345",
"primaryProfile": {
"id": 1,
"name": "Horizon Technologies",
"domain": "horizontech.com",
"domains": [
"horizontech.com"
],
"isGlobal": true,
"isEnriched": true
},
"duplicateProfiles": [
{
"id": 1,
"name": "Horizon Technologies",
"domain": "horizontech.com",
"domains": [
"horizontech.com"
],
"isGlobal": true,
"isEnriched": true
}
],
"matchCriteria": "domain-match"
}
],
"pagination": {
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw",
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"totalCount": 42
}
}{
"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
1 <= x <= 100When true, include the total count of the collection in the pagination response
Free-text search term to filter suggestions by company name
2Filter company duplicate suggestions using Affinity Filtering Language
Properties to order the results by. Prefix with - for descending order. Repeat the parameter to order by multiple properties.
name, -name, createdAt, -createdAt Was this page helpful?