> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-ai-for-work-dev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the HubSpot Action Templates

<Badge icon="arrow-left" color="gray">[Back to Actions Integrations](/ai-for-service/integrations/overview#actions)</Badge>

Use prebuilt HubSpot action templates to auto-create dialog tasks for managing deals and contacts.

**Prerequisites:** Configure [HubSpot](/ai-for-service/integrations/actions/configuring-the-hubspot-action) and [install templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

To access dialog tasks: Go to **Automation AI** > **Use Cases** > **Dialogs** and click the auto-created dialog. The canvas opens with all required entity nodes, service nodes, and message scripts.

***

## Supported Actions

| Task                      | Description                   | Method |
| ------------------------- | ----------------------------- | ------ |
| Create a Deal             | Creates a new deal.           | POST   |
| Get Deal by Id            | Retrieves deal details.       | GET    |
| Update a Deal             | Updates deal details.         | PATCH  |
| List all Deals            | Retrieves all deals.          | GET    |
| Search Deal by Keyword    | Searches deals by keyword.    | GET    |
| Delete Deal               | Deletes a deal.               | DELETE |
| Create a Contact          | Creates a new contact.        | POST   |
| Get Contact by Id         | Retrieves contact details.    | GET    |
| List All Contacts         | Retrieves all contacts.       | GET    |
| Update a Contact          | Updates contact details.      | PATCH  |
| Search Contact by Keyword | Searches contacts by keyword. | GET    |
| Delete a Contact          | Deletes a contact.            | DELETE |

***

### Create a Deal

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Create a Deal** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img4.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=fc3d8233274b34222306693b44f8a88e" alt="Create a Deal dialog task added" width="1516" height="908" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img4.png" />

   * **createDeal** - User intent to create a deal.

   * **dealName**, **dealStage** - Entity nodes for deal details.

   * **createDealService** - Bot action service to create a deal. Click **+** to expand and click **Edit Request** to modify parameters.

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img5.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=7cb37480be9292052c59a337a7f0a22a" alt="Edit request" width="1910" height="816" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img5.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "properties": {
         "dealname": "Custom data integrations",
         "dealstage": "presentationscheduled",
         "pipeline": "default"
       }
     }
     ```

     Click **+Add Response** to add responses:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img6.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=9548a1da4eadc0db23d0a066a9f29ef2" alt="Add response" width="1913" height="763" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img6.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "10146264661",
       "properties": {
         "createdate": "2022-09-11T10:06:55.570Z",
         "dealname": "Integrations",
         "dealstage": "presentationscheduled",
         "pipeline": "default"
       },
       "createdAt": "2022-09-11T10:06:55.570Z",
       "updatedAt": "2022-09-11T10:06:55.570Z",
       "archived": false
     }
     ```

   * **getAccountService** - Bot action service to get account details.

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img7.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=b0e96654420dee806fbb0872ae3ccaae" alt="getAccountService" width="1917" height="830" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img7.png" />

   * **createDealMessage** - Message node to display responses.

3. Click **Train** to complete dialog task training.

4. Click **Talk to Bot** to test and debug.

5. Follow prompts to create a deal:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img8.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=c3ff3200ef2d791d48dc90c6890b83fc" alt="VA prompts to create a deal" width="552" height="836" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img8.png" />

6. The new deal is created in HubSpot:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img9.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=37c28017fe354d839122ca9dfb743f73" alt="New deal created" width="564" height="840" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img9.png" />

7. Click **View Deal** to see deal details in HubSpot:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img10.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=452eb47f899475cf5d500922c73f9604" alt="View deal details" width="1919" height="811" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img10.png" />

***

