CompanyAssociations
Returns object IDs associated with specific companies, useful for managing associations to deals and other CRM objects.
Table-Specific Information
SELECT
The CompanyAssociations table includes a fixed set of columns, but some return NULL unless you filter by Id and Type which allows the driver to retrieve full association details.
To return full details for Company associations, filter by both the Company Id and the association Type.
The Type identifies the associated object (such as a Deal, Contact, or Ticket).
-- Retrieve all fields for associations between a specific Company and its Deals
SELECT *
FROM CompanyAssociations
WHERE Id = '436648510605' -- Company Id
AND Type = 'Deal'; -- Associated object type
Note: Fetching all fields can cause a reduction in performance, as it requires the driver to make requests for each Company.
Filtering by multiple Company Id values with IN, combined with the association Type, retrieves associations for up to 1,000 Companies in a single batched request instead of one request per Company. The driver splits IN lists larger than 1,000 values into additional batched requests automatically.
-- Retrieve associations for multiple Companies in a single batched request
SELECT *
FROM CompanyAssociations
WHERE Id IN ('436648510605', '436648510606', '436648510607')
AND Type = 'Deal';
DELETE
To remove a Company association, include both the Company Id and the association Type:
-- Delete a Company-Deal association
DELETE FROM CompanyAssociations
WHERE Id = '436648510605' -- Company Id
AND Type = 'Deal'; -- Associated object type
Columns
| Name | Type | ReadOnly | References | Filterable | Description |
| Id [KEY] | Long | False |
Companies.Id | False |
Unique identifier of the company object involved in the association. |
| AssociationId [KEY] | Long | False | False |
Unique identifier of the object associated with the company, such as a contact, deal, or ticket. | |
| Type [KEY] | String | False | True |
Type of the associated object, such as contact, deal, or ticket. | |
| TypeId [KEY] | String | False |
AssociationsLabels.TypeId | False |
Numeric ID representing the specific association type between the company and the associated object. Empty for generic association queries. |
| Category [KEY] | String | False |
AssociationsLabels.Category | False |
Category describing the association relationship between the company and the associated object. Empty for generic association queries. |
| TypeLabel | String | True |
AssociationsLabels.Label | False |
Label name representing the association relationship between the company and the associated object. |