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

# HubSpot CRM source

> Observe a reviewed standard or custom HubSpot CRM object.

Configure [schema discovery](https://docs.bijection.com/integrations/native-rest.md#discover-and-approve-a-provider-schema)
with a protected label and scoped OAuth2 or private app bearer
credentials for the selected object and its metadata. Bind one CRM v3 object
type per mount.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
const selection = {
  provider: "hubspot",
  resource: "contacts",
  origin: "https://api.hubapi.com",
  path: "/crm/v3/objects/contacts",
};
```

Standard objects include contacts, companies, leads, deals, tickets,
products, line items, quotes, calls, emails, meetings, notes, tasks,
communications and users.
For a custom object, use its `2-…` object type ID in both `resource` and the
last path segment. Standard objects use the Properties API. Custom objects
use the corresponding custom object schema. Select up to 32 supported
properties from the review proposal. The feed publishes by object ID,
continues with HubSpot's opaque `after` token and starts a new sweep after
the terminal page. Archived and missing records remain published. The
36 KiB bound applies to data pages. Complete metadata responses are
staged in sealed parts up to 2 MiB.
[HubSpot Properties API](https://developers.hubspot.com/docs/api-reference/legacy/crm/properties/get-properties) · [HubSpot Custom Object Schemas](https://developers.hubspot.com/docs/api-reference/legacy/crm/objects/schemas/get-schema)

## Owners, pipeline stages, associations and history

Bind these `receivers.resource` selections on separate protected mounts.
Use `https://api.hubapi.com` for each origin. Initialize with
`mode: "declared"`, the matching key and the desired projection.

| Provider selection | Resource | Fixed path | Key |
| - | - | - | - |
| `hubspot-catalog` | `owners` | `/crm/v3/owners` | `id` |
| `hubspot-catalog` | `pipelines/deals` | `/crm/v3/pipelines/deals` | `id` |
| `hubspot-catalog` | `stages/deals/PIPELINE_ID` | `/crm/v3/pipelines/deals/PIPELINE_ID/stages` | `id` |
| `hubspot-associations` | `contacts/123/companies` | `/crm/v4/objects/contacts/123/associations/companies` | `toObjectId` |
| `hubspot-history` | `deals` | `/crm/v3/objects/deals` | `id` |

Association pages retain the associated object ID and available HubSpot-defined
or custom labels under `associationTypes`. For history select a named
path such as `["propertiesWithHistory", "dealstage"]` as `json`.
The result retains the provider's batch of values per object ID and
property. These are sweeps over HubSpot's visible history. The connector
does not claim an ordered change feed. Owners, associations and history
follow the provider's `after` token. Pipeline and stage metadata must fit
in one response. Each response limits data to 100 rows within 36 KiB.
Omission leaves existing rows in place.
[HubSpot associations](https://developers.hubspot.com/docs/api-reference/legacy/crm/associations/associate-records/get-associations)

## Create and update records

Use `providerWriter("hubspot.crm.records.create-update", options, data)`
with origin `https://api.hubapi.com`, a sealed write-scoped bearer or OAuth2
credential and a scope such as `["deals"]`. Bind it as `receivers.writers[mode]` on
a protected `data` label. Select one writable standard type or custom
object type ID. Submit a JSON record such as
`{"properties":{"dealname":"Acme"}}`. HTTP 201 with an ID acknowledges a
create. HTTP 200 with the supplied ID acknowledges an update. Each command
uses an exact key and one send per task within 24 KiB.
[HubSpot CRM object creation](https://developers.hubspot.com/docs/api-reference/legacy/crm/objects/objects/create-object)

## Contact associations

Use the same contacts receiver with a protected `data` label and initialize
a separate mount with this profile.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{ profile: { mode: "hubspotAssociations", properties: ["firstname"], targets: ["companies", "deals"], limit: 10 } }
```

Select `companies`, `deals`, or `tickets` and authorize the credential to read
the selected objects. The contact page publishes both contacts and embedded
edges with its cursor. Read edges from `<mount>.relationships.list` or
`get`. Each key contains the contact ID, target type and ID, and HubSpot
association type. A page accepts up to 16 contacts and 16 edges per contact
within 36 KiB. The feed holds its position if an embedded list requires its
own page. Edges remain published when a later response omits them.
[CRM v3 contacts](https://developers.hubspot.com/docs/api-reference/legacy/crm/objects/contacts/get-contacts)

## Upsert records by unique property

Use the same `receivers.writers[mode]` for a bound type that supports batch upsert
and accepts a unique property. For one record use mode
`hubspot.crm.records.upsert` with `{ action: "upsert", field, externalId, payload }`.
For up to 25 records use `hubspot.crm.records.batch-upsert` with
`{ action: "batchUpsert", field, records: [{ externalId, payload }] }`.
Use the internal name of a unique property. Each payload is a JSON
object of text property values. HubSpot's contact email match does not allow partial
upserts. Each external ID appears once and takes up to 128 bytes.

Both modes use the CRM batch upsert endpoint and one send per task.
The whole request fits 24 KiB. The writer assigns one trace ID per row
and correlates successful IDs and structured errors in HTTP 200 or 207
responses. A success without a trace can be matched by the unique property.
A single-result HTTP 200 can also acknowledge the sole submitted contact. The labelled `outcomes` array follows input order and uses
the external IDs as keys. `partial` means every row is accounted for and
only some applied. Missing or conflicting evidence leaves the affected
rows unknown. One acknowledged record also returns its ID in `record`.
[HubSpot batch upsert API](https://developers.hubspot.com/docs/api-reference/legacy/crm/objects/objects/batch/upsert-objects)

## Webhook-assisted polling

HubSpot v3 signatures on a fixed HTTPS URL wake the contact or association feed.
Bind the REST mount to a protected `data` label and follow the
[verified wake route setup](https://docs.bijection.com/integrations/native-webhooks.md#wake-a-rest-source-from-a-provider-webhook)
to seal the signing secret and register the subscription for this source.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.