HubSpot

A component that connects to HubSpot API.

Credentials

Authentication occurs through OAuth 2.0. To make OAuth work, you must create a new OAuth2 app in HubSpot or use an existing OAuth2 client during the credentials creation process.

Oauth2 credentials
  1. Select an existing authentication client from the Choose Auth Client list or create the new one.

    • Leave the Additional parameters input empty.

    • Provide the following value in the Scopes input. If you wish to grant specific permissions, you can remove them from this list.

      crm.objects.contacts.read, crm.objects.contacts.write, crm.schemas.contacts.read, crm.schemas.contacts.write, crm.objects.owners.read

To complete the process:

  1. Click on Authenticate. If you have not logged into HubSpot before, then sign-in by entering data in the sign-in window that appears

  2. Click on Verify to verify your credentials

  3. Click on Save to save your credentials.

Triggers

Get new and updated objects

Configuration fields

Object type dropdown

Select an object type to fetch.

Emit behavior

Choose between Emit objects individually or Emit by page options.

Field to poll

Used to select the field to poll (new or modified objects).

Start time

Used to set the time to start retrieving events. (String, optional)

End time

When provided, do not fetch records modified after this time. (String, optional, defaults to never)

Size of polling page

Set the size of the fetched pages. (Optional, positive integer, max 100, defaults to 100)

Single page per interval

Indicates that if the number of changed records exceeds the maximum number of results in a page, instead of fetching the next page at once, wait until the subsequent flow starts to fetch the next page.

Output metadata

Fetch page

An object with key results that has an array as its value.

Emit individually

Each object fills the entire message.

Limitations

After reaching 9800 records, the flow will find the largest field to poll on the last polling page and use it as Start time for the subsequent iterations; results with this date will be excluded from that iteration and included in the next one.

Webhook

Receive data from HubSpot based on configured webhooks.

Configuration fields

Client secret

Provide the client secret from the HubSpot application here; otherwise, you will get an error during the webhook requests in case of incorrect or missing value.

Output metadata

A triggered object from HubSpot

Actions

Raw request

An action to call any Hubspot API endpoint.

Configuration fields

Throw Error on 404 Response (optional) Treat 404 HTTP responses as errors, defaults to false.

Input metadata

URL

Path of the resource relative to the URL base (https://api.hubapi.com), required.

Method

Allowed values GET, POST, PUT, PATCH, DELETE, required. HTTP verb to use in the request.

Request Body

Body of the request to send

Upsert

An action to upsert (update/create) object in HubSpot

Configuration fields

Object type

Object type for upserts like companies, contacts, deals, line items, or tickets.

ID to Search On

Identifier to search objects like HubSpot ID or email. Use email for object type in the contacts.

Input metadata

Dynamically generated

For each custom file field, an object is generated to upload the custom file to populate that field. That object includes the following:

  • Attachment URL (URL containing the file contents to upload)

  • Folder path

  • File name

  • Charset hunch

  • Access

  • TTL

  • Overwrite

  • Duplicate validation strategy

  • Duplicate validation scope

We use files API for file uploading.

Known limitations

Please, do not use the platform attachments URL (like http://steward-service.platform.svc.cluster.local:8200/v2/objects/xxxxx) for the fields attachment URL. The component will throw an exception process.uncaughtException.

Lookup set of objects by unique criteria

An action to lookup object in HubSpot. Lookup set will ensure all the items in the set should be there; otherwise, it will throw an error.

Configuration fields

Object type

Object type for lookups like companies, contacts, deals, line items, or tickets.

ID to Search On

Identifier to search objects like HubSpot ID or email. Use email for object type in the contacts.

Enable download attachments

Checkbox for enabling attachment download for the file field type.

Input metadata

An array where each item is an ID

Lookup object (at most one)

An action designed to look up one object by unique field.

Configuration fields

Object type dropdown

Select an object type to lookup.

ID to search on dropdown

Used to search a unique field.

Allow ID to be omitted checkbox

Select to make the ID field optional (default: required).

Allow zero results checkbox

Select to allow zero results. The system will emit an empty object {}; otherwise, the system will through an error in case of zero results.

Enable download attachments

Checkbox for enabling attachment download for the file field type.

Input metadata

ID value text field

Value for ID to search on (unique field value by itself).

Lookup objects (plural)

An action to lookup objects in HubSpot.

Configuration fields

Object Type dropdown

Select an object type to find.

Behavior dropdown with options

Fetch all, fetch the page, emit individually, required.

Enable download attachments

Checkbox for enabling attachment download for the file field type.

Input metadata

Search Criteria Array

Combine each search term with an AND operator.

HubSpot supports up to three criteria

Example: Records created after 2021-10-01T03:30:17.883Z with property firstname containing Tony:

["createdate GT 1633059017883", "firstname CONTAINS_TOKEN Tony"]

Supported operators:

OPERATOR DESCRIPTION

EQ

equal to

NEQ

not equal to

LT

less than

LTE

less than or equal to

GT

greater than

GTE

greater than or equal to

HAS_PROPERTY

has a property value

NOT_HAS_PROPERTY

does not have a property value

CONTAINS_TOKEN

contains token

NOT_CONTAINS_TOKEN

does not contain token

If Fetch page is selected, additional metadata fields are:

Page size

Number of records to retrieve. The limit is 100.

Page number

Number of pages to skip.

Order

Order direction, ASCENDING or DESCENDING

Order example:

createdate DESCENDING

Output metadata

For the Fetch page

An object with:

  • Key results that have an array as their value.

  • Key totalCountOfMatchingResults containing the total number of results (not just on the page) matching the search criteria.

For fetch all

An object with key *results that has an array as its value.

For emit individually

Each object fills the entire message.

Create association

An action to create an association between object types.

Configuration fields

From object type

Choose an object type to create an association.

To object type

Choose an object type to which to associate.

Objects are not retrieved to associate dynamically. Read the HubSpot documentation to verify the possible association between selected objects.

Input metadata

From object ID

HubSpot ID of the object which needs to create an association.

To object ID

The ID of the associated object.

Output metadata

Object with statusCode key that represents the result of the request.

Remove association

An action to remove an association between object types.

Configuration fields

From object type

Choose from which object to remove the association.

To object type

Choose to which object to associate.

Objects are not retrieved dynamically to associate. Read the HubSpot documentation to verify the possible association between selected objects.

Input metadata

From object ID

HubSpot ID of the object which needs to remove the association.

To object ID

ID of associated object.

Output metadata

Object with the statusCode key represents the request’s result.

Delete object

Action designed to delete one object by unique field.

Configuration fields

Object type

Indicates object type to find.

ID to search On

Indicates a unique field to search on.

Input metadata

ID value text field

An ID to search for (unique field value by itself).

Output metadata

The expected output is an object with an ID property. The id value is the ID of the deleted object.

Known limitations

  • HubSpot Rate Limits

  • The use of a timer (set to about 5 seconds) may increase performance when building a flow similar to: Upsert object → any Lookup object(s) while the Enable download attachments feature is enabled. Uploading the file to HubSpot with the Upsert object action can take considerable time; this may cause a 404 error on lookup.