Receive HubSpot webhooks
HubSpot signs webhooks with your app's client secret. It uses three signature versions, so DataLug has an option for each:
| HubSpot sends | Signature setting |
|---|---|
X-HubSpot-Signature-v3 | HubSpot app webhook |
X-HubSpot-Signature with X-HubSpot-Signature-Version: v1 | HubSpot private or legacy app (v1) |
X-HubSpot-Signature with X-HubSpot-Signature-Version: v2 | HubSpot workflow webhook |
Receive a webhook from any system covers the shared settings.
App webhook subscriptions
- In Manage Account > Webhooks, select New webhook, enter a name and set Signature to HubSpot app webhook.
- Paste your HubSpot app's client secret into Client secret and press Create webhook.
- In HubSpot, open Development > Legacy apps, select your app and open Webhooks.
- Paste the DataLug webhook URL into Target URL and save.
DataLug checks the X-HubSpot-Signature-v3 header over the request method, the full webhook URL,
the body and the X-HubSpot-Request-Timestamp header, and refuses a request more than 5 minutes old.
Private and legacy app webhooks (v1)
Use this when your app's webhook requests carry X-HubSpot-Signature-Version: v1.
- In Manage Account > Webhooks, select New webhook, enter a name and set Signature to HubSpot private or legacy app (v1).
- Paste the app's client secret into Client secret and press Create webhook. For a private app, the client secret is on the app's Auth tab.
- In HubSpot, open Development > Legacy apps, select your app and open Webhooks.
- Select Edit webhooks, paste the DataLug webhook URL into Target URL and save.
DataLug checks the X-HubSpot-Signature header over the client secret and the body. A v1
signature has no timestamp, so a repeated request is refused by its event id instead.
Workflow webhook actions
- In Manage Account > Webhooks, select New webhook, enter a name and set Signature to HubSpot workflow webhook.
- Paste the client secret of the app that signs the request into Client secret and press Create webhook.
- In the HubSpot workflow, add the Data ops > Send a webhook action and paste the DataLug webhook URL into its webhook URL field.
- Select Include request signature in header and enter the app ID of the app whose client secret you pasted in step 2.
DataLug checks the X-HubSpot-Signature header with X-HubSpot-Signature-Version: v2, over the
client secret, the request method, the full webhook URL and the body.
HubSpot signs the URL it sends to. Paste the webhook URL exactly as the card shows it.
Batches
HubSpot sends several events in one request. Each event becomes its own delivery and its own run,
and HubSpot gets one 200 for the request.
Duplicates
Each event's subscription id, event id and time together are its event id: an event that arrives again, alone or in a later batch, runs once, and an event repeated inside one batch runs once. A request from a workflow action has no event id; it is a duplicate only when its body repeats within 24 hours.
Changing the client secret
Open the webhook's Settings, enter the new secret in Client secret and press Save settings. The old secret keeps working for 24 hours.