Now you can track your HubSpot limits with the CRM Limits API!

Brooke from HubSpot walks through the new CRM Limits API, which lets you check your data limits programmatically before bulk imports or custom object creation. Use Postman and private apps to monitor limits and avoid hitting your cap.
Hey y', all, It's Brooke with HubSpot. Today I'm going to show you how to use the new CRM Limits API. This API gives you access to the limits on your CRM data in your account. Now you can make calls to get how many CRM records, associations, custom properties and pipelines you have left. Your limits will be determined by your tier. So why should you use this API? A great example would be using this API to make a check before running a bulk import into your account so that you don't run over your limits. All right, let's take a look at how this works. First, let's go into our HubSpot account and see where you can see all of this limits information. So, in your HubSpot account, in the main left hand navigation, you're going to go ahead and click on Data Management and then click on Data Management Data Model. The Data Model page will show you all the information on your CRM objects, your custom objects, your activities and more. And if you click on the Limits tab, you'll be able to see your record limits broken down by objects, associations from your custom properties, association labels and custom Object Limit. All of this is great if you're an admin and you want to make sure that you're not hitting your limits. But doing this programmatically is made easier with the CRM Limits API. So to show you how to make these calls, we're going to use Postman to make some simple get requests. First, we need to set up a private app. So in our top navigation, we're going to click on the settings icon and then we're going to go over to Integrations and then click on private Apps. Here in the top right hand, we're going to click on Create a Private App. We'll go with a name of CRM limits and then our scopes. The scopes are going to be based on what information you want to get. So if you want to get the limits for the custom objects, you'll need to choose that. And if you want to get the limits for different CRM objects, you'll need to choose each of those. So all the scopes are granular to what you want. So for this one, let's add a new scope and let's go ahead and get the contacts. Read and write. We're not going to get the sensitive data, we're going to get companies again, just read and write for that. And let's do our custom objects as well. Read and write. And lastly, let's get our deals object so we'll just get the read and write for our deals object and then once we're done with that, we're going to click on update. And now it'll have all of the scopes that you have added. You can also go ahead and delete any of them if you don't need them. And. And now let's go ahead and create app. This will say make sure to share this token safely. Don't put it in your online repo, continue creating. And now we're going to go ahead and get that token. So now we're going to go over to Postman. Inside of Postman we're just going to go ahead and click on the plus icon and we're going to do a new untitled request. And now we're going to go into authorization first because we have our token and instead of inherit auth from parent, we're going to choose bearer token. And then inside of here is where you're going to put in your private app token. So for this API we won't need any params, we'll just need the git URL. So let's go into the documentation to see the different URLs we can call. Let's go ahead and choose the read records limits. And all we have to do is just click on the copy the full URL. Now let's go back over to Postman. Inside of Postman we just go ahead and paste that and this will call all of the limits for our records and we'll just click send. And then in our response we got a 200, which means that it was good. And what it will show you is an object that has an array of your different object types. So it'll give you the type ID as well as the human readable label. It will tell you the limit. And we only have three here, so our percentage is not even 1%. Same with the context. Our limit's pretty high, so our percentage is pretty low. Same with deals. And then outside of this array, then we move on to our custom object types. This will show you the overall limit, overall usage, how many records you have, and overall percentage. And then it will show you breakdown by object type if you have multiple different custom objects. Now, if you want to see how many custom objects you have available to create, we can go ahead and call that API. If we go to the read custom objects limit here, we can just go ahead and copy this over and go back to Postman. Inside of Postman, we're just going to go ahead and paste that in and then we will send it along. So now this one is a lot smaller, but it will show you the limit of how many custom objects you can create. In this case we had 20 usage, we only have one and so that will show you our percentage is 5%. Alright, so that's how you use the new CRM limits API to see the different limits in your HubSpot account so that you don't run into any issues when importing data or making new custom objects. Make sure to like this video. Subscribe to the HubSpot Developers YouTube channel and I'll see y' all in another video. Bye y'. All. Bye bye.










