Blog - Engaging.io

HubSpot Daily/Burst API Limits: Taking it to the limit... and hitting it

Written by Ralph Vugts | May 3, 2024 2:50:49 AM

HubSpot Custom Coded workflow actions are an amazing piece of kit which help automate pretty much anything you can think of on the HubSpot platform. But... one downside is you will often need to use the HubSpot API to get the data you need or to create and update records... and these API's have some pesky limits. 

Over the years, we have created quite a few of these custom coded actions and have encountered quite a few issues when it comes to bulk enrollment of records into these workflows.  

The daily limit in particular can be quite brutal. Once you hit this limit you will no longer be able to make API calls until the quota resets at midnight. If you have some critical automations running, this can take a looooong time and cause a lot of data issues that can take even more time to identify and resolve. 

Below are a few tips on how to avoid and handle hitting the API limits on the HubSpot side to avoid any processing down time.

Alerts and getting a heads up on high usage

The easiest way to check your daily limit usage is to see where it's currently at under the Private Apps section in HubSpot:

The issue with this is you often do not know if someone has accidentally bulk enrolled thousands of records into a workflow that hits the API so you can be easily caught off guard as it's not realistic to be checking this multiple times per day. 

Luckily, there's an API available from HubSpot that allows you to check where your daily limit is up to

We then created a scheduled workflow to enroll a record every hour into a workflow that checks the daily limit. If it has gone beyond the limit we have defined, we then alert one of our Admins to check for any run away processes or workflows so we can fix the issue before we max out the daily limit.  

Use OAuth 2 / HubSpot APP tokens when possible!

OAuth 2 tokens do not work well with custom coded actions as they need to be refreshed every 30 minutes.

But if you are running any other integrations, we highly recommend creating a HubSpot APP and then using an OAuth 2 token instead to access the HubSpot APIs. 

The reason for this is OAuth 2 calls do not add to your daily limit count which makes these tokens ideal for any and all critical integrations.

If you exceed your daily limit via private app tokens the HubSpot APP will still function. 

Avoiding making API calls completely

Sometimes Devs make the mistake of using the API when the data is already available to the workflow action. This occurs when the record being enrolled already has all the data we need. 

In this scenario, our code can run and calculate what we need. We can also avoid making update API calls as well by returning the results back to the workflow as Data outputs:

Then, using the workflow action "Set property value" you can save this back to a HubSpot record without invoking an API call:

The burst limit!

This limit drives us crazy for any integration that needs to process a lot of records. When you are creating multiple objects and associating them together, the API calls start to add up pretty quickly. We have quite a few ways to handle this now... but my biggest piece of advice is to use batch API calls when possible. 

Batch API calls are not really practical for custom coded actions, however, as workflows process a single record at a time. The only real way to handle this is to catch when a burst limit error occurs and then throw an error back to the workflow. When this happens, the record will remain in the workflow and it will retry again at a later time.

HubSpot Import Tool - doing it the hard way

Painful... but sometimes necessary. If you have clients with millions of records, processing them via a custom coded action might not be a great idea. 

Sometimes it's best to export all the data, make bulk changes via Excel or Google Big Query and then import it all back into HubSpot. 

Often you can combine the 2 approaches. Perform a bulk update for existing records and have a custom coded action for new records only going forward from that point in time.

HubSpot add on / license upgrade

Sometimes you just need more. There is a HubSpot add on you can purchase that doubles your daily API call limit. I highly recommend this to clients with any critical custom integrations as the cost is quickly offset by any Admin or Developer time trying to resolve data issues if certain processes have not run as intended.