The Complete Developer's Guide to HubSpot API Integration: Features, Limits, and Best Practices

Written by: Danish
Date May 21, 2026
8 min Read
The Complete Developer's Guide to HubSpot API Integration: Features, Limits, and Best Practices
Table of contents

Introduction

If you have ever wanted your CRM, marketing tools, ERP, and custom applications to communicate with each other seamlessly, the HubSpot API is where that conversation begins. For developers and businesses alike, HubSpot's API ecosystem is one of the most powerful bridges available today, connecting your existing tech stack to one of the world's leading CRM platforms without forcing you to abandon the tools you already rely on.

But understanding how the HubSpot API actually works, where to find your API key, what rate limits apply, and how to avoid the most common integration pitfalls is a different challenge entirely. This guide covers all of it, from the fundamentals of HubSpot API documentation to advanced best practices for developers building production-grade integrations.

Whether you are evaluating HubSpot as a CRM company on marketing APIs, or you are a developer actively troubleshooting HubSpot API connection errors, this resource is built for you.

What Is the HubSpot API?

The HubSpot API is a set of RESTful interfaces that give developers programmatic access to all the data and functionality inside the HubSpot platform. Using standard HTTP requests, you can read and write contacts, companies, deals, tickets, forms, marketing emails, workflows, and much more without touching HubSpot's user interface at all.

The API uses JSON for data exchange and supports standard HTTP methods: GET to retrieve data, POST to create records, PATCH to update them, and DELETE to remove them. This makes it compatible with virtually any programming language or framework, such as Python, Node.js, PHP, Ruby, Java, or any environment capable of making HTTP requests.

The full HubSpot API documentation lives at developers.hubspot.com, and it covers every available endpoint, request parameter, response format, and authentication method in detail. Bookmarking it is non-negotiable if you plan to build anything serious with the HubSpot API.

Already using HubSpot and want to see how integrations work in practice? Read How Webdew Helped a Client Automate Deals, Workflows, and Email Marketing for a real-world example.

Where to Get Your HubSpot API Key

Before any integration can communicate with HubSpot, it needs a way to authenticate. HubSpot currently supports two primary authentication mechanisms: private app access tokens and OAuth.

Private App Access Tokens are the recommended method for most custom integrations. To generate one, log into your HubSpot account, navigate to Settings, then open the Integrations menu and select Private Apps. Click "Create a private app," give it a name, define its required scopes, essentially the specific HubSpot data it is allowed to read or write, and HubSpot will generate an access token. You pass this token in the Authorization header of every API request.

OAuth 2.0 is the right choice when you are building a public app or an integration that other HubSpot users will install on their own accounts. OAuth allows users to grant your app specific permissions without sharing their credentials. The flow involves redirecting users to HubSpot's authorization page, capturing the authorization code, and exchanging it for an access token and a refresh token. Because access tokens expire, your application needs logic to use the refresh token to obtain a new one automatically.

The legacy API key method a simple alphanumeric key generated from account settings, has been deprecated by HubSpot. If you are working with an older integration that still relies on it, migrating to a private app token is strongly recommended for both security and continued compatibility.

Want to understand the full HubSpot CRM before building on top of it? See The Definitive Guide to Getting Started with HubSpot CRM for a comprehensive overview.

HubSpot Marketing API Features

When businesses evaluate the CRM company HubSpot on marketing APIs, one thing becomes clear quickly: the breadth of available endpoints goes well beyond basic contact management. The HubSpot marketing APIs cover almost every touchpoint in the marketing lifecycle. Here is what the most commonly used ones let you do:

Contacts and CRM API — Create, update, and delete contact records. Search and filter contacts by any property. Associate contacts with companies, deals, or tickets. This is the foundation most integrations are built on.

For businesses managing highly specific datasets beyond standard contacts or deals, HubSpot also supports custom objects through its API framework. Learn how to Create Custom Objects in HubSpot Using API to structure and manage unique business data efficiently.

