HubSpot CRM
HubSpot is a CRM with marketing, sales and service tools. Its workflows have the action Send a webhook: when a contact goes through the workflow, HubSpot calls an address with the fields you choose. Pointed at the Flows address, the action starts your flows: a lead came in, the stage of a contact changed, a ticket was opened — and the customer gets the right message in Viber or SMS.
This page is written from the public documentation of HubSpot and has not been checked on a live account yet.
What you need
- Data Hub Professional or Enterprise (formerly Operations Hub): the Send a webhook action is only there.
- The Edit right on workflows or Super Admin; to turn a workflow on — Publish.
- A workflow based on contacts. One action sends one event; all of them use the same address.
Step 1. Create a connection
- Open
Flows → Connections, press Connect a system and choose HubSpot CRM. - Press Copy address. It looks like
https://events.alphasms.net/hooks/<TOKEN>— keep it secret.
Step 2. Add a webhook to a workflow
- Open More → Automation → Workflows and create or open a contact-based workflow.
- Press + where the action should go and choose Data ops → Send a webhook.
- Method —
POST, Webhook URL — the address from the cabinet. HubSpot takes only HTTPS addresses, and this one is HTTPS. - Authentication type — leave it empty. If HubSpot does not let you (whether the field is required is not
confirmed by the documentation), choose API key: API key name —
Authorization, API key location — Request header, and a secret with the valueBearer <KEY>, where<KEY>is your event key — see Event key. The address alone is enough for the event to be accepted. - Request body — Customize request body. Add the fields with exactly these keys:
- Add static value: key
event, value — the name of the AlphaFlow event, for examplelead_submittedordeal_stage_changed(see Events); - Add property: key
hs_object_id— Record ID; - Add property: key
phone— Phone number (or Mobile phone number); - Add property: key
email— Email; - Add property: key
firstname— First name; - Add property: key
lastname— Last name; - Add property: key
stage— Lifecycle stage (or Lead status), fordeal_stage_changed.
- Add static value: key
- Press Save, then Test action: choose a contact, press Test and open the Request tab. The body is flat, one key — one value:
{"event":"deal_stage_changed","hs_object_id":"…","phone":"…","email":"…","firstname":"…","lastname":"…","stage":"…"}
- AlphaFlow recognises the request by the keys
eventandhs_object_id: write them exactly so. - Do not choose the mode that sends the whole record (Include all [object] properties): AlphaFlow does not read that body.
- The documentation has no sample body, so whether the values come as strings or numbers is not confirmed. Look at the Request tab.
Step 3. Send a test
Test action of the previous step sends a real request: HubSpot shows the answer on the Response tab, and
the event appears in Flows → Connections → Event journal
within seconds. The connection shows Recognised: HubSpot CRM. Then turn the workflow on.
Events
Value of event in the action | AlphaFlow event | Properties |
|---|---|---|
lead_submitted | lead_submitted | record_id, last_name |
form_submitted | form_submitted | record_id, last_name |
deal_stage_changed | deal_stage_changed | stage, record_id, last_name |
ticket_created | ticket_created | record_id, last_name |
ticket_status_changed | ticket_status_changed | stage, record_id, last_name |
ticket_closed | ticket_closed | record_id, last_name |
Put ticket_closed only into a workflow whose enrollment trigger checks the value — for example, Ticket status is
Closed. A workflow on any change of the status sends ticket_status_changed with stage: otherwise a ticket that
only moved to another status reaches the customer as "closed".
The contact is found by the phone (phone), the email (email) and the HubSpot id (hs_object_id); the first
name comes from firstname. In a contact-based workflow Record ID is the id of the contact. The values of
stage are matched to events by the table of stages in the connection: it is empty, so every value gives the
event from event, and you can edit it in the connection. The names of the events are the ones the ready-made
templates expect — see Recommended events.
Good to know
- Deals. In a deal-based workflow Record ID is the id of the deal, and whether the action can take the phone of the associated contact is not confirmed by the documentation. Without the phone the message is not sent. For a deal stage, use a contact-based workflow: the lifecycle stage of the contact, or a condition on the associated deal (not confirmed by the documentation).
- HubSpot repeats a failed request for up to 3 days: the first time after 1 minute, then with intervals growing up
to 8 hours. It does not repeat on
4XX, except429. - A contact that goes through the same workflow again with the same stage is taken for a repeat and gives no event.
- The signature
X-HubSpot-Signatureneeds the App ID of a developer app. It is not needed: the secret is in the address. - The address always answers
200. Above the daily event limit the event is refused in AlphaFlow withquota_exceededand shown in the journal; the action in HubSpot stays on. HubSpot can also slow the action down itself — Configure rate limit.