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

# HubSpot Integration

> Automatically call new contacts from your HubSpot CRM

## Overview

Connect your HubSpot CRM to automatically trigger AI calls when new contacts are created. HubSpot integration requires a developer account and private app setup.

**How It Works:**

1. Convert to HubSpot developer account
2. Create private app with required scopes
3. Configure webhook for contact creation
4. Copy access token to CallKaro
5. Map contact fields to agent variables

## Requirements

* HubSpot account (can be converted to developer account)
* Access to HubSpot app settings
* CallKaro API key

## Step 1: Convert to Developer Account

You can convert your current HubSpot account to a developer account to access app creation features.

<Note>
  Converting to a developer account is free and enables private app creation.
</Note>

## Step 2: Navigate to Legacy Apps

1. Log in to your HubSpot account
2. Go to **Developer → Legacy Apps**
3. Click **Create App**

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step1-navigate-apps.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=2db059fc83d141e857291ee9d0e7e83a" alt="Navigate to Legacy Apps" width="2880" height="1612" data-path="images/integrations/hubspot/step1-navigate-apps.png" />

## Step 3: Create Private App

1. Click **Create App**
2. Choose **Private** app type

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step2-create-private.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=4e9739ec9268b91225478bd7074c5e8e" alt="Create Private App" width="2880" height="1620" data-path="images/integrations/hubspot/step2-create-private.png" />

## Step 4: Enter Basic Information

Fill in your app details:

* **App Name** - Name for your integration (e.g., "CallKaro AI Integration")
* **Logo** - Optional app logo

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step3-basic-info.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=2e7505e044f813250f03671bfd6c63a8" alt="Basic Info" width="2880" height="1620" data-path="images/integrations/hubspot/step3-basic-info.png" />

## Step 5: Add Required Scopes

1. Navigate to **Scopes** tab
2. Click **+ Add New Scope**

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step4-add-scope.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=bbfd966ce9252bd45e4d4893e4cb3cc7" alt="Add Scopes" width="2880" height="1622" data-path="images/integrations/hubspot/step4-add-scope.png" />

## Step 6: Select Contact Scopes

Search for "contact" and add these scopes:

* `crm.objects.contacts.read`
* `crm.objects.contacts.write`
* `crm.schemas.contacts.read`
* `crm.schemas.contacts.write`

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step5-contact-scopes.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=21efe50402be7a6b2cb164e3b6c9d2e2" alt="Select Contact Scopes" width="2880" height="1622" data-path="images/integrations/hubspot/step5-contact-scopes.png" />

<Note>
  These scopes allow CallKaro to read contact data when new contacts are created.
</Note>

## Step 7: Configure Webhook URL

1. Navigate to **Webhooks** tab
2. Enter your CallKaro webhook URL:

```
https://api.callkaro.ai/call/crm-webhook?agent_id=YOUR_AGENT_ID&type=hubspot&x_api_key=YOUR_API_KEY
```

**Replace:**

* `YOUR_AGENT_ID` - Your CallKaro agent ID
* `YOUR_API_KEY` - Your CallKaro API key (found in Dashboard → API Keys)

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step6-webhook-url.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=2a5ea067f1114d5b97652e51f158aba3" alt="Configure Webhook" width="2880" height="1618" data-path="images/integrations/hubspot/step6-webhook-url.png" />

<Tip>
  Get your agent ID from the agent configuration page URL.
</Tip>

## Step 8: Create Webhook Subscription

1. Click **Create Subscription**
2. Choose trigger event: **eg. Contact Created**
3. This determines when the webhook fires

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step7-subscription.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=3f6862706f3aa7ded90d52adbaf25bd6" alt="Create Subscription" width="2880" height="1622" data-path="images/integrations/hubspot/step7-subscription.png" />

## Step 9: Finalize App Creation