Forms API — Submit form entries programmatically, retrieve form definitions, and embed forms on third-party websites without using HubSpot's native embed code. This is especially useful when your website runs on a custom framework that needs to pass lead data directly into HubSpot.

Marketing Email API — Create and send marketing emails, clone existing campaigns, retrieve performance metrics including open rates and click rates, and manage subscription preferences at the contact level.

Workflows API — Enroll and unenroll contacts from automation workflows via API. This is particularly powerful for triggered actions that originate in external systems — for example, enrolling a lead in a nurture sequence when they complete a step in your product.

Analytics and Reporting API — Pull campaign performance data, traffic analytics, and attribution reports into your own dashboards or data warehouse without relying on HubSpot's native reporting UI.

Webhooks — Rather than polling the API for changes, HubSpot webhooks push real-time notifications to your endpoint when specific events occur — a contact property changes, a deal moves to a new stage, a form is submitted. This dramatically reduces unnecessary API calls and keeps your integration responsive.

HubSpot CAPI (Conversions API) — HubSpot's Conversions API (CAPI) allows businesses to send conversion events directly from their server rather than relying solely on browser-side tracking. This is increasingly important as third-party cookies disappear, since server-side events are not affected by ad blockers or browser privacy settings.

HubSpot API Limits: What You Need to Know

Understanding HubSpot API limits is one of the most critical aspects of building a stable integration. HubSpot enforces both burst limits, maximum requests within a short window, and daily limits that cap total usage over 24 hours.

For public apps distributed through the HubSpot marketplace using OAuth, the limit is 110 requests every 10 seconds per connected account. For private apps, the limits vary by subscription tier. Professional and Enterprise accounts receive significantly higher daily allowances, with some tiers supporting up to 1,000,000 API calls per day. The CRM Search API has a separate, stricter limit of 4 requests per second, which can surprise developers who use it heavily for filtered queries.

When you exceed these limits, HubSpot returns a 429 status code "Too Many Requests." The response body will tell you whether you hit the burst limit or the daily cap, and HubSpot includes rate limit headers in every response so your application can monitor how close it is to the threshold in real time.

HubSpot API limitations also extend beyond call volume. Certain endpoints have data-specific constraints: bulk import files have size caps, certain object associations have maximum counts, and some API-specific endpoints, like Timeline Events, have their own rate envelopes separate from the general limits. Always check the specific endpoint's documentation rather than assuming the general limits apply universally.

HubSpot API Integration Best Practices for Developers

 At Webdew, we have worked on complex HubSpot API integrations involving CRM synchronization, workflow automation, custom objects, and third-party application connectivity.  Choosing the right API management strategy is equally important for maintaining scalability, security, and long-term performance. If you are evaluating infrastructure for integrations, read our guide on How to Choose an API Service Management Solution.

Use batch endpoints wherever possible. Instead of making individual API calls to create or update 500 contacts, use HubSpot's batch create and batch update endpoints. A single batch request can process up to 100 records at once, reducing your call count by a factor of 100 and making daily limits far less of a concern.

Implement exponential backoff for 429 errors. When your application receives a rate limit response, it should not immediately retry. Instead, implement a retry strategy that waits progressively longer between attempts, starting with 1 second, then 2, then 4, then 8. Adding a small random delay (jitter) prevents multiple parallel processes from hammering the API simultaneously and triggering cascading failures.

Use webhooks instead of polling. If you are checking HubSpot every few minutes for changes, you are wasting API calls. Webhooks deliver updates to your server the moment something changes in HubSpot, eliminating unnecessary polling and keeping your integration lean.

Cache data locally where appropriate. For data that does not change frequently, HubSpot user IDs, pipeline stage definitions, and custom property metadata cache the values in your database after the first retrieval. Fetching static reference data repeatedly is one of the most common sources of avoidable API overhead.

Scope your private app tokens precisely. Only request the scopes your integration actually needs. Broad permissions increase security risk; a token that can read and write all CRM objects is a much more dangerous credential to rotate if it leaks than one scoped only to contacts.

