# HubSpot
URL: /reference/blocks/hubspot
Type: reference
Description: Work with HubSpot contacts, companies, deals, tickets, and users
Keywords: hubspot, integrations, block, workflow builder
`hubspot` — Work with HubSpot contacts, companies, deals, tickets, and users.

Where it appears [#where-it-appears]

The **HubSpot** block lives in the **Integrations** group of the Workflow Builder. Connect the Hubspot integration before adding it.

Fields [#fields]

| Field               | Type                       | Required | Default   | Description                                                                                                                                                                                                                                           |
| ------------------- | -------------------------- | -------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `resource`          | select                     | Yes      | `contact` | Which HubSpot resource to work with. Options: `contact`, `company`, `deal`, `ticket`, `user`.                                                                                                                                                         |
| `operation`         | select                     | Yes      | —         | Which action to perform on the selected resource.                                                                                                                                                                                                     |
| `contactIdOrEmail`  | text (supports references) | No       | —         | Optional HubSpot contact ID or email address to fetch a single contact. Leave empty to list contacts. Accepts literal text or \<StepName.field>.                                                                                                      |
| `limit`             | number                     | No       | `100`     | Maximum number of records to return when listing. Defaults to 100.                                                                                                                                                                                    |
| `propertiesJson`    | code                       | Yes      | —         | JSON object of HubSpot contact properties to set on the new contact (e.g. `email`, `firstname`). Property keys must match your HubSpot schema.                                                                                                        |
| `contactId`         | text (supports references) | Yes      | —         | HubSpot contact ID to update. Use a literal ID or \<StepName.field> to reference an ID from a previous step.                                                                                                                                          |
| `searchJson`        | code                       | Yes      | —         | HubSpot CRM Search API request body as JSON, using `filterGroups` with `propertyName`, `operator`, and `value` to filter contacts.                                                                                                                    |
| `companyIdOrDomain` | text (supports references) | No       | —         | Optional HubSpot company ID or domain to fetch a single company. Leave empty to list companies. Accepts literal text or \<StepName.field>.                                                                                                            |
| `companyId`         | text (supports references) | Yes      | —         | HubSpot company ID to update. Use a literal ID or \<StepName.field> to reference an ID from a previous step.                                                                                                                                          |
| `ticketId`          | text (supports references) | Yes      | —         | HubSpot ticket ID to fetch. Use a literal ID or \<StepName.field> to reference an ID from a previous step.                                                                                                                                            |
| `ownerId`           | text (supports references) | Yes      | —         | HubSpot owner ID to look up — typically a record's `hubspot_owner_id` property, referenced with \<StepName.field>. Returns the owner's name and email; archived owners are included. If the ID is empty (unowned record) or unknown, `owner` is null. |

Inputs and outputs [#inputs-and-outputs]

Inputs are the configurable fields above. The block produces these outputs:

**Outputs**

Reference an output downstream with `<HubSpot.field>`.

| Name      | Type    | Description                                                                   |
| --------- | ------- | ----------------------------------------------------------------------------- |
| `success` | boolean | Operation succeeded                                                           |
| `result`  | json    | Contacts data                                                                 |
| `error`   | string  | Error message if failed                                                       |
| `contact` | json    | Created contact                                                               |
| `results` | json    | Search results                                                                |
| `company` | json    | Created company                                                               |
| `ticket`  | json    | Created ticket                                                                |
| `owners`  | json    | List of HubSpot owners                                                        |
| `owner`   | json    | The owner (`id`, `firstName`, `lastName`, `email`, ...), or null if not found |

Example [#example]

A minimal configuration for this block:

```json
{
  "type": "hubspot",
  "config": {
    "resource": "contact",
    "operation": "...",
    "limit": 100,
    "propertiesJson": "...",
    "contactId": "<PreviousStep.field>",
    "searchJson": "...",
    "companyId": "<PreviousStep.field>",
    "ticketId": "<PreviousStep.field>",
    "ownerId": "<PreviousStep.field>"
  }
}
```

Limits and failure modes [#limits-and-failure-modes]

* Requires a connected Hubspot integration. Calls fail if that integration is disconnected or its authorization has expired.
* Required fields (`resource`, `operation`, `propertiesJson`, `contactId`, `searchJson`, `companyId`, `ticketId`, `ownerId`) must be set, or the block fails validation before it runs.
* On failure the `error` output is populated; downstream blocks that reference other outputs may not receive values.

Related [#related]

* [All workflow blocks](/reference/blocks)
* [Workflow Builder overview](/workflow-builder-overview)
* [Integrations](/integrations)