We have our ordering tool synced with Hubspot via API calls.
We hit every second day the limit of 10 api calls per second (eg. when 2 customers order at the same moment)
We don't have a throttle system in place as it will just postpone the problem in our opinion (eg. if we retry 2 seconds later, and this is going on over days. We might end up with a deal being updated 1 day after it was actually closed in our ordering tool or every deals being postponed couple of seconds depending on how we set it up).
First and foremost, you should use batch calls as much as possible when creating or updating contact records, and when updating company and deal records.
Why do you need to read the contact profile in a separate call? If you use this endpoint to create the record, it will return the contact's details upon success, including the vid.
Why do you update the hubspot_owner_id in its own call? This property can be set when you first create the contact.
With the vid and companyId, you can then create the deal and associate it with both the contact and company in just one call. In total, that is only three calls to create and associate a contact, company, and deal.
Consider adding multiple products to a single deal (order) instead of creating multiple deals for the same customer. This could save even more calls.
Very clear. Thank you very much.
We would very much like to keep the automation of Hubspot creating the companies for us. But with your inputs we will be able to reduce the number of call from 6 to 5 (3 for contacts & deal + 2 for companies associations) so at least two deals can be saved at the same time.
First and foremost, you should use batch calls as much as possible when creating or updating contact records, and when updating company and deal records.
Why do you need to read the contact profile in a separate call? If you use this endpoint to create the record, it will return the contact's details upon success, including the vid.
Why do you update the hubspot_owner_id in its own call? This property can be set when you first create the contact.
With the vid and companyId, you can then create the deal and associate it with both the contact and company in just one call. In total, that is only three calls to create and associate a contact, company, and deal.
Consider adding multiple products to a single deal (order) instead of creating multiple deals for the same customer. This could save even more calls.
Thanks for your reply. Yes we are hitting the 10 api calls per second limit.
We are not using batch calls nor workflows or webhook at the moment.
What we do is that each time a deal gets created or saved again on our order form we trigger 6 api calls:
1.upsertContact(lineup)
2. .(this::fetchContact) // read contact profile
3. .thenCompose(contactJson -> updateContactOwner(lineup, contactJson))
4. .thenCompose(contactId -> doUpsertDeal(lineup, price, contactId))
And we are looking into adding a call for associating the company as well which will be at least 2 more calls.
=> these would mean that if two deals get saved/ordered in the same second: we reach the api limit.
=> this is happening every second day (we have roughly 850 deal created or saved every day)
Hubspot ID 4840334
We use API key only.
Thank you so much in advance for your help / recommendation.
I understand you're hitting the "SECONDLY" limit. Can you let me know which practices from this article you are currently using? For example, are you using any of the batch contact, company, or deal endpoints?
What is your Hub ID? Does your tool use your account's API key or is it an OAuth app? If it is an app, what is your app ID?