> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cometly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send HubSpot events with workflow webhooks

> Send HubSpot events to Cometly with a HubSpot workflow webhook, so leads, booked meetings and closed deals are tied back to the ads behind them.

A HubSpot workflow webhook sends data from HubSpot to Cometly each time a contact enters a workflow you choose. Cometly receives it as a server event: an event (a conversion such as a lead, a booked meeting or a closed deal) that arrives from a server instead of from your website.

This matters because much of what happens to a lead happens in HubSpot, after the form fill. Once those moments reach Cometly, you can see which ad or channel produced each one, and you decide in the workflow exactly which events are sent and when.

Webhooks in HubSpot workflows are an alternative to Cometly's direct HubSpot integration. To use the direct integration instead, see [HubSpot](https://docs.cometly.com/integrations/platforms/hubspot.md).

> [!WARNING]
>
> Workflows must be included in your HubSpot plan to send server events directly from HubSpot. If your plan does not include Workflows, you can use [Zapier](https://docs.cometly.com/integrations/zapier.md) to send events.

If you use HubSpot marketing forms on your website, make sure your forms are tracked properly before you send events. See [HubSpot legacy forms](https://docs.cometly.com/integrations/forms/hubspot-legacy-forms.md) or [HubSpot forms (new forms)](https://docs.cometly.com/integrations/forms/hubspot.md).

## Before you start

You need a Cometly API token. In Cometly, go to **Integrations** > **Cometly API**, click **Activate Cometly API** if it is not active yet, then create a token under **API Tokens** with **Create Token**. See [Cometly API](https://docs.cometly.com/integrations/api.md).

![Step 2 Manage API tokens on the Cometly API page, showing the Token Name field and the Your Tokens list, with a box around the Create Token button.](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/17.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=66c328fa08e8478c840c3df76863ce5e)

## Send an event from a HubSpot workflow

**1. Configure your HubSpot workflow trigger**

Create a new HubSpot workflow and configure the trigger based on the event you want to send to Cometly.

**2. Add the Send a webhook action**

Create an action and choose **Send a webhook**.

**3. Configure the webhook**

1. For **Method**, select **POST**.

   ![HubSpot Send a webhook panel with POST highlighted in the Method list](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/03.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=eedc61973078ea8bc0df276703656daf)

2. For **Webhook URL**, enter:

   ```text theme={null}
   https://app.cometly.com/public-api/v1/events
   ```

   ![HubSpot webhook action with Method POST and the Cometly API URL in Webhook URL](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/04.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=3b382b2109b83fec908b5eb7b109e343)

3. For **Authentication type**, select **API Key**.

   ![HubSpot Authentication type list with API Key selected](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/05.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=f359e299021a1f7eef64e7f38295f3fd)

4. For **API key**, click **Add secret**.

   ![HubSpot API key secret list with the Add secret link highlighted](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/06.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=d7871563298714b917fa993933639178)

5. For **Secret name**, enter `cometly` or any other name that identifies the Cometly key. For **Secret value**, enter `Bearer XXXXXXXXXXXXXXXX`, with your Cometly API token in place of `XXXXXXXXXXXXXXXX`.

   ![HubSpot Add secret dialog with the name cometly and a Bearer placeholder value](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/07.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=1de7789feaa939e5159968247b5c0e48)

   Example secret value:

   ```text theme={null}
   Bearer 82828D72FHDGELWL827273847dDDFFDG
   ```

6. Make sure **API key name** is **Authorization** and **API key location** is **Request header**.

   ![HubSpot API key name set to Authorization and API key location set to Request header](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/08.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=4735e68bf490243518485a5cec4250fb)

**4. Build the request body**

The request body has property values and static values. A property value is filled in from a HubSpot property, so it changes with each contact. A static value is fixed.

**Static value**

The only static value should be the key `event_name`, with the name of the event as its value. You can find the event names (standard events and `custom_event_1` to `custom_event_50`) in the [Create Event](https://docs.cometly.com/api-reference/endpoint/create-event.md) reference.

![HubSpot request body with a static value event\_name set to custom\_event\_1](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/09.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=b81e86a383542217f9cac64c10fa1a5a)

**Property values**

The property keys must match the field names in the [Create Event](https://docs.cometly.com/api-reference/endpoint/create-event.md) reference. For each key, choose the HubSpot property to send where it says **Select a property**.

> [!WARNING]
>
> An `event_name` and an `email` are required in the payload. You can add any other field available in the Cometly developer documentation.

![HubSpot request body mapping email, first\_name, last\_name, phone and amount to HubSpot properties](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/10.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=31d70425ed2291eecfd28c3b1021c393)

**5. Save and test**

1. **Save** the webhook configuration.
2. Enroll a contact to test the workflow.
3. In Cometly, go to **Events Manager** and open the **Events Log** tab to check that the server event was received.

## Configure a HubSpot trigger for a booked meeting

This section shows you how to set up a HubSpot workflow trigger that fires when a new meeting is booked.

### Open the workflow builder

1. Log in to your HubSpot account.
2. Go to **Automation** > **Workflows** in the main menu.
3. Open the workflow where you want to set up the trigger.

### Configure the enrollment trigger

1. In the workflow editor, click **Enrollment Triggers** in the left-hand panel.

2. Under "Automatically trigger enrollment", select **When an event occurs**.

   ![HubSpot Enrollment triggers panel with When an event occurs highlighted](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/12.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=aaee805492e432ff77d7aa63bc407f5a)

3. Choose the event type **Meeting booked**. It shows as ***Has completed: Meeting booked***.

   ![HubSpot enrollment trigger showing Has completed: Meeting booked](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/13.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=9c42608f8bd87c8709f5e60765f5521c)

4. Add criteria to filter the meeting type, for example meeting type equals **Product Demo**. You can use any criteria, so that the workflow only triggers when that specific meeting is booked.

   ![HubSpot Add criteria list for Meeting booked, including Call and meeting type](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/14.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=1aa5a22eb8d5940a99578d4ac4805a19)

5. Click **Done** to confirm the setup.

### Re-enrollment settings

Leave re-enrollment **OFF** to prevent duplicate enrollments, so Cometly tracks the first time a new meeting is booked. If you want to track every meeting, you can turn re-enrollment on, but we recommend keeping it off for better data.

![HubSpot Re-enrollment tab with the re-enroll toggle set to OFF](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/hubspot-webhooks/15.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=097b73ffd5eaab7e44626cbf3713e794)

### Add the action that sends the webhook to Cometly

1. Add the action that runs when the trigger fires: select **Send a webhook** under **Data ops**.
2. Configure the webhook settings (URL, authentication and payload) in one of two ways:
   * As described in [Send an event from a HubSpot workflow](#send-an-event-from-a-hubspot-workflow) above.
   * With a Cometly webhook URL. Add the URL to the action, and HubSpot sends the data to Cometly. The [Cometly webhooks guide](https://docs.cometly.com/integrations/webhooks.md) explains how to create the webhook in Cometly, select or create its event, map the webhook data to the Cometly fields, and set up filters so only the data you want is tracked.

### Review and publish the workflow in HubSpot

1. Review your workflow to make sure all conditions and actions are configured correctly.
2. Click **Save** to finalize the trigger and **Publish** to activate the workflow.

## Send Deal Won to Cometly with Zapier

You can also send HubSpot deal events with [Zapier](https://docs.cometly.com/integrations/zapier.md). The video below shows how to send a closed won deal to Cometly.

[Closed Won Revenue from HubSpot to Cometly](https://player.vimeo.com/video/866106227)

## Check it worked

Enroll a test contact in the workflow, then open **Events Manager** in Cometly and click the **Events Log** tab. With **Source** set to **Server**, the event you sent is listed, and its **Details** column shows **SUCCESS**.

## Frequently asked questions

### Should I use HubSpot workflow webhooks or the Cometly HubSpot integration?

Use the direct [HubSpot integration](https://docs.cometly.com/integrations/platforms/hubspot.md) if its triggers cover what you need: a contact created, a contact or deal property change, or a deal created, moved or won. Use workflow webhooks when you want full control over which events are sent and when, such as a booked meeting of one specific type.

### Why is my HubSpot webhook event not showing up in Cometly?

Check the request first. Cometly rejects it when the API token is missing or invalid, or when the body has no `event_name` or no `email`, so confirm the secret value starts with `Bearer ` followed by your token and that both keys are in the request body. Then open the **Events Log**: an event with a problem has a red badge, and its **Details** column shows the error message.

### Can I send the deal or sale amount from HubSpot to Cometly?

Yes. Add the key `amount` to the request body and choose the HubSpot property that holds the value. The value must be a number.

## Next steps

* [Connect HubSpot with the direct HubSpot integration](https://docs.cometly.com/integrations/platforms/hubspot.md)
* [Create a Cometly webhook and map its data](https://docs.cometly.com/integrations/webhooks.md)
* [Check incoming events in the Events Log](https://docs.cometly.com/support/troubleshooting/general/event-log.md)
* [Send HubSpot deals to Cometly with Zapier](https://docs.cometly.com/integrations/guides/hubspot-deals-zapier.md)
* [See every field you can send in the Create Event reference](https://docs.cometly.com/api-reference/endpoint/create-event.md)

Still have questions or need a hand? We're happy to help. Reach our team at [support@cometly.com](mailto:support@cometly.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.