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.
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.
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.