Associating objects
HubSpot provides an Associations API that lets you create relationships between two objects (e.g., contacts and deals, companies and tickets). To use it, you must supply:
The object IDs of both items you want to associate.
The appropriate association type ID, which varies depending on the specific object types involved (e.g., contact-to-deal, deal-to-company).
This allows you to programmatically link records and maintain relational context across your CRM data.
Using Hubspot workflows to associate objects
Finding the object IDs needed for associations can be API-intensive, often requiring multiple lookups. To reduce this load and streamline your Middle workflow, you can offload the association step to a HubSpot workflow.
We recommend using a unique identifier, such as external_customer_id
, to link objects. By referencing this unique property, HubSpot workflows can associate records without requiring your integration to perform direct ID lookups.

We also recommend creating a dedicated workflow for each object type you intend to associate. This ensures associations are applied regardless of the order in which the objects are created.
For example, if you're associating Deals and Contacts, you should create two separate workflows:
One that triggers when a Deal is created or when an
external_customer_id
is added.Another that triggers when a Contact is created or when its
external_customer_id
is added.
This approach ensures that the association is made as soon as both objects have matching identifiers, even if they’re created at different times.
Last updated
Was this helpful?