# HubSpot

> Push leads to HubSpot: create a contact, a company, a deal or a lead in HubSpot, assigned to an owner you pick.

Every section below does the same job: in the dashboard (Guide), from your code (API) or through an AI assistant (MCP).

## Guide — In the dashboard

Source: /docs/automations/crm/hubspot

Create a contact, a company, a deal or a lead in HubSpot, assigned to an owner you pick. Fields are filled from your [field mapping](/docs/automations/crm/overview); an automation decides which leads go.

1. **Integrations → CRMs → HubSpot → Connect** and sign in to HubSpot.
2. **Map the fields** you want filled.
3. **Automations → New automation**, then **Send to HubSpot**, pick the owner, **Save**.


---

## API — From your code

Source: /docs/automations/crm/hubspot/api

Authenticated with `?privateKey=YOUR_KEY` (see [Authentication](/docs/authentication)).

<Endpoints ops={["POST /admin/automations", "GET /admin/automations", "PATCH /admin/automations/{id}", "GET /v3/crm/owners", "POST /v3/crm/push", "GET /v3/crm/{crm}/mappings", "PUT /v3/crm/{crm}/mappings"]} />

<ApiPlayground
  method="post"
  path="/admin/automations"
  tool="create_automation"
  args={`{
  "name": "Docs example: send-to-hubspot",
  "isActive": true,
  "website": "64b7f0a1c2d3e4f5a6b7c8d9",
  "when": "new-lead-is-identified",
  "then": "send-to-hubspot",
  "interval": "immediately",
  "actions": {
    "sentToHubspot": {
      "action": "create-a-contact",
      "assignContactsTo": "OWNER_ID"
    }
  }
}`}
/>

### Use case: Pick the owner [#use-case-pick-the-owner]

`GET /v3/crm/owners?crm=hubspot` lists the users of your HubSpot; use one's id as `assignContactsTo`.

### Use case: Push one lead now [#use-case-push-one-lead-now]

`POST /v3/crm/push` with `crm: "hubspot"` and a `leadId` sends that lead right away, without an automation.


---

## MCP — AI agents

Source: /docs/automations/crm/hubspot/mcp

Connect the [MCP server](/docs/mcp#quickstart), then just ask.

<Tools names={["create_automation", "push_lead_to_crm", "list_crm_owners", "get_crm_mappings", "set_crm_mappings"]} />

### Use case [#use-case]

> Push every new lead to HubSpot, owned by Sarah.

<McpToolCall name="create_automation">

```json
{
  "websiteId": "64b7f0a1c2d3e4f5a6b7c8d9",
  "name": "New leads to HubSpot",
  "trigger": {
    "then": "send-to-hubspot",
    "actions": {
      "sentToHubspot": {
        "action": "create-a-contact",
        "assignContactsTo": "OWNER_ID"
      }
    }
  },
  "actions": []
}
```

</McpToolCall>

### Use case [#use-case-1]

> Send this lead to HubSpot now.

<McpToolCall name="push_lead_to_crm">

```json
{
  "websiteId": "64b7f0a1c2d3e4f5a6b7c8d9",
  "crm": "hubspot",
  "leadId": "6a3f00000000000000000003"
}
```

</McpToolCall>

