ChatWootApi 0.9.7
dotnet add package ChatWootApi --version 0.9.7
NuGet\Install-Package ChatWootApi -Version 0.9.7
<PackageReference Include="ChatWootApi" Version="0.9.7" />
<PackageVersion Include="ChatWootApi" Version="0.9.7" />
<PackageReference Include="ChatWootApi" />
paket add ChatWootApi --version 0.9.7
#r "nuget: ChatWootApi, 0.9.7"
#:package ChatWootApi@0.9.7
#addin nuget:?package=ChatWootApi&version=0.9.7
#tool nuget:?package=ChatWootApi&version=0.9.7
ChatWootApi
English | 简体中文
Strongly typed .NET interfaces and models for the Chatwoot REST APIs, built on Refit. The package covers Application, Client, and Platform API surfaces.
Installation
Install the API interfaces and models:
dotnet add package ChatWootApi
Most applications should also install the dependency-injection extensions:
dotnet add package ChatWootApi.Extensions
Dependency injection
ChatWootApi.Extensions configures Refit, HttpClient, JSON serialization, and the api_access_token request header.
Configure the Chatwoot base URL and tokens in appsettings.json:
{
"ChatWootApi": {
"BaseAddress": "https://app.chatwoot.com/",
"AccountAccessToken": "your-account-access-token",
"PlatformAccessToken": "your-platform-access-token"
}
}
Register the API groups you need:
using ChatWootApi.Extensions;
builder.Services.AddChatWootApplicationApi(builder.Configuration);
builder.Services.AddChatWootClientApi(builder.Configuration);
builder.Services.AddChatWootPlatformApi(builder.Configuration);
Inject a specific API interface and call it directly:
using ChatWootApi.Application;
public sealed class ContactService(IApplicationContactsApi contactsApi)
{
public Task<ContactsListResponse> GetContactsAsync(
long accountId,
CancellationToken cancellationToken = default)
{
return contactsApi.ContactListAsync(accountId, cancellationToken);
}
}
Application API also provides the aggregate IChatWootApplicationApi interface for accessing all implemented Application API methods through one service.
Handling Chatwoot webhooks
Webhook payload handling, signature verification notes, event field mapping, and ASP.NET Core examples now live in WEBHOOKS.md.
Temporarily switching Application API access tokens
Application API api_access_token values are user-level tokens and often need to switch per request. With ChatWootApi.Extensions, inject the default AccessTokenProvider and scope the Application access token to the current async flow with using:
using ChatWootApi.Application;
using ChatWootApi.Extensions;
app.MapGet("/contacts", async (
long accountId,
string userAccessToken,
AccessTokenProvider accessTokenProvider,
IApplicationContactsApi contactsApi,
CancellationToken cancellationToken) =>
{
using var applicationAccessToken = accessTokenProvider.UseApplicationAccessToken(userAccessToken);
return await contactsApi.ContactListAsync(accountId, cancellationToken);
});
The scope uses AsyncLocal: an inner scope temporarily overrides the outer token and restores it when disposed. Platform API calls continue to use the configured PlatformAccessToken. If no scope exists and no AccountAccessToken is configured, Application API calls throw the same missing-configuration exception.
You can also replace the token source entirely by registering your own IAccessTokenProvider before calling the Chatwoot registration extensions. The extensions use TryAddSingleton, so they do not override an existing implementation:
builder.Services.AddSingleton<IAccessTokenProvider, TenantAccessTokenProvider>();
builder.Services.AddChatWootApplicationApi(builder.Configuration);
builder.Services.AddChatWootPlatformApi(builder.Configuration);
Client API uses public inbox identifiers and does not require Account or Platform access tokens.
Implemented APIs
The following list is grouped by Chatwoot API tag.
<details> <summary><strong>Application API</strong></summary>
IChatWootApplicationApi: aggregate interface for all Application APIsIApplicationAccountApi: AccountIApplicationAccountAgentBotsApi: Account Agent BotsIApplicationAgentsApi: AgentsIApplicationAuditLogsApi: Audit LogsIApplicationAutomationRuleApi: Automation RulesIApplicationCannedResponsesApi: Canned ResponsesIApplicationContactLabelsApi: Contact LabelsIApplicationContactsApi: ContactsIApplicationConversationAssignmentsApi: Conversation AssignmentsIApplicationConversationsApi: ConversationsIApplicationCustomAttributesApi: Custom AttributesIApplicationCustomFiltersApi: Custom FiltersIApplicationHelpCenterApi: Help CenterIApplicationInboxesApi: InboxesIApplicationIntegrationsApi: IntegrationsIApplicationLabelsApi: LabelsIApplicationMessagesApi: MessagesIApplicationProfileApi: ProfileIApplicationReportsApi: ReportsIApplicationTeamsApi: TeamsIApplicationWebhooksApi: Webhooks
</details>
<details> <summary><strong>Client API</strong></summary>
IClientInboxApi: InboxIClientContactApi: ContactsIClientConversationApi: ConversationsIClientMessageApi: Messages
</details>
<details> <summary><strong>Platform API</strong></summary>
IPlatformAccountApi: AccountsIPlatformAccountUserApi: Account UsersIPlatformAgentBotApi: Agent BotsIPlatformUserApi: Users and user login links
</details>
| Product | Versions 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. |
-
net10.0
- Refit (>= 13.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ChatWootApi:
| Package | Downloads |
|---|---|
|
ChatWootApi.Extensions
A typed .NET client for the Chatwoot API |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.9.7 | 122 | 7/23/2026 |
| 0.9.6 | 105 | 7/23/2026 |
| 0.9.5 | 107 | 7/23/2026 |
| 0.9.4 | 115 | 7/13/2026 |
| 0.9.3 | 117 | 7/13/2026 |
| 0.9.2 | 103 | 7/13/2026 |
| 0.9.1 | 117 | 7/13/2026 |
| 0.9.0 | 115 | 7/13/2026 |
| 0.8.0 | 120 | 7/10/2026 |
| 0.7.1 | 121 | 7/10/2026 |
| 0.7.0 | 120 | 7/10/2026 |
| 0.6.0 | 118 | 7/9/2026 |
| 0.4.0 | 120 | 7/7/2026 |
| 0.3.0 | 115 | 7/6/2026 |
| 0.2.0 | 121 | 7/6/2026 |
| 0.1.0 | 126 | 7/2/2026 |
**Full Changelog**: https://github.com/LGinC/chatwootApi/compare/v0.9.6...v0.9.7