Add association while adding a new hubspot object entry

Is there any option to pass the associations while creating a HubSpot object entry

Eg: Add association to a company while creating a new deal entry.

There are separate APIs given in the API documentation for creating an object and then adding an association for that object. But it will be great if this can be done with a single API. As then a single API can be used and it will also simplify the retry policies.

@zaklein , what are your thoughts here :grinning_face:

Hi @hari0

Unfortunately not. As far as I’m aware (I could be wrong), no resources available under HubSpot’s CRM API allow for association at the same time as record create/update.

The 1 exception within HubSpot’s API ecosystem I’m aware of exists in Ecommerce Bridge. With Ecommerce Bridge, it is possible to create/update a record while associating it with other records in 1 call. However, obviously this will likely only be a viable option if you’re working with e-commerce data.

All the best,

Zach

Hi @zaklein ,

Thanks for the reply, I couldn’t find any way either from the API specifications.

Regards Hari

Hi @hari0 ,

Webdew :
No, you don’t have to do this with single api of these object. You have to use both api’s, for object create “https://legacydocs.hubspot.com/docs/methods/contacts/create_contact” for association use “https://legacydocs.hubspot.com/docs/methods/crm-associations/associate-objects
Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regards.

Hi @webdew ,

Thanks for the reply.

I think i didn’t convey the intent behind the question properly.

Yes, I know that we can create an object with an API call and then use another to create the associations.

What I was asking was whether this was possible with a single API call. This way we can reduce the overall calls to HubSpot and also simplify error management for the caller, say when just the first call was a success and subsequent ones a failure.

Thanks

Hari