### Get a Deal by ID

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Get Deal by Id** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img11.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=28eed4db55bcf4fe91d47c43004b6a0d" alt="Get Deal ID dialog task added" width="1521" height="908" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img11.png" />

   * **getDeal by Id** - User intent to get a deal by ID.

   * **dealID** - Entity node for entering the deal ID.

   * **getDealService** - Bot action service to fetch deal. Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img12.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=011c2f01411de5c2faf7319839921931" alt="Add Response" width="1905" height="801" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img12.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "10099894869",
       "properties": {
         "dealname": "Nike deal",
         "dealstage": "appointmentscheduled",
         "pipeline": "default"
       },
       "createdAt": "2022-09-07T13:52:04.184Z",
       "updatedAt": "2022-09-10T14:13:05.712Z",
       "archived": false
     }
     ```

   * **getAccountService** - Bot action service to get account details.

   * **getDealMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img13.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=88bc6ae8f35469b5d35dcf6392e1c44a" alt="VA prompt to get deal by id" width="553" height="835" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img13.png" />

4. Click **View Deal** to see deal details.

***

### List All Deals

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **List All Deals** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img14.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=547ca8dc541ae09d00a03f1986940ac6" alt="List All Deals dialog task is added" width="1517" height="907" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img14.png" />

   * **List All Deals** - User intent to list all deals.

   * **listAllDealsService** - Bot action script to view all deals. Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img15.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=cb01787825a884ee5a150435a0ec3e9d" alt="Add response" width="1905" height="818" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img15.png" />

     **Sample Response:** (truncated for brevity)

     ```json theme={null}
     {
       "total": 7,
       "results": [
         {
           "id": "10274255383",
           "properties": {
             "dealname": "Adidas deal",
             "dealstage": "qualifiedtobuy",
             "pipeline": "default"
           },
           "createdAt": "2022-09-22T07:23:17.500Z",
           "archived": false
         }
       ]
     }
     ```

   * **getAccountService** - Bot action service to get account details.

   * **listAllDealsMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test and follow prompts.

***

### Update a Deal

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Update a Deal** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img16.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=2e1df0025dd391a961977235b663405d" alt="Update a Deal dialog task is added" width="1625" height="901" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img16.png" />

   * **Update a Deal** - User intent to update a deal.

   * **dealId**, **dealUpdate**, **dealName**, **dealStage** - Entity nodes for updating deal details.

   * **updateDealScript** - Bot action script to update a deal.

   * **updateDealService** - Bot action service to update a deal:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img17.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=ca4dfba669f7a7029c564ddd6cd624c6" alt="Update a Deal dialog task is added" width="1902" height="814" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img17.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "properties": {
         "dealname": "Adidas Deal",
         "dealstage": "closedwon"
       }
     }
     ```

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img18.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=575662dccd25dd94839cea40d1a9fa40" alt="Add response" width="1919" height="742" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img18.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "10123889765",
       "properties": {
         "dealname": "Adidas Deal",
         "dealstage": "closedwon",
         "pipeline": "default"
       },
       "createdAt": "2022-09-09T06:45:26.228Z",
       "updatedAt": "2022-09-11T10:54:30.961Z",
       "archived": false
     }
     ```

   * **getAccountService**, **getDealService** - Bot action services.

   * **updateDealMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img19.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=cbe4c0b910245583bf90e4f2f7d95a05" alt="VA prompts to update deal" width="558" height="838" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img19.png" />

4. Enter all deal details when prompted. The deal is updated in HubSpot:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img20.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=b13438fe8638656d85e4cdfdc870f354" alt="Deal updated" width="548" height="844" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img20.png" />

5. Click **View Deal** to see updated details.

***

### Search Deal by Keyword

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Search Deal by Keyword** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img21.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=02e7452413e6322d33f1eb10a4330f99" alt="Search Deal by Keyword dialog task is added" width="1520" height="913" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img21.png" />

   * **Search Deal** - User intent to search a deal.

   * **Keyword** - Entity node for search keywords.

   * **searchDealService** - Bot action script to search deals:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/r7ifGMsN_f_HHKjV/ai-for-service/integrations/actions/images/hubspot-tem-img22.png?fit=max&auto=format&n=r7ifGMsN_f_HHKjV&q=85&s=59c38c9d3ca2feffaf31b2fe328ce067" alt="searchDealService" width="1917" height="828" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img22.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "sorts": [{"propertyName": "createdate", "direction": "DESCENDING"}],
       "query": "abac"
     }
     ```

     **Sample Response:** (truncated)

     ```json theme={null}
     {
       "total": 3,
       "results": [
         {
           "id": "10274255383",
           "properties": {
             "dealname": "Adidas deal",
             "dealstage": "qualifiedtobuy"
           },
           "archived": false
         }
       ]
     }
     ```

   * **getAccountService** - Bot action service to get account details.

   * **searchDealMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img23.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=519bdb58b06f60f3be99712c717da5d3" alt="VA prompt to view all deals" width="557" height="844" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img23.png" />

