Waha 1.1.0

dotnet add package Waha --version 1.1.0
                    
NuGet\Install-Package Waha -Version 1.1.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="Waha" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Waha" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Waha" />
                    
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 Waha --version 1.1.0
                    
#r "nuget: Waha, 1.1.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 Waha@1.1.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=Waha&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Waha&version=1.1.0
                    
Install as a Cake Tool

Language .NET OS License Release

BuildStatus

⭐ Star us on GitHub — it motivates us a lot! License

Waha Net

Waha Net is a .NET C# client library for interacting with WAHA (WhatsApp HTTP API). It simplifies the integration of WAHA services into your .NET applications.

Installation

To install the Waha library, run the following command in your .NET project:

dotnet add package Waha

Or, use the NuGet Package Manager in Visual Studio.

Usage

This section demonstrates how to integrate Waha Net into your .NET projects to retrieve WhatsApp chats. This assumes that a WAHA session has been started and the QR code has been scanned and validated.

Setting up WAHA Docker Container

First, ensure you have WAHA (WhatsApp HTTP API) running. Follow these steps to set it up as a Docker container:

Prerequisite: Ensure Docker is installed on your system.

docker pull devlikeapro/waha

Run the container:

docker run -it --rm -p 3000:3000/tcp --name waha devlikeapro/waha

# It prints logs and the last line must be
# WhatsApp HTTP API is running on: http://[::1]:3000

Open the link in your browser http://localhost:3000/ and you'll see API documentation (Swagger).

ASP .NET

Here's a sample code snippet for an ASP.NET Core application that lists WhatsApp chats from the logged-in user:

using Waha;

var builder = WebApplication.CreateBuilder(args);

//This method will look for "Waha" settings configuration section or connectionstring in your appsettings.json
//It also will use Waha default endpoint value ("localhost:3000") if can´t find a valid configuration
builder.AddWahaApiClient("Waha");

var app = builder.Build();
app.MapDefaultEndpoints();

app.MapGet("/chats", async (
  IWahaApiClient wahaApiClient, CancellationToken cancellationToken,
  [FromHeader] int limit = 5, [FromHeader] int offset = 0, [FromHeader] string sortBy = "", [FromHeader] string sortOrder = "")
{
  var sessions = await wahaApiClient.GetSessionsAsync(true, cancellationToken);
  var session = sessions.FirstOrDefault();
  if (session == null)
  {
      return Results.Json(new { Message = "No active session found." }, statusCode: StatusCodes.Status412PreconditionFailed);
  }
  var chats = await wahaApiClient.GetChatsAsync(session.Name, limit, offset, sortBy, sortOrder, cancellationToken);
  return Results.Ok(chats);
}).WithName("GetChats");
OTHERS APPS
using Waha;

var wahaApiClient = new WahaApiClient(new HttpClient() { BaseAddress = WahaSettings.Default.Endpoint });
var sessions = await wahaApiClient.GetSessionsAsync(true, cancellationToken);
var session = sessions.FirstOrDefault();
if (session != null)
{
    var chats = await wahaApiClient.GetChatsAsync(session.Name, 10, 0, "", "", null);
    // Process the chats as needed...
}

Contributing

We welcome and appreciate contributions from the community. You can open a pull request or report issues through our GitHub Issues. Please review our contribution guidelines for details on coding standards and development practices.

Feedback & Support

For any questions, issues, or ideas, feel free to reach out via:

Your feedback helps us make Waha library even better!

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 155 5/26/2025
1.0.1 486 2/25/2025
1.0.0 107 2/24/2025