Integrate with HubSpot
Send data to and get them from HubSpot straight into your workflow.
Before you begin
- Get a HubSport API key. To do that, you need to create a private app and set permissions for this app based on the data you want to get from HubSpot. For details, see HubSpot documentation. Make sure your app has the following CRM scope:
crm.objects.deals.read
Get deal and contract details from HubSpot
- In Next Matter select the workflow that should integrate with HubSpot, and add a new integration step to get deal details.
- Click Settings and enter the following details:
- Method: POST
- URL:
https://api.hubapi.com/crm/v3/objects/deals/DEAL_ID?associations=contacts
Tip: Get a HubSpot Deal ID. You can find the ID of a deal on the deal record itself under the property Deal ID.
- Headers: Content-Type: application/json
- Headers: Authorization:
Bearer HUBSPOT_API_KEY
- Create a variable for the deal name with the value of:
$.properties.dealname
and for the contact association ID with the value of$.associations.contacts.results[0].id
- Save your changes.
- Create a new integration step to get contact details.
- Click Settings and enter the following details:
- Method: POST
- URL:
https://api.hubapi.com/crm/v3/objects/contacts/{2. Get Deal - Integration step - contact_association_id (plain)}
The {VALUE} is a data reference to the Next Matter variable. - Headers: Content-Type: application/json
- Headers: Authorization:
Bearer HUBSPOT_API_KEY
- Create a variable for the contact ID with the value of:
$.id
and for the contact email with the value of$.properties.email
, and for the contact's first name with the value of$.properties.firstname
.
- Save your changes.
Search for a contact/deal in HubSpot
In Next Matter select the workflow that should integrate with HubSpot, and add a new integration step.
- Click Settings and enter the following details:
- Method: POST
- URL:
https://api.hubapi.com/crm/v3/objects/contacts/search
You can also have a step that searches HubSport for a deal by property. In this case, make a call to https://api.hubapi.com/crm/v3/objects/deals/search
- Headers: Content-Type: application/json
- Headers: Authorization:
Bearer HUBSPOT_API_KEY
- Body:
{ "filterGroups": [ { "filters": [ { "value": "PROPERTY_VALUE", //Replace the placeholders "propertyName": "PROPERTY_NAME", "operator": "EQ"//This can be EQ, NEQ, BETWEEN. } ]//There are more filter options than the ones shown here. For details, check Hubspot documentation or reach out to us. } ] }
- Create a variable for the contact ID with the value of
$.results[0].id
.
If you search for a deal, create a variable for deal ID with the value of
$.results[0].id
.
- Save your changes.
Create and update a HubSpot ticket
- In Next Matter, select the process that should integrate with HubSpot, and add a new integration step to get deal details.
- Click Settings and enter the following details:
- Method: POST
- URL:
https://api.hubapi.com/crm/v3/objects/tickets
- Headers: Content-Type: application/json
- Headers: Authorization:
Bearer HUBSPOT_API_KEY
- Body:
{"properties":{//replace the placeholders "hs_pipeline": PIPELINE_ID,//you can find it in HubSpot by going to Data Management > Objects > Tickets and opening the Pipelines tab. "hs_pipeline_stage": PIPELINE_STAGE_ID,//navigate to HubSpot > Settings > Sales > Deals. There you can check for each pipeline and their stage IDs. "hs_ticket_priority": "TICKET_PRIORITY", "subject": "TICKET_SUBJECT" }}
-
Create a variable for the
ticketID
with the value of:$.id
. -
Save your changes.
-
To push the ticket to the next stage, create a new integration step.
-
Click Settings and enter the following details:
- Method: PATCH
- URL:
https://api.hubapi.com/crm/v3/objects/tickets/{2.Create Ticket - Integration Step - TicketID(plain)}?hapikey=KEY
The {VALUE} is a data reference to the Next Matter variable.
Make sure to replace the KEY variable with your HubSpot API key. - Headers: Content-Type: application/json
- Headers: Authorization:
Bearer HUBSPOT_API_KEY
- Body:
{"properties":{//replace all the placeholders "hs_pipeline": PIPELINE_ID, "hs_pipeline_stage": PIPELINE_STAGE_ID, "hs_ticket_priority": "TICKET_PRIORITY", "hubspot_owner_id": "OWNER_ID", "subject": "{Instance name}//replace this with a data reference from Nexct Matter " }}
Find HubSpot owner ID
- Click the Settings cog in the main menu in HubSpot.
- In the left-hand menu, click Properties.
- Under Contact properties, type Owner in the search bar.
- Hover over Contact owner and click View.
- At the bottom of the next page, your HubSpot Owner IDs are listed in the Dropdown options table in the Internal Value column.
- Save your changes.
Updated about 2 months ago