> For the complete documentation index, see [llms.txt](https://help.botpenguin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.botpenguin.com/ai-agents/prompts-and-tools/hubspot-tool.md).

# HubSpot Tool

The HubSpot tool lets your AI agent create, find and update records in HubSpot with BotPenguin.

The HubSpot tool lets your AI agent create, find and update records in HubSpot. You add it on the Prompt & Tools page, choose which actions the agent may use, and tell the agent when to use it.

### Prerequisites

* An AI agent. See Create your first AI Agent.
* A HubSpot account.
* Edit access to AI Agents.

### Key definitions

| Term               | Meaning                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| Tool               | Something your agent can use to take an action.                                      |
| Action             | One thing a tool can do. You turn each action on or off with Allowed.                |
| Usage instructions | Your words that tell the agent when to use the tool and what to do.                  |
| Connected account  | The account of the other service. You connect it once and reuse it for other agents. |

### What the HubSpot tool can do

| Action            | What it does                       |
| ----------------- | ---------------------------------- |
| Create ticket     | Creates a ticket.                  |
| Create contact    | Creates a contact.                 |
| Create company    | Creates a company.                 |
| Create lead       | Creates a lead.                    |
| Create deal       | Creates a deal.                    |
| Associate contact | Links a contact to another record. |
| Get ticket        | Looks up a ticket.                 |
| Get lead          | Looks up a lead.                   |
| Get deal          | Looks up a deal.                   |
| Update contact    | Changes a contact.                 |
| Update ticket     | Changes a ticket.                  |
| Update lead       | Changes a lead.                    |
| Update deal       | Changes a deal.                    |
| Book appointment  | Books an appointment.              |

You fill in these fields when you set up the tool:

* Connection (your HubSpot account)
* For Create ticket: Pipeline, Ticket stage, Priority, Source, and a contact to link (optional)
* For Create company, Create lead and Create deal: a contact to link (optional)
* For Associate contact: Associate with, Target record ID, Contact ID (optional), Email (optional)
* For Get and Update actions: an ID or email to find the record (optional)
* For Book appointment: Name and Email

### Steps

1. Open **Prompt & Tools** under Setup in the AI Agent sidebar. Click **Add tool**. In the Add tools window, find **HubSpot**. You can search for it, or look under External tools. Click it.

![Find HubSpot in the Add tools window](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/K9mUTkpOvpw7tEs8BGux/images/hubspot-step-1.png)

2. On the Connect step, choose the account you want. If you have none, click **Connect another account** and sign in without leaving the page. Click **Continue**.

![Choose the account for HubSpot](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/0E4b6Mvc8NJtV1jFihQa/images/hubspot-step-2.png)

3. Turn on the actions you want the agent to use.

<figure><img src="https://1745791824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAPDb8cKQtGlIAfgHjcsQ%2Fuploads%2F6GkM9Ihfs8Q2A8HSDPNe%2Fimage.png?alt=media&amp;token=99ab0abc-7ce0-41b3-afa0-f3c0aff2214a" alt=""><figcaption></figcaption></figure>

4. Fill in the fields for each action:
   1. **Create ticket:** Pipeline, Ticket stage, Priority, Source. Contact to link is optional.
   2. **Create company, Create lead, Create deal:** Contact to link is optional.
   3. **Associate contact:** Associate with, Target record ID. Contact ID and Email are optional.
   4. **Get and Update actions:** ID or email to find the record is optional.
   5. **Book appointment:** Name and Email.
5. Under “How should the agent use HubSpot?”, write when the agent should use the tool and what it should do. This is required.
6. Click **Add tool**. The button stays grey until the required fields are filled. The tool now shows under Connected tools with an Active label. Click **Done**, then click **Update** to save the page.

***

### Example usage instructions

> Use HubSpot to save customer details and manage records.
>
> CONTACTS Create contact: When the customer shares their name and email, create a contact. Ask for any missing detail first. Update contact: When the customer wants to change their details, confirm which contact it is first. Change only what they asked. Associate contact: When a contact needs to be linked to a company, deal or ticket, link it to the record the customer names.
>
> COMPANIES, LEADS AND DEALS Create company: When the customer gives their company name, create a company and link it to the contact. Create lead: When the customer shows interest in buying, create a lead and link it to the contact. Create deal: Only when the customer is ready to buy. Link the deal to the contact. Get lead / Get deal: When asked about an existing lead or deal, look it up by ID or email and share the status. Update lead / Update deal: Confirm the record with the customer first. Change only what they asked.
>
> TICKETS Create ticket: When the customer has a problem you cannot solve, ask for a short description and create a ticket. Get ticket: When asked about a ticket, look it up and share the status. Update ticket: Confirm the ticket with the customer first. Change only what they asked.
>
> NOTES AND APPOINTMENTS Add note: When the customer gives new information about a contact or deal, add it as a note. Book appointment: When the customer wants to book, ask for their name and email. Book only when you have both.
>
> RULES
>
> * Never share details of other customers' records.
> * Check if the contact already exists before creating a new one.
> * If the tool gives an error, say "I could not update HubSpot right now" and offer to connect them with the team.
> * Never say a record was created or changed until the tool confirms it.

Write your own in the same way: say when to use the tool, then what to do.

***

### Change or remove the tool

Under Connected tools, click the gear icon to open the tool's settings again. Click the delete icon to remove it. You are asked to confirm. Deleting removes the tool and its usage instructions from the agent. The connected account stays, so other agents can still use it.

***

### Common errors

<details>

<summary>The agent does not use the tool</summary>

Check that the tool shows Active under Connected tools. Check that the action you need is allowed. Make your usage instructions clearer about when to use the tool.

</details>

<details>

<summary>I cannot save the tool</summary>

The usage instructions are required. Fill them in. Also fill in the other required fields.

</details>

<details>

<summary>I do not see HubSpot in the Add tools window</summary>

Your partner may not have turned this integration on. Ask your partner or account owner.

</details>

<details>

<summary>The Continue button is grey</summary>

Choose an account first. If you have none, click Connect another account.

</details>

<details>

<summary>Can I use the same account for more than one agent?</summary>

Yes. Connected accounts belong to your account, so other agents can use them.

</details>

<details>

<summary>What happens if I delete the tool?</summary>

The agent can no longer use it, and its usage instructions are removed. Text about the tool in your prompt stays, so remove it too.

</details>

***

### Support

Still not working? Write to us at <support@botpenguin.com>. We will reach out to you within 24 hours.
