ContactAssociations
Returns object IDs associated with specific contacts, enabling management of contact relationships to deals and other objects.
Table-Specific Information
SELECT
The ContactAssociations table always includes the same set of columns, but some return NULL unless you filter by Id and Type, which allows the connector to retrieve full association details.
To return full details for Contact associations, filter by both the Contact Id and the association Type. The Type identifies the associated object (such as a Deal, Company, or Ticket).
For example:
-- Retrieve all fields for associations between a specific Contact and its Deals
SELECT *
FROM ContactAssociations
WHERE Id = '3432' -- Contact Id
AND Type = 'Deal'; -- Associated object type
Note: Fetching all fields can cause a reduction in performance, as it requires the connector to make requests for each Contact.
INSERT
To add a new association between a Contact and another record, provide the Contact Id,
the associated object's Id, and the associated object Type.
For custom association types, also include TypeId and Category.
-- Insert a new Contact-Deal association
INSERT INTO ContactAssociations (Id, AssociationId, Type)
VALUES ('3432', '34654', 'Deal');
-- Insert a custom Contact-Deal association
INSERT INTO ContactAssociations (Id, AssociationId, Type, TypeId, Category)
VALUES ('3432', '34654', 'Deal', '1', 'USER_DEFINED');
DELETE
To remove a Contact association, include the Contact Id, the associated object Id,
and the association Type. For custom objects, you must specify the object's
FullyQualifiedName as the Type. For custom association types, also include
TypeId and Category.
-- Delete a Contact-Deal association
DELETE FROM ContactAssociations
WHERE Id = '3432' -- Contact Id
AND AssociationId = '34654' -- Deal Id
AND Type = 'Deal';
-- Delete a Contact-custom object association
DELETE FROM ContactAssociations
WHERE Id = '3432'
AND AssociationId = '9999'
AND Type = 'customobject_myobject'; -- FullyQualifiedName
-- Delete a custom Contact-Deal association
DELETE FROM ContactAssociations
WHERE Id = '3432'
AND AssociationId = '34654'
AND Type = 'Deal'
AND TypeId = '1'
AND Category = 'USER_DEFINED';
Columns
| Name | Type | ReadOnly | References | Filterable | Description |
| Id [KEY] | Long | False |
Contacts.Id | False |
Unique identifier for the contact. |
| AssociationId [KEY] | Long | False | False |
Identifier of the object that this contact is associated with, such as a deal or company. | |
| Type [KEY] | String | False | False |
The type of the associated object, such as contact, deal, company, or ticket. | |
| TypeId [KEY] | String | False |
AssociationsLabels.TypeId | False |
The numeric ID representing the association type. This field is blank for general associations queries. |
| Category [KEY] | String | False |
AssociationsLabels.Category | False |
The category of the association type for the specified object pair. This field is blank for general associations queries. |
| TypeLabel | String | True |
AssociationsLabels.Label | False |
The label that describes the relationship between the contact and the associated object. |