If your company uses multiple tools (ERP, billing, ecommerce, WhatsApp Business), you've probably run into the problem of having duplicated, out-of-sync, or outright lost data. The solution is to connect everything through HubSpot's API and Webhooks.
What Is the HubSpot API?
The HubSpot API is a REST interface that allows you to read, create, update, and delete CRM data programmatically. This means you can automate any process you currently do manually.
Some real-world examples:
- Automatically create contacts when someone fills out a form on your website
- Sync deals with your billing system
- Update custom properties from an ERP or internal system
- Send data to HubSpot from mobile applications
Most Used Endpoints
The HubSpot API is organized by CRM objects. The most common ones are:
- Contacts API:
/crm/v3/objects/contacts— contact management - Deals API:
/crm/v3/objects/deals— sales pipeline - Companies API:
/crm/v3/objects/companies— companies - Custom Objects:
/crm/v3/objects/{objectType}— custom objects
Example: Create a Contact via API
const response = await fetch(
'https://api.hubapi.com/crm/v3/objects/contacts',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
properties: {
email: 'client@company.com',
firstname: 'John',
lastname: 'Smith',
company: 'Company Inc'
}
})
}
);
What Are Webhooks?
While the API allows you to query data whenever you want, Webhooks work the other way around: HubSpot notifies you when something happens. It's like an automatic notification.
With Webhooks you can react in real time when:
- A contact is created or updated
- A deal changes pipeline stage
- A form is submitted
- An email is opened or clicked
"With Webhooks we reduced lead response time from 4 hours to under 30 seconds. The sales team gets the notification instantly."
Real Use Cases We've Implemented
1. WhatsApp Business + HubSpot
When a customer messages via WhatsApp, a contact is automatically created in HubSpot with the conversation history. The salesperson sees all the context without leaving the CRM.
2. Billing ERP + HubSpot Deals
When a deal is marked as "Won" in HubSpot, an invoice is automatically generated in the ERP and the deal status is updated with the invoice number.
3. Ecommerce + HubSpot
Every purchase on the online store creates a timeline event on the HubSpot contact, enabling segmentation by purchase history and automating remarketing campaigns.
Technical Best Practices
- Use OAuth instead of API Keys — it's more secure and scalable
- Respect rate limits — HubSpot allows 100 requests per 10 seconds
- Implement retry logic — webhooks can fail, have a retry system in place
- Use batch operations — for bulk operations, use the batch endpoints
- Log everything — keep logs of every call for debugging
Need a Custom Integration?
At HabSar we specialize in custom HubSpot development. We've integrated dozens of systems with the HubSpot API: ERPs, billing systems, ecommerce platforms, WhatsApp Business and more.
Need to connect your systems with HubSpot?
Schedule a call and we'll show you how we can integrate your entire stack.
Schedule free consultation