# Hubspot

## Create a Ticket in Hubspot via Webhook Template

Follow the below steps to configure the “Hubspot - Create Ticket” action via webhooks.

1. Login to your **Hubspot portal** -> click on the drop down on the top right -> click **Profile & Preferences**

<figure><img src="/files/Uvf1jL4yzBBfuBNy29Wu" alt=""><figcaption></figcaption></figure>

2. Click on **Integrations** -> **Private apps** -> click on **Create a private app**

<figure><img src="/files/y930vIgQJ61GBmFHjr4c" alt=""><figcaption></figcaption></figure>

3. Add the name and description of the App in the Basic info section.

<figure><img src="/files/aNN5Qbv0zJSb8V9Gucrm" alt=""><figcaption></figcaption></figure>

4. Make sure to give all of the permissions ( Read and Write) in the Scopes section of the app. ( make sure that you have enabled the "tickets" permission)

<figure><img src="/files/21ccY7PLV8t4NKS8XTw1" alt=""><figcaption></figcaption></figure>

5. Click on **Create App** and make sure to copy the **Access Token** shown in the next screen.

<div><figure><img src="/files/HFt9kU8WKIlToEEasgK6" alt=""><figcaption></figcaption></figure> <figure><img src="/files/maINd2wcmNtCusHCSieM" alt=""><figcaption></figcaption></figure></div>

## Using Webhooks to create Hubspot tickets for Squadcast Incidents

1. Navigate to **Settings** -> **Webhooks**.
2. Click **Add Webhook**. On the next screen, you will be guided through three steps. Navigate between these steps by clicking on any of the steps on the top bar.
3. **Add Webhook Details**:

   1. **Webhook Name**: Enter the webhook name as **Hubspot - Create Ticket**.
   2. **Webhook Description** (optional): Enter an optional description. For example - This webhook is for ticket creation in Hubspot for Squadcast Incidents.
   3. **Failure Notification Email** (optional): Enter an email where you want to receive failure notifications. This is particularly helpful when you (or an administrator) want to be notified of webhook-related failures.
   4. **URL**: Copy and paste the below API.
   5. **Additional Headers**: Add `Key: Authorization` and paste the `Value` copied from Hubspot with the prefix **Bearer**

   [<mark style="color:blue;">https://api.hubapi.com/crm/v3/objects/tickets</mark>](https://api.hubapi.com/crm/v3/objects/tickets)

<figure><img src="/files/kLSHxStX7K4w3z5p4Nqm" alt="" width="563"><figcaption></figcaption></figure>

Click **Next: Choose Webhook Type**, and navigate to the next step.

4. **Choose Webhook Type**: Choose Webhook type (Manual or Automatic) and add configurations.
   1. **Manual Webhook**: Manually trigger Webhooks under incidents, on demand. Under Manual Webhook, select the teams that are authorized to access the Webhook. You can select All Teams or enter specific Teams, from the drop-down.

{% hint style="info" %}
**Note:**

Select this option only if you want to create Hubspot tickets manually on-demand. If you want a ticket, created automatically when certain conditions are met, please choose Automatic webhooks.
{% endhint %}

2. **Automatic Webhook**: Automatically trigger Webhooks when the configured conditions match. To set up Automatic Webhook Configurations:
3. **Versions**: Select **v2**
4. **Triggers**: Select the following Trigger events (conditions) for which the Webhook will be triggered:
   1. Incident Triggered (This will create a Hubspot ticket whenever a new incident gets triggered in Squadcast)
5. **Filters**: You can apply filters on top of events, based on Teams, Services, Alert Sources, and Tags, by having an individual expression or a combination of expressions/expression groups.

Applying filters will trigger the webhook and create Freshservice tickets only for events that match the filter.

<figure><img src="/files/SqzILKg3clE6qlvg43oE" alt="" width="563"><figcaption></figcaption></figure>

Click **Next: Configure Payload**, and navigate to the next step.

5. **Configure Payload**:\
   \
   Select the pre-configured template for **Hubspot - Create Ticket**. You can also test the Webhook by clicking the **Test Webhook** on the bottom right.

<figure><img src="/files/Sy4ozjQCZUGTtw7cXajv" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:**

We have added the necessary fields in the template. You can change the **"hs\_ticket\_priority"** and **"hs\_pipeline"** according to your use case and add additional ticket fields.

You can also [use this link](https://knowledge.hubspot.com/properties/hubspots-default-ticket-properties) to check the fields accepted by Hubspot API.
{% endhint %}

Click **Save** and your **Webhook** is created.

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.incidents.cloud.solarwinds.com/integrations/extensions/hubspot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