Handle errors explicitly, not generically. HubSpot returns descriptive error codes and messages. A 400 error means your request was malformed; a 401 means authentication failed; a 403 means the token lacks the required scope; a 404 means the record does not exist. Build logic that handles each of these specifically rather than treating all errors the same way.

Coordinate API usage across teams. HubSpot's rate limits apply at the account level, meaning all integrations and apps connected to the same HubSpot portal share the same cap. If your marketing team runs a bulk contact sync at the same time your engineering team runs a data migration, both will compete for the same pool of available requests. Cross-functional communication about planned heavy operations prevents unexpected throttling.

Troubleshooting HubSpot API Connection Errors

Even well-built integrations run into issues. These are the most common HubSpot API connection errors and how to resolve them:

401 Unauthorized — Your access token is missing, expired, or invalid. Verify the token is being passed correctly in the Authorization header as "Bearer YOUR_TOKEN." If you are using OAuth, check whether the access token has expired and use the refresh token flow to obtain a new one.

403 Forbidden — Your token is valid, but the app lacks permission for the requested action. Go back to your private app settings and add the missing scope, then regenerate the token.

404 Not Found — The record you are trying to access does not exist in HubSpot, or you are using the wrong endpoint URL. Double-check the object ID and confirm the endpoint path matches the current API version in the documentation.

429 Too Many Requests — You have hit a rate limit. Check the response headers to identify whether it is a burst or daily limit, implement retry logic with exponential backoff, and review whether batch endpoints could reduce your call volume.

400 Bad Request — Your request payload is malformed. The error message will usually describe exactly which field is missing or incorrectly formatted. Validate your JSON structure against the HubSpot API documentation for that endpoint before retrying.

SSL/TLS Errors — If your server cannot complete the HTTPS handshake with HubSpot's servers, check that your environment's SSL certificates are up to date and that you are not using an outdated version of TLS.

Using HubSpot API for Automated Lead Scoring

One of the most powerful applications of the HubSpot API is building custom automated lead scoring logic that goes beyond what HubSpot's native scoring tool supports natively. Here is how a typical implementation works:

Your external system, a product analytics platform, a data warehouse, or a custom application, tracks behavioral signals that HubSpot cannot observe on its own: feature usage frequency, support ticket history, payment behavior, or engagement with your mobile app. Using the HubSpot Contacts API, your system regularly updates a custom numeric property on each contact record, for example, a "custom lead score" field based on those external signals.

When that score crosses a defined threshold, a HubSpot workflow triggers automatically: it updates the contact's lifecycle stage, creates a task for a sales rep, or enrolls the contact in a high-intent email sequence. The entire process is hands-free. No one manually reviews scores; the API writes the data, the workflow reads it, and the right action fires at the right moment.

This combination of external data enrichment via API and internal automation via workflows is one of the clearest demonstrations of what makes HubSpot API integration genuinely transformative for growth teams.

To learn more about setting up HubSpot workflows for lead management, read HubSpot Marketing Automation Features That Actually Convert.

Can I Integrate HubSpot with Non-CRM Software?

Absolutely and this is one of HubSpot's greatest strengths. Because HubSpot API follows standard REST conventions, it can connect to virtually any software platform that supports HTTP requests. Common non-CRM integrations include:

Accounting tools like QuickBooks or Xero, where HubSpot deals data flows into invoice creation automatically. ERP systems like SAP or NetSuite, where product and order data syncs bidirectionally with HubSpot deal records. Customer support platforms like Zendesk or Freshdesk, where ticket status updates sync back to contact records in HubSpot. Data warehouses like BigQuery or Snowflake, where HubSpot pipeline and campaign data feed into company-wide analytics. Custom mobile or web applications, where user actions trigger contact property updates or workflow enrollments in HubSpot via direct API calls.

The key is always the same: use private app tokens for secure authentication, scope permissions appropriately, handle rate limits and errors gracefully, and document what each integration reads and writes so your team can maintain it confidently over time.

Conclusion

