Retrieving Auto-Associated Company after Contact POST

I am currently using the HubSpot API to POST new contacts from our application to HubSpot to empower Marketing. However, we have the Auto-Associate Contacts with Companies feature turned on so after a contact is created, HubSpot works to find or create a company with some basic details based off the contacts email domain or website. After a contact is created, I need to retrieve that company ID to store in our system, ideally within the same request so that I have a correlation between the request and the company.

Is there a way to do this? Currently I have a wait 2 seconds clause in the code to wait for HubSpot to do the link before re-querying companies associated with the new contact.

@JCzepil ,

There is no way to do this in one call. A possible alternative is to set up a webhook to subscribe to contact property changes. Specifically, associatedcompanyid.

Alright, good to know. Yeah, I was reading into the webhooks and trying to decide if that might be a good path moving forward.

Thanks for the info.