Create a Hubspot company

Create a Hubspot company

This example shows you how to create a Smart Action "Create company in Hubspot" that generates a company in Hubspot based on information from your database.

Requirements

  • An admin backend running on forest-express-sequelize

  • superagent npm package

  • a Hubspot account

How it works

Directory: /models

This directory contains the companies.js file where the collection is declared.

Directory: /forest

This directory contains the companies.js file where the smart action is declared. A smart field has also been added to add a link to the company's Hubspot profile if the company's crmId field is not null.

Directory: /routes

This directory contains the companies.js file where the smart action logic is implemented.

In this logic a Hubspot company instance is created through a /post create company call to the Hubspot API.

The Hubspot API key is defined in the .env file and requested through the expression process.env.HUBSPOT_API.

Last updated

Was this helpful?