HubSpot connects in two ways, which you can use together:
- CRM sync: after each analysed call, the caller is upserted as a HubSpot contact and a note with the call summary is attached. See CRM sync.
- Integration app: the agent creates a contact or adds a note while the caller is on the line. See Integration apps.
Connect#
OAuth Needs keys#
On Settings, Integrations, CRM sync, press Connect on the HubSpot card and approve access. Tried requests the scopes crm.objects.contacts.read, crm.objects.contacts.write and crm.schemas.contacts.read. The deployment needs HUBSPOT_OAUTH_CLIENT_ID and HUBSPOT_OAUTH_CLIENT_SECRET. See OAuth connections.
For the app, use Connect app, choose HubSpot, then Connect with HubSpot account.
Private app token#
Create a HubSpot private app with the contact read and write scopes and copy its access token. Then press Use API token on the HubSpot card (or fill the credentials in Connect app).
| Credential | Required | Description |
|---|---|---|
access_token |
Yes | Private app token or OAuth access token |
base_url |
No | API host. Default https://api.hubapi.com |
curl -X PUT https://api.tried.com.au/update-crm-config/hubspot \
-H "Authorization: Bearer $TRIED_API_KEY" \
-H "Content-Type: application/json" \
-d '{"credentials": {"access_token": "pat-ap1-..."}, "enabled": true}'Check the connection with Test connection or POST /test-crm-auth/hubspot, which reads one contact.
Contact sync#
For each contact, Tried:
- Searches HubSpot contacts where
phoneequals the caller's E.164 number. - Updates the first match with
PATCH /crm/v3/objects/contacts/{id}, or creates a contact withPOST /crm/v3/objects/contacts. - Creates a note (
POST /crm/v3/objects/notes) associated with the contact, withhs_note_bodyset to the note title and body andhs_timestampset to the call start time.
Properties sent:
| HubSpot property | Value |
|---|---|
phone |
Contact phone number |
firstname |
Contact first name, when set |
lastname |
Contact last name, when set |
email |
Contact email, when set |
| Mapped properties | From field_mapping |
Default fields shown in mock mode: firstname, lastname, email, phone, lifecyclestage, hs_lead_status. With credentials, GET /get-crm-schema/hubspot returns all your contact properties.
{ "lifecyclestage": "stage", "hs_lead_status": "lead_status" }Agent functions#
| Action | Arguments | Output |
|---|---|---|
hubspot.create_contact |
phone (required, E.164), first_name, last_name, email |
{"contact": {"id": "12345"}} |
hubspot.create_note |
contact_id (required), body (required) |
{"note": {"id": "67890"}} |
create_contact uses the same search-then-update-or-create logic as sync, so it never makes a duplicate for a known phone number. Chain the two: save contact.id with response_variables ({"hubspot_contact_id": "contact.id"}), then pass {{hubspot_contact_id}} to create_note.
{
"type": "integration_app",
"name": "hubspot_create_contact",
"description": "Create (or update by phone) a HubSpot contact.",
"app_id": "app_7a3d1f5c9e2b6a0d4f8c1e52",
"action": "hubspot.create_contact",
"response_variables": { "hubspot_contact_id": "contact.id" }
}Mock mode#
Without credentials, sync records each operation and returns ids like mock_hubspot_3f9a1c2b7d4e, and the app actions return sample ids. The card shows Mock.