Adding Associations to Objects

I’m working on a script to import my company’s data into Hubspot using the Hubspot Node package. I’m generating custom object types, properties, and association types programmatically whenever one is encountered that doesn’t yet exist in Hubspot.

When running a test for creating a custom association type I noticed that the response included 2 new associations:

CollectionResponseAssociationSpecWithLabelNoPaging {

results: [

AssociationSpecWithLabel {

category: ‘USER_DEFINED’,

typeId: 34,

label: ‘Test Company to Contact Association’

},

AssociationSpecWithLabel {

category: ‘USER_DEFINED’,

typeId: 33,

label: ‘Test Company to Contact Association’

}

]

}

My question is: When adding an association to a record do I need to add an association of each type to the respective objects, or does the API generate the inverse association automatically the way it generated the inverse of the association type I created?

If this was confusing I can provide examples of each possibility.

Thanks,

Skylar

Hi @SMacias,

The API will automatically add the other coresponding associations when you create one. For a few examples, when you set up a contact to compnay association the inverse will be implicitly created. Or when you create a labeled association the unlabeled association will be created as well.

Best,