Save HubSpot company mapping
Selects household or organization_donor target, saves name-matching preference and approves the next company mapping while superseding previous company targets. source_of_truth defaults to bidirectional; omitted company_match_by_name preserves its stored value. Does not import or send company records. Requires the integration platform global/configured client feature gate (normally integration_platform_foundation). Requires permission: one of access_account_settings.
curl --request POST \
--url https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"company_target_mode": "household",
"source_of_truth": "provider",
"company_match_by_name": true
}
'import requests
url = "https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping"
payload = {
"company_target_mode": "household",
"source_of_truth": "provider",
"company_match_by_name": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_target_mode: 'household',
source_of_truth: 'provider',
company_match_by_name: true
})
};
fetch('https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping', 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.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping",
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([
'company_target_mode' => 'household',
'source_of_truth' => 'provider',
'company_match_by_name' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping"
payload := strings.NewReader("{\n \"company_target_mode\": \"household\",\n \"source_of_truth\": \"provider\",\n \"company_match_by_name\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"company_target_mode\": \"household\",\n \"source_of_truth\": \"provider\",\n \"company_match_by_name\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_target_mode\": \"household\",\n \"source_of_truth\": \"provider\",\n \"company_match_by_name\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"connection": {
"id": 42,
"target_context_json": {
"donor_hysform_id": 42,
"company_target_mode": "household",
"allow_email_match": true,
"company_match_by_name": true,
"activity_sync_enabled": true,
"activity_types": [
"note"
],
"activity_link_policy": "matched_only",
"activity_body_visibility": "team",
"deal_sync_enabled": true,
"deal_stage_ids": [
"<string>"
],
"product_sync_enabled": true,
"product_program_ids": [
42
],
"product_field_mapping": {
"name": "Example",
"description": "Example",
"price": "Example",
"sku": "Example"
},
"product_program_field_mappings": {},
"deal_outbound_enabled": true,
"deal_outbound_pipeline_id": "Example",
"deal_outbound_stage_id": "Example"
}
},
"mapping": {
"id": 42,
"connection_id": 42,
"provider_key": "hubspot",
"hys_object_type": "Example",
"provider_object_type": "Example",
"mapping_version": 2,
"status": "Example",
"source_of_truth_json": {},
"mapping_json": {},
"defaults_json": {},
"metadata_json": {},
"approved_at": "2023-11-07T05:31:56Z"
}
},
"message": "Example"
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Connection id in the current organization.
Body
Validated request fields for this operation.
Company target mode. Validation: required; allowed values: household, organization_donor.
household, organization_donor "household"
Source of truth. Validation: nullable; allowed values: provider, hys, bidirectional.
provider, hys, bidirectional, null "provider"
Company match by name. Validation: nullable, boolean.
true
curl --request POST \
--url https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"company_target_mode": "household",
"source_of_truth": "provider",
"company_match_by_name": true
}
'import requests
url = "https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping"
payload = {
"company_target_mode": "household",
"source_of_truth": "provider",
"company_match_by_name": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_target_mode: 'household',
source_of_truth: 'provider',
company_match_by_name: true
})
};
fetch('https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping', 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.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping",
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([
'company_target_mode' => 'household',
'source_of_truth' => 'provider',
'company_match_by_name' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping"
payload := strings.NewReader("{\n \"company_target_mode\": \"household\",\n \"source_of_truth\": \"provider\",\n \"company_match_by_name\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"company_target_mode\": \"household\",\n \"source_of_truth\": \"provider\",\n \"company_match_by_name\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/hubspot/company-mapping")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_target_mode\": \"household\",\n \"source_of_truth\": \"provider\",\n \"company_match_by_name\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"connection": {
"id": 42,
"target_context_json": {
"donor_hysform_id": 42,
"company_target_mode": "household",
"allow_email_match": true,
"company_match_by_name": true,
"activity_sync_enabled": true,
"activity_types": [
"note"
],
"activity_link_policy": "matched_only",
"activity_body_visibility": "team",
"deal_sync_enabled": true,
"deal_stage_ids": [
"<string>"
],
"product_sync_enabled": true,
"product_program_ids": [
42
],
"product_field_mapping": {
"name": "Example",
"description": "Example",
"price": "Example",
"sku": "Example"
},
"product_program_field_mappings": {},
"deal_outbound_enabled": true,
"deal_outbound_pipeline_id": "Example",
"deal_outbound_stage_id": "Example"
}
},
"mapping": {
"id": 42,
"connection_id": 42,
"provider_key": "hubspot",
"hys_object_type": "Example",
"provider_object_type": "Example",
"mapping_version": 2,
"status": "Example",
"source_of_truth_json": {},
"mapping_json": {},
"defaults_json": {},
"metadata_json": {},
"approved_at": "2023-11-07T05:31:56Z"
}
},
"message": "Example"
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}