***

### Delete a Deal

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Delete Deal** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img24.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=e78390d089c2427dda34eb53dbfd30b1" alt="Delete Deal dialog task is added" width="1525" height="908" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img24.png" />

   * **Delete Deal** - User intent to delete a deal.

   * **DealId** - Entity node for the deal ID.

   * **deleteDealService** - Bot action script to delete a deal:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img25.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=48bcc0424419bd029bd792195e2ecd1a" alt="deleteDealService" width="1917" height="839" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img25.png" />

   * **getAccountService** - Bot action service to get account details.

   * **deleteDealMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img26.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=a01288935fe14a98ccf70de893296184" alt="VA prompt to delete deal" width="555" height="846" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img26.png" />

<Note>If you enter an incorrect ID, a **404 - No Record Found** error is displayed.</Note>

***

### Create a Contact

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Create a Contact** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img27.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=6e4f024da6e30cde58b913b4eff03d28" alt="Create a Deal dialog task is added" width="1517" height="912" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img27.png" />

   * **createContact** - User intent to create a contact.

   * **Email**, **firstName**, **lastName**, **phone** - Entity nodes for contact details.

   * **createContactService** - Bot action service to create a contact. Click **Edit Request**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img28.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=4e8c913e3d3209727cdb151ab3c18b56" alt="Edit request" width="1919" height="802" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img28.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "properties": {
         "email": "harry@abac.com",
         "firstname": "Harry",
         "lastname": "Anthony",
         "phone": "(877) 829-06966777"
       }
     }
     ```

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img29.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=dfe617414d0755781b3744d3d9242251" alt="Add response" width="1917" height="744" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img29.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "1201",
       "properties": {
         "email": "harry.anthony@abac.com",
         "firstname": "harry",
         "lastname": "anthony",
         "lifecyclestage": "lead"
       },
       "createdAt": "2022-09-21T05:54:29.872Z",
       "archived": false
     }
     ```

   * **getAccountService** - Bot action service to get account details.

   * **createContactMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test.

***

### Get a Contact by ID

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Get Contact by Id** dialog task is added with the following components:
   * **getContact by Id** - User intent to get a contact by ID.

   * **contactID** - Entity node for the contact ID.

   * **getContactService** - Bot action service to fetch contact. Click **Edit Request**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img30.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=279d3df99dad36d48ddcf9cfed23c6f4" alt="Edit request" width="1913" height="826" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img30.png" />

   * Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img31.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=5e65c81533b903bc38c4fe9084d50067" alt="Add response" width="1905" height="728" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img31.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "1201",
       "properties": {
         "email": "harry.anthony@abac.com",
         "firstname": "harry",
         "lastname": "anthony"
       },
       "createdAt": "2022-09-21T05:54:29.872Z",
       "archived": false
     }
     ```

   * **getAccountService** - Bot action service to get account details.

   * **getContactMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test.

***

### List All Contacts

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **List All Contacts** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img32.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=1069219cc3102c7741a15a7dba987181" alt="List All Contacts dialog task is added" width="1512" height="910" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img32.png" />

   * **List All Contacts** - User intent to list all contacts.

   * **listAllContactsService** - Bot action script to view all contacts:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img33.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=fbea88a19819ea4acd693859d9d299f6" alt="listAllContactsService" width="1898" height="798" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img33.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "sorts": [{"propertyName": "createdate", "direction": "DESCENDING"}]
     }
     ```

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img34.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=bf6fd5df3a37c411952b5f33f8556998" alt="listAllContactsService" width="1907" height="744" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img34.png" />

     **Sample Response:** (truncated)

     ```json theme={null}
     {
       "total": 6,
       "results": [
         {
           "id": "1401",
           "properties": {
             "email": "getkgw@zomato.com",
             "firstname": "John",
             "lastname": "Doe"
           },
           "archived": false
         }
       ]
     }
     ```

   * **getAccountService** - Bot action service to get account details.

   * **listAllContactsMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test.

