HubSpot by IV-Lead

API developer - Guides, resources and best practices

Written by Ohad Peter | Jul 11, 2023 12:19:25 PM

APIs are designed to make it easy for you to build functional applications and integrations. HubSpot's application relies on these APIs. From webinar providers to CRMs to social media networks, the ecosystem of developers creating integrations on top of APIs is strong and diverse.

The HubSpot APIs are all based on REST - if you've interacted with RESTful APIs before, you'll be familiar with the concepts. All API calls to HubSpot should be made to the https://api.hubapi.com base domain. Many HTTP clients can understand HTTP verbs, which are standard HTTP features. All responses, including errors, will contain JSON. APIs are designed to have predictable, straightforward URLs and to indicate API errors using HTTP response codes.

Getting listed on our App Marketplace

If you're considering an integration with HubSpot for commercial use - i.e. installation by mutual customers - you can learn how to get listed here.

Rate limits and accounts

HubSpot's APIs are rate limited. Custom integrations using API keys or OAuth integrations per app per account are subject to these limits

HubSpot accounts have access to different APIs depending on their products and product levels. APIs by Product Tier provides a detailed breakdown of which APIs are supported by each product level.

Authentication

The HubSpot APIs allow for two types of authentication: OAuth and private app access tokens. See our Authentication Overview for more details about authenticating requests.

Testing

You'll need to create a developer account so you can create and manage test accounts or create an application and get started with OAuth. A private app's access token can also be used to make API calls more quickly.

When you are ready to start testing, you should create a test account. All HubSpot APIs and tools are available to them in HubSpot's Enterprise versions of the Marketing, Sales, and Service Hubs.

If you ever have questions, check out our developer forum or to leave us some feedback using the Submit Feedback button throughout the site.

Client Libraries

In order to make working with HubSpot's APIs easier, the community and HubSpot have created and maintained client libraries. Here is a list of the ones HubSpot knows about and who supports them.

Library Language Supported by
HubSpot/hubspot-php PHP HubSpot
adimichele/hubspot-ruby Ruby Community
MadKudu/node-hubspot Node.js Community
jpetrucciani/hubspot3 Python Community
hubspot-net/HubSpot.NET C# .NET Community

Building apps

Before HubSpot users can start installing your app, you'll need to get set up in your developer account. From there, you can create an app, configure OAuth, and create a test environment. Start building now.

Public apps

Create a public app if you want others outside your organization to be able to install your app, such as an app listed on the app marketplace.

An app developer account is required if you're making a public app:

  • First, navigate to this page.

  • Click Create App Developer Account.

  • Authenticate using your Google or Microsoft account, or enter your email.

  • Create your developer account by following the setup instructions.

You can then create an app, configure OAuth, and set up a test environment. Start building now.

Private apps

You can create a private app if you want to create an integration that will only be used by other HubSpot users, like an internal app that can access or modify your contact data.

Authentication

Most HubSpot API endpoints support both OAuth and private app access tokens.

Please note: as of November 30, 2022, HubSpot API Keys are being deprecated and are no longer supported. Continued use of HubSpot API Keys is a security risk to your account and data. During this deprecation phase, HubSpot may deactivate your key at any time.

You should instead authenticate using a private app access token or OAuth. Learn more about this change and how to migrate an API key integration to use a private app instead.

  • If you want to list your app in the HubSpot App Marketplace or have multiple users install it, you must use OAuth.
  • If you're building a private app, you can make calls using your app's access token, which also implements OAuth.

Usage and limits

Learn about our usage guidelines, rate limits, and how to check your API call usage.

App Partners and the App Marketplace

Review app listing requirements and create your app listing.

Learn to use APIs and build apps on HubSpot Academy

Learn more about the HubSpot APIs, developer accounts, and how to start making calls using both OAuth and API keys with these short (and free!) HubSpot Academy videos.

HubSpot API reference documentation

As part of our mission to empower organizations to grow better, HubSpot offers a developer platform. Through our APIs, teams of all sizes and shapes can build robust integrations that help them customize and maximize HubSpot's value.

All HubSpot APIs are built using REST conventions and designed to have a predictable URL structure. They use many standard HTTP features, including methods (POST, GET, PUT, DELETE) and error response codes. All HubSpot API calls are made under https://api.hubapi.com and all responses return standard JSON.

Setting up

HubSpot integrations can be built in several ways:

- To build an internal integration for an individual HubSpot account (e.g., you want to build an app that can access and edit only authorized parts of your account to share or integrate with other parts of your organization), create a private app.

- Creating a developer account is the best way to create a public app that can be installed across multiple HubSpot accounts. There are several reasons for this: A developer account allows you to create HubSpot apps that are authenticated using OAuth and have a configurable set of features and permissions. A developer account can also be used to create test accounts, monitor app status and performance, and publish apps.

This article explains the different types of apps and accounts.

Client libraries

HubSpot client libraries make it easier to interact with the APIs. The APIs are available in several different languages and help you connect your application to HubSpot's.

In addition, they remove the need to know the exact URL and HTTP method for each API call, allowing you to focus on making your application. Click here to learn more about client libraries.

Language

Package Link

Source Code

Node.Js

npm install @hubspot/api-client

hubspot-api-nodejs

PHP

composer require hubspot/api-client

hubspot-api-php

Ruby

gem install hubspot-api-client

hubspot-api-ruby

Python

pip install hubspot-api-client

hubspot-api-python

 

API documentation

HubSpot’s API documentation is split into two sections: reference docs and integration guides.

Reference docs

All API reference docs include an overview section and an endpoint section. The API overview includes a brief summary of its functionality, use cases, and any special considerations for creating an integration. The endpoints section lists each endpoint, its parameters, and request examples in multiple languages.

Once you’ve configured your app’s auth settings in your developer account, you can use Postman or make test calls right from an endpoint reference page. 

Integration guides

If you want to learn the fundamentals of HubSpot’s platform or see an example before making your first API call, you can find sample apps and tutorials as well as detailed information about developer accounts, working with OAuth, API rate limits, and more in our Integration Guides section. 

Related: Learn more about authentication methods or OAuth.

Getting listed

When you’re ready to share your app with the world and become an app partner, read our listing and certification requirements. After that, you can create and manage your App Marketplace listing right from your developer account.

Support and community resources

Join HubSpot's growing developer community forums and Slack group to get your questions answered, make connections, and share insights. Your feedback on HubSpot's developer experience is incredibly important to us and to our ongoing efforts to improve it.

Subscribe to the Changelog blog to stay updated on new features, announcements, and important changes.

Building on the CMS

Looking to build a website, blog, landing page, lightweight app, or an email? Head over to our CMS developer docs.