DamianH.HubSpot.KiotaClient 0.3.0

dotnet add package DamianH.HubSpot.KiotaClient --version 0.3.0
                    
NuGet\Install-Package DamianH.HubSpot.KiotaClient -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DamianH.HubSpot.KiotaClient" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DamianH.HubSpot.KiotaClient" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="DamianH.HubSpot.KiotaClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DamianH.HubSpot.KiotaClient --version 0.3.0
                    
#r "nuget: DamianH.HubSpot.KiotaClient, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DamianH.HubSpot.KiotaClient@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DamianH.HubSpot.KiotaClient&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=DamianH.HubSpot.KiotaClient&version=0.3.0
                    
Install as a Cake Tool

DamianH.HubSpot.KiotaClient

Auto-generated .NET HubSpot API client built with Microsoft Kiota.

What is this?

This package provides strongly-typed .NET clients for the HubSpot REST API, generated directly from HubSpot's official OpenAPI definitions. Each HubSpot API area is exposed as a separate client class so you only take the dependencies you need.

Quick Install

dotnet add package DamianH.HubSpot.KiotaClient

Requirements

  • .NET 10.0 or later
  • Microsoft.Kiota.Http.HttpClientLibrary (peer dependency)

Minimal Usage Example

using DamianH.HubSpot.KiotaClient.CRM.Companies.V3;
using Microsoft.Kiota.Abstractions.Authentication;
using Microsoft.Kiota.Http.HttpClientLibrary;

// Implement IAccessTokenProvider to supply your HubSpot access token
sealed class HubSpotTokenProvider : IAccessTokenProvider
{
    public AllowedHostsValidator AllowedHostsValidator { get; } = new();
    public Task<string> GetAuthorizationTokenAsync(
        Uri uri,
        Dictionary<string, object>? additionalAuthenticationContext = null,
        CancellationToken cancellationToken = default)
        => Task.FromResult("your-hubspot-access-token");
}

// Create an adapter with your token provider
var authProvider = new BaseBearerTokenAuthenticationProvider(new HubSpotTokenProvider());
var adapter = new HttpClientRequestAdapter(authProvider)
{
    BaseUrl = "https://api.hubapi.com"
};

// Instantiate the client for the API area you need
var client = new HubSpotCRMCompaniesV3Client(adapter);

// Create a company
var company = await client.Crm.V3.Objects.Companies.PostAsync(new()
{
    Properties = new() { AdditionalData = new() { ["name"] = "Acme Corp" } }
});

Console.WriteLine($"Created company: {company!.Entity!.Id}");

Testing with the Mock Server

Pair this package with DamianH.HubSpot.MockServer to run tests without hitting the real HubSpot API:

await using var server = await HubSpotMockServer.StartNew();

var adapter = new HttpClientRequestAdapter(new AnonymousAuthenticationProvider())
{
    BaseUrl = server.Uri.ToString()
};

var client = new HubSpotCRMCompaniesV3Client(adapter);
// Use client in tests — no real API calls made

Supported API Categories

Clients are generated per HubSpot API area:

  • CRM — Companies, Contacts, Deals, Line Items, Products, Tickets, Quotes, Goals, Calls, Emails, Meetings, Notes, Tasks, Postal Mail, Communications
  • CRM Associations — V3 & V4 association APIs
  • CRM Properties — Property definitions and groups
  • CRM Pipelines — Deals and tickets pipelines
  • CRM Owners — Owner listing
  • CRM Schemas — Custom object schema management
  • Marketing — Transactional email, marketing events, marketing emails, forms, campaigns
  • CMS — Blog posts, authors, pages, HubDB, domains, URL redirects, source code, tags
  • Conversations — Visitor identification, custom channels
  • Automation — Workflows
  • Files — File upload and management
  • Webhooks — Subscriptions and settings
  • Events — Custom analytics events
  • Business Units, User Provisioning, Account Info, Multicurrency, Tax Rates
  • Extensions — Calling, CRM Cards, Video Conferencing, Transcription

Regenerating Clients

The clients in this package are generated from HubSpot's OpenAPI catalog. To regenerate:

./generate.ps1

See the repository for full details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DamianH.HubSpot.KiotaClient:

Package Downloads
DamianH.HubSpot.MockServer

In-memory mock HubSpot server for testing without external dependencies

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 481 5/7/2026
0.2.0 104 4/30/2026
0.1.0 599 3/2/2026