Integrating HubSpot CRM with FreePBX using RestAPI



For a couple of days, I have been trying to integrate HubSpot CRM with FreePBX using RestAPI. I searched a lot and found this I created API token on FreePBX end and now I am unable to understand where will I find CRM API Settings page or how to proceed further with the integration. Please help.


Hi @Vicky_Roy,

Unfortunately, I won't be able to help you locate pages or settings in PBX. I can answer questions about HubSpot's APIs, however.

Do you have any questions about how you would connect your external app to HubSpot or use any of our APIs?


That's what I want to learn, "How to connect FreePBX with Hubspot using RestAPI". I did go through manual and contacted support team as well, but was left with incomplete knowledge. I would be thankful if you could guide me a little bit so I can achieve my goal.



Please give me more to go on. I will not be your best resource when it comes to specific implementation steps in PBX, as it's a completely different platform, but I can help you understand HubSpot APIs.

What is your use case (specifically, what kinds of objects do you want to sync or do you even want to sync objects) and what is your current understanding of how to manipulate objects in PBX.

I can't advise on how to reach your goals if I don't understand your goals and where you're starting from.

Here are some basic questions to start with:

  • Are you planning to authenticate calls to HubSpot with OAuth 2.0 or your API key? See the authentication overview documentation for more information.
  • Are you building or have you built an external app which you will use to make requests and parse responses from HubSpot before sending them to PBX and vice versa? If so, what is the general structure of this app? Is it on Heroku? Is it built with Node.js, PHP, JavaScript, etc.?
  • What is your familiarity with the HubSpot CRM? If you're relatively new, I recommend checking out this overview documentation before diving into specific APIs and endpoints.
  • What is your Hub ID? If you're planning to authenticate with OAuth 2.0, have you created a developer portal yet? What is your developer Hub ID?


I want to sync contacts and I cannot manipulate objects in PBX

Here are the answers -

I am planning to authenticate calls to HubSpot with OAuth 2.0 or API key. Please check , I believe the link describes authentication via OAuth 2.0. I have already gone through authentication overview documentation, however, could not find how to authenticate. I can generate API key on FreePBX, but don't know how to proceed further with Hubspot using the key.

I have not built any external app, though I can build one if required. Suggestion would be appreciated.

I am new to HubSpot CRM. I can integrate the available app integration options(Zoho CRM, Sugar CRM, SalesForce etc.), but FreePBX seems complicated. I have gone through the overview documentaion, but could not find anything helpful.

My Hub ID is 5057454 and my developer Hub ID is 5084768.

Hope this helps.


Hi @Vicky_Roy,

Thank you for clarifying.

To confirm, it sounds like you wish to pull call information from FreePBX and then push it into HubSpot to create contacts and CALL engagements. Is that correct?

FreePBX's documentation only covers getting information out of their system using an API key. You can't use the FreePBX API key with HubSpot directly or HubSpot's API key with FreePBX. To integrate the systems, you must set up an external app or server to GET information from FreePBX's APIs, parse the data you receive, and then make calls to HubSpot's endpoints to create or update the desired objects.

In your case, I recommend just authenticating HubSpot calls with your API key; it's much simpler than OAuth 2.0.

Yes, you will need some external app to take in data from FreePBX, and parse it into calls to create contacts and engagements in HubSpot. I don't know what your previous experience is with app development, but Heroku is a popular platform for many developers. Heroku supports the most common server-side languages.

I recommend focusing on reviewing the following endpoints, as they will be what you use to actually create contacts and calls in HubSpot:

  • Create a new contact | As long as you know a caller's email, you will be able to create a contact record for them. You can also include properties like firstname, lastname, phone number, and more.
  • Create an engagement | You will probably want to create CALL-type engagements from every call from FreePBX. This must happen after you create a contact record, as you will need to associate the call with the correct contactIds.


Hello Isaac,

I created an app on HubSpot Developers platform. But the issue is, I do not get the option/menu/link to authenticate using API key or create a contact or engagement or endpoints. If you could guide me how can I do that. This platform seems really different to me.


Hi @Vicky_Roy,

Apologies for the confusion. The "app" you created in your HubSpot developer account is not where you actually implement code to query HubSpot and FreePBX endpoints.

Instead, as this documentation notes, the "app" is used to identify your integration to HubSpot. The app interface is where you set which permissions/scopes your app has access to and contains monitoring tools for incoming calls.

You still need to build an actual app outside of HubSpot (e.g. on Heroku or your platform of choice) that queries FreePBX's endpoints, parses the data you receive, constructs requests to HubSpot endpoints with this data, and authenticates the calls with your HubSpot app's OAuth tokens.