Skip to main content
The HubSpotResourceClient is a specialized client for interacting with the HubSpot API, providing a convenient way to access CRM objects and other HubSpot features.

Usage

import { myHubSpotClient } from "./clients";

const result = await myHubSpotClient.invoke(
  "GET",
  "/crm/v3/objects/contacts",
  "list-contacts",
  {
    query: { limit: "10" },
  }
);

if (result.ok && result.result.body.kind === "json") {
  console.log("Contacts:", result.result.body.value);
}

Inputs

The invoke method accepts the following arguments:
method
string
required
The HTTP method to use: "GET", "POST", "PUT", "PATCH", or "DELETE".
path
string
required
The HubSpot API path (e.g., /crm/v3/objects/contacts).
invocationKey
string
required
A unique identifier for this operation.
options
object
Optional configuration object.

Outputs

The output format is the same as the Custom API client.
kind
"api"
Discriminator for the response type.
status
number
The HTTP status code.
body
ResponseBody
The response body (typically JSON).