Create a Contact in Hubspot

Abby Updated by Abby

This workaround is for the new Hubspot API released in October 2022

Now you will need to create a private app in Hubspot to get a new API key

You can see how to do this here.

Once the new app is created you will set the scopes, we will use the following:

Now we just need to copy the new API token

In our bot we'll add a webhook that will make a POST to this endpoint: https://api.hubapi.com/crm/v3/objects/contacts

In the Header we'll add our API token:

We'll add authorization as the Key and Bearer xxtokenherexx

Lastly, in the Body of our webhook we'll add any properties we want to send

{ "properties": { "company": "@{company}", "email": "@{email}", "firstname": "@{name}", "lastname": "@{lastname}", "phone": "@{phone}", "website": "@{website}" }}

We don't need to worry about matching the form exactly, any properties we don't send, simply won't be added

Once we test the request, we should get this response:

If the user already exists we'll get the following response:

We can use response routing to handle the cases where the contact already exists in our crm

How did we do?

HubSpot Integration Block

Contact