HubSpot's CRM platform contains the marketing, sales, service, operations, and website-building software you need to grow your business.
Go to siteThe HubSpot API enables developers to integrate into HubSpots CRM, CMS, Conversations, and other features. It allows for automated management of contacts, companies, deals, and marketing campaigns, enabling custom workflows, data synchronization, and task automation. This streamlines operations and boosts customer engagement, with real-time updates for rapid response to market changes.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
hubspot: {
type: "app",
app: "hubspot",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.hubapi.com/integrations/v1/me`,
headers: {
Authorization: `Bearer ${this.hubspot.$auth.oauth_access_token}`,
},
})
},
})
Lead Scoring and Segmentation: Enhance leads automatically by pulling in enrichment data from external sources and categorizing them in HubSpot. Use customer interaction data from social media or support platforms to adjust lead scores and segment leads into appropriate marketing campaigns within HubSpot.
Automated Ticketing and Support: Create a workflow where new support queries on HubSpot trigger the creation of tickets in a tool like Zendesk. The workflow can also update the customer record in HubSpot with the ticket information, ensuring the sales team has visibility into customer issues.
Syncing Contacts with Email Platforms: Set up a bi-directional sync between HubSpot and email marketing platforms like Mailchimp. When a contact is updated in HubSpot, it triggers an update in Mailchimp and vice versa. This keeps mailing lists current and enables targeted campaign efforts based on the most relevant data.
You can install the Pipedream HubSpot app in the Accounts section of your account, or directly in a workflow.
Adds a contact to a specific static list. See the documentation
Create or update a batch of contacts by its ID or email. See the documentation
Create a WhatsApp, LinkedIn, or SMS message. See the documentation
By default, a successful HubSpot API request will return a 200 status code alongside the corresponding data payload.
Below are a list of common errors from HubSpots API by HTTP status code.
Returned when the authentication provided is invalid. See our Authentication Overview for details on authenticating API requests.
Returned when the authentication provided does not have the proper permissions to access the specific URL. For example, an OAuth token with only content access would receive a 403 error when trying to access the Deals API, which requires contacts access. If your API key or private app has the necessary permissions and you're still encountering this error, please contact HubSpot support for assistance.
Returned when your account or app exceeds its API rate limits. For suggestions on how to work within those limits, click here.
Returned when a HubSpot account is in the midst of migration between data hosting locations. In this event, HubSpot provides a Retry-After response header indicating the time in seconds to wait before attempting your request again, typically up to 24 hours.
Returned when HubSpot's processing limits are reached, which are in place to prevent performance degradation due to excessive requests from a single client. If you encounter these timeouts, pause your requests briefly before retrying.
Returned when HubSpot is temporarily unavailable. Upon receiving this response, take a short break before resuming your requests.
Returned when HubSpot's server is down, usually as a temporary issue. If this occurs, pause your requests momentarily, then attempt to reconnect.
Returned when the connection between HubSpot and your application times out. Contact HubSpot support if you encounter this error.
Returned when HubSpot cannot reach your application. If this happens, pause your requests briefly before trying again.
Returned when a response is not received within 100 seconds, possibly due to HubSpot's server being overloaded. Pause your requests for a short period, then retry.
Returned when there's an issue with the SSL certificate or if the SSL handshake fails. In such cases, reach out to HubSpot support for assistance.
HubSpot uses OAuth authentication. When you connect your HubSpot account, Pipedream will open a popup window where you can sign into HubSpot and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any HubSpot API.
Pipedream requests the following authorization scopes when you connect your account:
business-intelligence
crm.lists.read
crm.lists.write
crm.objects.companies.read
crm.objects.companies.write
crm.objects.contacts.read
crm.objects.contacts.write
crm.objects.deals.read
crm.objects.deals.write
crm.objects.quotes.read
crm.objects.quotes.write
crm.objects.owners.read
crm.schemas.companies.read
crm.schemas.companies.write
crm.schemas.contacts.read
crm.schemas.contacts.write
crm.schemas.deals.read
crm.schemas.deals.write
crm.schemas.quotes.read
conversations.read
crm.import
files
forms
forms-uploaded-files
integration-sync
oauth
timeline
GET
https://app.hubspot.com/oauth/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
optional_scope=automation content conversations.visitor_identification.tokens.create e-commerce hubdb sales-email-read social tickets transactional-email crm.objects.custom.read crm.schemas.custom.read crm.objects.custom.write
POST
https://api.hubapi.com/oauth/v1/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://api.hubapi.com/oauth/v1/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}