1. Click **Create App**
2. Review settings and click **Continue Creating**

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step8-create-app.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=ba70fe45396f7f605278ff82bd3eca2a" alt="Create App" width="2880" height="1618" data-path="images/integrations/hubspot/step8-create-app.png" />

## Step 10: Copy Access Token

1. Navigate to **Auth** section in your new app
2. Copy the **Access Token**
3. Save it securely - you'll need it for CallKaro

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step9-access-token.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=d1b0b536dbcfb6ae40042c26f70eba41" alt="Copy Access Token" width="2880" height="1622" data-path="images/integrations/hubspot/step9-access-token.png" />

## Step 11: Connect in CallKaro Dashboard

1. Go to **CallKaro Dashboard → Integrations**
2. Find **HubSpot** integration
3. Click **Connect**
4. Paste your Access Token
5. Click **Save**

<img src="https://mintcdn.com/callkaroai/_yHIwUXcSxcKfjME/images/integrations/hubspot/step10-callkaro-connect.png?fit=max&auto=format&n=_yHIwUXcSxcKfjME&q=85&s=66f3de8fbc2193f664cc00275adf26f5" alt="Connect in CallKaro" width="2878" height="1622" data-path="images/integrations/hubspot/step10-callkaro-connect.png" />

## Step 12: Configure Variable Mapping

Map HubSpot contact fields to your agent's call metadata variables.

1. Go to your agent configuration
2. Navigate to **Variable Source** tab
3. Add variable mappings:
   * Variable Name: `firstname`
   * Source: `hubspot`
   * HubSpot Field: `firstname`

<Card title="Variable Source Configuration" icon="code" href="/agents/agent-variables">
  Learn how to map CRM fields to agent variables
</Card>

### Common Field Mappings

| Agent Variable | HubSpot Field |
| -------------- | ------------- |
| `firstname`    | `firstname`   |
| `lastname`     | `lastname`    |
| `email`        | `email`       |
| `phone`        | `phone`       |
| `company`      | `company`     |
| `city`         | `city`        |

## Advanced Parameters

Add optional parameters to control call behavior (same as webhook URL):

| Parameter             | Description                     | Example |
| --------------------- | ------------------------------- | ------- |
| `min_trigger_time`    | Earliest call time (HH:MM)      | `09:00` |
| `max_trigger_time`    | Latest call time (HH:MM)        | `18:00` |
| `carry_over`          | Carry over calls outside window | `true`  |
| `num_of_retries`      | Number of retry attempts        | `3`     |
| `gap_between_retries` | Hours between retries           | `2,4,6` |

**Example with parameters:**

```
https://api.callkaro.ai/call/crm-webhook?agent_id=YOUR_AGENT_ID&type=hubspot&x_api_key=YOUR_API_KEY&min_trigger_time=09:00&max_trigger_time=18:00&num_of_retries=3&gap_between_retries=2,4,6
```

## Testing

1. Create a test contact in HubSpot
2. Check CallKaro Dashboard → Call History
3. Verify call was triggered with correct data
4. Review call details to confirm field mapping

## Troubleshooting

<AccordionGroup>
  <Accordion title="Webhook not triggering" icon="circle-exclamation">
    **Solutions:**

    * Verify webhook URL is correct
    * Check agent ID and API key
    * Ensure app has required scopes
    * Confirm webhook subscription is active
  </Accordion>

  <Accordion title="Access token invalid" icon="key">
    **Solutions:**

    * Regenerate access token in HubSpot app
    * Update token in CallKaro integrations
    * Verify app is not deleted or disabled
  </Accordion>

  <Accordion title="Fields not mapping" icon="map">
    **Solutions:**

    * Check variable source is set to `hubspot`
    * Verify HubSpot field names are correct
    * Ensure contact has values for mapped fields
    * Test with contacts that have all required data
  </Accordion>
</AccordionGroup>

<Tip>
  Use HubSpot's workflow logs to debug webhook delivery issues.
</Tip>
