SourceLace Docs
Open the app

HubSpot

How to connect HubSpot's CRM: contacts, companies, deals, tickets, owners and custom objects, with optional confirmed changes. Each person signs in with their own HubSpot login.

Status: in testing. Built against HubSpot's documented API and covered by automated tests against a simulated HubSpot; not yet used with a customer's live account.

How sign-in works

SourceLace has its own HubSpot app. Each person signs in to HubSpot with their own login, chooses the HubSpot account, and approves the app. HubSpot then shows SourceLace only what that person could see in HubSpot itself.

What your HubSpot admin may need to do: to install an app into a HubSpot account, HubSpot may require the person to be a Super Admin or to have the App Marketplace access permission. If people cannot approve the app, a HubSpot admin either approves it first or gives them that permission. HubSpot may also warn that the app is not verified.

Permissions SourceLace asks for:

When Scopes
Always (reading) oauth, crm.objects.contacts.read, crm.objects.companies.read, crm.objects.deals.read, crm.objects.tickets.read, crm.objects.owners.read, crm.schemas.contacts.read, crm.schemas.companies.read, crm.schemas.deals.read, crm.schemas.tickets.read
Optional (custom objects, Enterprise plans only; HubSpot leaves them out for accounts without custom objects) crm.objects.custom.read, crm.schemas.custom.read
Only for objects your SourceLace admin made writable crm.objects.contacts.write, crm.objects.companies.write, crm.objects.deals.write, crm.objects.tickets.write, crm.objects.custom.write

With changes off, nobody is asked for write access.

Add the source (SourceLace admin)

On Manage sources → Add a source, choose HubSpot (hubspot).

Option Type Default Example What it is
hub_id Number (none) 12345678 Optional but recommended: the HubSpot account ID (in the account menu at the top right, or the address bar, as in app.hubspot.com/contacts/12345678/...). Many people belong to more than one HubSpot account; with hub_id set, SourceLace refuses a sign-in to any other account.

Changes are off unless you turn them on. HubSpot's object names are lowercase plurals: contacts, companies, deals, tickets, or a custom object's name as search_schema shows it (such as p12345678_cars). Owners cannot be changed. After turning changes on or changing the objects, people connect HubSpot again so their sign-in gets the new write permission.

What people can do

  • search_schema and describe_object list objects and their properties.

  • query takes the hubspot_search language: one JSON object in the shape of HubSpot's own search API, plus the object to search:

    {"object": "deals",
     "properties": ["dealname", "amount", "dealstage"],
     "filterGroups": [{"filters": [{"propertyName": "amount", "operator": "GT", "value": "1000"}]}],
     "sorts": [{"propertyName": "amount", "direction": "DESCENDING"}],
     "limit": 100}
    

    Up to 5 filter groups (a record matches if any group matches), each with up to 6 filters that must all match (18 filters in all). Operators: EQ, NEQ, LT, LTE, GT, GTE, BETWEEN (with value and highValue), IN and NOT_IN (with values), HAS_PROPERTY, NOT_HAS_PROPERTY, CONTAINS_TOKEN, NOT_CONTAINS_TOKEN. query searches text across the main fields; sorts takes one sort. {"object": "owners"} lists the users who can own records. Every key, operator and property name is checked before anything is sent.

  • get_record reads one record by its id (digits only), with associated records as related lists.

  • Changes (create, update, delete one record at a time), on the objects your admin made writable, after a preview and the person's confirmation. Deleting moves the record to HubSpot's recycling bin, where a HubSpot admin can restore it for 90 days.

Limits: SourceLace fetches 200 rows at a time up to its usual 2,000-row limit; HubSpot itself stops a search at 10,000 rows. HubSpot allows a few searches per second per account: when it asks SourceLace to slow down, SourceLace waits and tries again twice before giving up with a clear message. HubSpot sign-ins last 30 minutes and are refreshed automatically.

When something goes wrong

What you see What to do
"You signed in to HubSpot account ..., but ... is account .... Connect again and choose that account." The person picked the wrong HubSpot account on the sign-in page. Connect again and choose the account in hub_id.
"The HubSpot hub_id for ... must be the account's number, such as 12345678." Fix the hub_id option: digits only.
"HubSpot: your sign-in does not include the permission this needs. If an admin just turned on writes, connect the source again..." Connect HubSpot again. If it persists, the person's HubSpot role lacks the permission.
"HubSpot is limiting how fast SourceLace can call it. Wait a few seconds and try again." Wait and ask again.
"HubSpot: that record does not exist, or you cannot see it." Check the id; the person may lack access in HubSpot.
"... has no property ... Use describe_object to see the property names." The query used a property name that does not exist on that object.
"HubSpot owners are users and cannot be changed through SourceLace." Owners are read-only.
"HubSpot sign-in failed: ..." HubSpot's own reason follows. Often the person cannot install apps in that account (see above).
"The hubspot connector is switched off on this server..." SourceLace's HubSpot app is not set up on this server yet. Contact support.