Summary: ◀▼
You can connect action flows to HubSpot to automate CRM tasks like creating, updating, and looking up contacts, companies, deals, tickets, and users. Use a dedicated service account for secure OAuth 2.0 authentication. This integration helps manage customer data and sales processes within your workflows, improving collaboration and data consistency across platforms.
Connecting HubSpot to action builder
Before you can include external actions in your action flows, you must connect the action builder to the external system.
- All external actions performed by an action flow are attributed to the user who connected the external system. Therefore, it's a best practice to use a dedicated service account rather than personal credentials when connecting to each external system.
- All integrations request access to necessary scopes. However, it's important that you review and validate the scopes before authorizing the connection to the external system.
- When managing credentials for API key-based tools, such as OpenAI, it's best to store keys in a secure vault or credential manager.
- In Admin Center, click
Apps and integrations in the sidebar, then select Actions > Action
flows. - Create or edit an action flow.
- Open the step sidebar.
- Under External actions, click HubSpot.
- Click Connect.
- Follow HubSpot's prompts to authenticate and complete the connection.
The HubSpot connection uses OAuth 2.0 for secure authentication. You'll be redirected to HubSpot to authorize access to your account. The connector automatically handles token refresh when needed.
Note: All external actions performed by an action flow are attributed to the user who connected the external system. Therefore, it is a best practice to use a dedicated service account rather than personal credentials when connecting to each external system.
After you've connected to the system, you'll see an indicator that it's connected and details about the instance you're connected to, as well as the actions available for HubSpot.
Using HubSpot actions in action flows
Creating a contact
Use the Create contact action to create a new CRM contact using common standard fields.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: EmailOptional:
HubSpot custom properties defined in your account will appear as additional optional fields. Lifecycle stage includes options such as Lead, Customer, etc. Lead status reflects the status of the lead in the sales process. |
| Output | Contact details including ID, properties (email, firstname, lastname, phone, mobilephone, company, website, jobtitle, lifecyclestage, hs_lead_status, hubspot_owner_id, and custom properties), createdAt, updatedAt, and archived status. |
Updating a contact
Use the Update contact action to update an existing contact's fields.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Contact IDOptional:
Only the Contact ID is required. Provide only the fields you want to update. HubSpot custom properties defined in your account will appear as additional optional fields. |
| Output | Contact details including ID, updatedAt timestamp, and archived status. |
Looking up a contact
Use the Lookup contact action to find a contact by ID or email address.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs |
Optional: Provide either Contact ID or Email to look up a contact. If both are provided, Contact ID takes precedence. |
| Output | Contact details including ID, properties (standard and custom fields), createdAt, updatedAt, and archived status. |
Creating a company
Use the Create company action to create a company record.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Company nameOptional:
Owner ID should be the HubSpot user ID of the company owner. HubSpot custom properties defined in your account will appear as additional optional fields. |
| Output | Company details including ID, properties (name, domain, phone, website, industry, city, state, country, hubspot_owner_id, and custom properties), createdAt, updatedAt, and archived status. |
Updating a company
Use the Update company action to update company fields.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Company IDOptional:
Only the Company ID is required. Provide only the fields you want to update. HubSpot custom properties defined in your account will appear as additional optional fields. |
| Output | Company details including ID, updatedAt timestamp, and archived status. |
Looking up a company
Use the Lookup company action to find a company by ID or name.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs |
Optional: Provide either Company ID or Company name to look up a company. If both are provided, Company ID takes precedence. |
| Output | Company details including ID, properties (standard and custom fields), createdAt, updatedAt, and archived status. |
Creating a deal
Use the Create deal action to create a deal.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Deal name, Deal
stageOptional: Close date should be in YYYY-MM-DD format or Unix timestamp in milliseconds. Owner ID should be the HubSpot user ID of the deal owner. Company ID and Contact ID can be used to associate the deal with a company and contact. HubSpot custom properties defined in your account will appear as additional optional fields. |
| Output | Deal details including ID, properties (dealname, pipeline, dealstage, amount, closedate, hubspot_owner_id, dealtype, description, and custom properties), createdAt, updatedAt, and archived status. |
Updating a deal
Use the Update deal action to update a deal.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Deal IDOptional:
Only the Deal ID is required. Provide only the fields you want to update. Close date should be in YYYY-MM-DD format or Unix timestamp in milliseconds. HubSpot custom properties defined in your account will appear as additional optional fields. |
| Output | Deal details including ID, updatedAt timestamp, and archived status. |
Looking up a deal
Use the Lookup deal action to find a deal by ID or name.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs |
Optional: Provide either Deal ID or Deal name to look up a deal. If both are provided, Deal ID takes precedence. |
| Output | Deal details including ID, properties (standard and custom fields), createdAt, updatedAt, and archived status. |
Creating a ticket
Use the Create ticket action to create a ticket.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Ticket name, Ticket
stageOptional: Ticket stage represents the stage of the ticket within the pipeline. Priority levels include options such as High, Medium, and Low. Source indicates the channel or origin of the ticket. Owner ID should be the HubSpot user ID of the ticket owner. HubSpot custom properties defined in your account will appear as additional optional fields. |
| Output | Ticket details including ID, properties (subject, content, hs_pipeline, hs_pipeline_stage, hs_ticket_priority, source_type, hubspot_owner_id, and custom properties), createdAt, updatedAt, and archived status. |
Updating a ticket
Use the Update ticket action to update a ticket.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Ticket IDOptional:
Only the Ticket ID is required. Provide only the fields you want to update. HubSpot custom properties defined in your account will appear as additional optional fields. |
| Output | Ticket details including ID, updatedAt timestamp, and archived status. |
Looking up a ticket
Use the Lookup ticket action to find a ticket by ID or name.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs |
Optional: Provide either Ticket ID or Ticket name to look up a ticket. If both are provided, Ticket ID takes precedence. |
| Output | Ticket details including ID, properties (standard and custom fields), createdAt, updatedAt, and archived status |
Looking up a user
Use the Lookup user action to find a user by ID or email address.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs |
Optional: Provide either User ID or Email to look up a user. If both are provided, User ID takes precedence. |
| Output | User details including ID, email, firstName, and lastName. |