The HubSpot API is one of the most capable integration layers in the CRM and marketing automation space but getting the most out of it requires more than sending a few requests and hoping for the best. Understanding authentication options, respecting API rate limits, using batch endpoints strategically, implementing proper error handling, and leveraging webhooks over polling are what separate integrations that perform well in production from those that break under real-world load.

Whether you are building your first HubSpot integration or optimizing an existing one, the fundamentals in this guide give you a solid foundation to work from. And if you want expert support designing or implementing a HubSpot API integration that scales reliably with your business, the certified HubSpot specialists at Webdew are ready to help.

 

Frequently Asked Questions

1. Are there limits to how many API calls I can make in HubSpot?

Yes. HubSpot enforces both burst limits and daily limits. Public apps using OAuth are capped at 110 requests every 10 seconds per connected account. Private apps on Professional and Enterprise plans can access higher daily allowances, up to 1,000,000 requests per day on some tiers. The CRM Search API has its own stricter limit of 4 requests per second, regardless of plan. When limits are exceeded, HubSpot returns a 429 error. Monitoring the rate limit headers included in every API response helps you stay ahead of throttling.

2. What is the primary difference between HubSpot API keys and OAuth?
 The legacy HubSpot API key was a single static credential tied to a specific account, simple to use but now deprecated due to security concerns. Private app access tokens replaced API keys for single-account integrations; they are scoped to specific permissions and are more secure to manage. OAuth is designed for multi-account scenarios, such as public apps that other HubSpot users install, and requires a full authorization flow where users explicitly grant your app permission to access their data. For most custom integrations built for a single HubSpot portal, private app tokens are the right choice. For products distributed to multiple HubSpot customers, OAuth is mandatory. 
3. Can I integrate HubSpot with non-CRM software?
 Yes, without restriction. HubSpot's REST API is platform-agnostic; any system capable of making HTTP requests can integrate with it. Businesses regularly connect HubSpot to accounting software, ERP systems, data warehouses, e-commerce platforms, mobile applications, and custom internal tools. The integration approach is always the same: authenticate with a private app token or OAuth, identify the relevant HubSpot endpoints for the data you need to exchange, and build request and response handling logic with proper error management and rate limit awareness. 

Dive Into our Client Testimonials

Listen to business owners like you share how we’ve helped them grow. Your story could be next!

Clutch global fall
Clutch champion fall
Clutch british columbia
Clutch Canada
Video Production
Clients love us
Play Video

The webdew team is very supportive, 
 they provide us with thoughtful suggestions.

We contracted webdew to build our new website. And let me tell you, they did a fantastic job. Their team was really easy to communicate with.”

Teresa Zhao Senior Marketing Manager, Coreio
Play Video

The webdew team is very supportive, 
 they provide us with thoughtful suggestions.

We contracted webdew to build our new website. And let me tell you, they did a fantastic job. Their team was really easy to communicate with.”

Teresa Zhao Senior Marketing Manager, Coreio
Play Video

The webdew team is very supportive, 
 they provide us with thoughtful suggestions.

We contracted webdew to build our new website. And let me tell you, they did a fantastic job. Their team was really easy to communicate with.”

Teresa Zhao Senior Marketing Manager, Coreio

“We worked with Chehak over the past several months to create a series of animated videos for an academic planner that we produce. And from the very beginning, she was absolutely professional and a pleasure to work with.”

Veronica Bishop
Veronica Bishop Content Writer, Bishop Content Studio
Logo Image

6x

We helped clients multiply their website conversion rates through strategic design and UX optimization.

20%

Our marketing campaigns led to a 20% uplift in customer engagement across digital channels.

2K+

Delivered over 2,000 qualified leads through targeted funnels and smart automation.

120+

Our video content has earned 120,000+ views, driving brand awareness and audience retention.

“I recently had the pleasure of working with Chehak on a video demo project, and I was thoroughly impressed with her services.”

Matt Kay
Matt Kay Co-founder, Talem AI
Talem AI

Additional Resources

Access expert tips, trends, and strategies designed for small businesses. Stay ahead of the curve and make informed decisions with our comprehensive resources!