APIs & Integrations

TestingTime
Participant

API Call Limit per seconds

SOLVE

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

Do you have any recommendation?

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

API Call Limit per seconds

SOLVE

Thank you for that information, @Cosima_Lefranc.

I see several potential efficiency improvements:

  • 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.
  • There is an automatic setting which creates and associates companies in the CRM. If this feature does not fit your use case and you must create the company via the API, do so before creating the deal. If you create the company with this endpoint, it will return the companyId and you won't need to retrieve it.
  • 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.

Let me know your thoughts.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
TestingTime
Participant

API Call Limit per seconds

SOLVE

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.

IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

API Call Limit per seconds

SOLVE

Thank you for that information, @Cosima_Lefranc.

I see several potential efficiency improvements:

  • 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.
  • There is an automatic setting which creates and associates companies in the CRM. If this feature does not fit your use case and you must create the company via the API, do so before creating the deal. If you create the company with this endpoint, it will return the companyId and you won't need to retrieve it.
  • 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.

Let me know your thoughts.

Isaac Takushi

Associate Certification Manager
0 Upvotes
TestingTime
Participant

API Call Limit per seconds

SOLVE

HI Isaac,

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.

Cosima

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

API Call Limit per seconds

SOLVE

Welcome, @Cosima_Lefranc.

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?

Isaac Takushi

Associate Certification Manager
0 Upvotes