***

### Update a Contact

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Update a Contact** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img35.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=5c0ebf42b196dd8fd98c200ff2523622" alt="Update a Contact dialog task is added" width="1521" height="909" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img35.png" />

   * **UpdateContact** - User intent to update a contact.

   * **contactId**, **contactUpdate**, **email**, **firstName**, **lastName**, **phone** - Entity nodes.

   * **updateContactScript** - Bot action script to update contact.

   * **updateContactService** - Bot action service to update contact:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img36.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=6b9022e72c451e0867d14c9efd4e4752" alt="updateContactService" width="1919" height="796" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img36.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "properties": {
         "email": "harry.anthony@abac.com"
       }
     }
     ```

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img37.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=0f01574dc9f33f55c5e63b96aced4050" alt="Add response" width="1904" height="721" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img37.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "1201",
       "properties": {
         "email": "harry.anthony@abac.com",
         "lastmodifieddate": "2022-09-21T06:18:56.655Z"
       },
       "updatedAt": "2022-09-21T06:18:56.655Z",
       "archived": false
     }
     ```

   * **getAccountService**, **getContactService** - Bot action services.

   * **updateContactMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test.

***

### Search Contact by Keyword

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Search Contact by Keyword** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img38.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=ace3fc7c7e754937070a362b00d0f26c" alt="Search Contact by Keyword dialog task is added" width="1520" height="907" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img38.png" />

   * **Search Contact** - User intent to search a contact.

   * **Keyword** - Entity node for search keywords.

   * **searchContactService** - Bot action script to search contacts:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img39.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=cb779865ef6974eef9639227b3fd9fe5" alt="searchContactService" width="1910" height="814" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img39.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "sorts": [{"propertyName": "createdate", "direction": "DESCENDING"}],
       "query": "abac"
     }
     ```

     **Sample Response:**

     ```json theme={null}
     {
       "total": 1,
       "results": [
         {
           "id": "1201",
           "properties": {
             "email": "john.doe@example.com",
             "firstname": "Work",
             "lastname": "Assist"
           },
           "archived": false
         }
       ]
     }
     ```

   * **getAccountService** - Bot action service to get account details.

   * **searchContactMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test.

***

### Delete a Contact

1. Install the template from [HubSpot Action Templates](/ai-for-service/integrations/actions/configuring-the-hubspot-action#step-2-install-the-hubspot-action-templates).

2. The **Delete Contact** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img40.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=3b6ab4f5cc3064376cda7d231c1ab439" alt="Delete Contact dialog task is added" width="1520" height="905" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img40.png" />

   * **Delete Contact** - User intent to delete a contact.

   * **ContactId** - Entity node for the contact ID.

   * **deleteContactService** - Bot action script to delete a contact:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/ewPaQ3tSY_EES0i2/ai-for-service/integrations/actions/images/hubspot-tem-img41.png?fit=max&auto=format&n=ewPaQ3tSY_EES0i2&q=85&s=9cf11679a0ed71be16fc239cf4720d60" alt="deleteContactService" width="1905" height="818" data-path="ai-for-service/integrations/actions/images/hubspot-tem-img41.png" />

   * **getAccountService** - Bot action service to get account details.

   * **deleteContactMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test.

<Note>If you enter an incorrect ID, a **404 - No Record Found** error is displayed.</Note>
