Prerequisites
To follow along this guide you’ll need to get your bearer token from HubSpot. You can find the instructions on how to get it here. Remember to correctly set the Read/Write actions depending on wether you want to be able to update that information using the API step from Hilos or not.Create a deal
If you want to update a deal via a Hilos Flow, you can use a combination of theAPI step and the HubSpot Deals API.
To create a new deal from an Hilos flow you need to make a POST request to /crm/v3/objects/deals endpoint with the properties of your pipeline, for example:
You can view the properties of your pipeline by making a
GET request to
/crm/v3/properties/deals endpoint using HTTPie, cURL or Postman.associations property to the request:
Remember you can use the results from the API step as a variable for a later
step in your flow. This allows you to easily update the information according
to a previous result, however when testing you might need to hardcode the
values to make sure the request is successful. Then before publishing change
the hardcoded values to the variables.
Retrieve and update a deal
To update a deal first you need to know the deal ID, to get it you can make aGET request to /crm/v3/objects/deals endpoint to see the active deals. You can include the following query parameters to filter results and make it easier to use:
properties: A comma separated list of the properties to be returned in the response. If the requested deal doesn’t have a value for a property, it will not appear in the response.propertiesWithHistory: A comma separated list of the current and historical properties to be returned in the response. If the requested deal doesn’t have a value for a property, it will not appear in the response.associations: A comma separated list of objects to retrieve associated IDs for. Any specified associations that don’t exist will not be returned in the response. Learn more about the associations API.
PATCH request to /crm/v3/objects/deals/{dealId} and include the data you want to update.
