Waha-net/waha-net: .NET C# Client Library for WhatsApp HTTP API (WAHA)

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Waha-net/waha-net: .NET C# Client Library for WhatsApp HTTP API (WAHA)

Summary

Waha-net/waha-net is a .NET C# client library designed to simplify interaction with the WAHA (WhatsApp HTTP API). It enables developers to easily integrate WhatsApp services into their .NET applications, providing a streamlined way to manage chats and sessions.

Repository Information

Analyzed by OSRepos on October 12, 2025

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

Waha-net/waha-net is a .NET C# client library designed to simplify interaction with the WAHA (WhatsApp HTTP API). This library enables .NET developers to easily integrate WhatsApp services into their applications, providing an efficient way to manage chats and sessions. With Waha-net, you can build robust applications that communicate with WhatsApp through an HTTP API.

Installation

To start using the Waha-net library in your .NET project, you can install it via NuGet.

Run the following command in your .NET project:

dotnet add package Waha

Alternatively, you can use the NuGet Package Manager in Visual Studio to add the reference to the Waha package.

Examples

This section demonstrates how to integrate Waha-net into your .NET projects. Before using the library, it's essential to have an instance of WAHA (WhatsApp HTTP API) running.

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

After starting, WAHA will be accessible at http://localhost:3000/, where you can find the API documentation (Swagger).

ASP.NET Core Integration

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

using Waha;
using Microsoft.AspNetCore.Mvc; // Added for [FromHeader]

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");

app.Run(); // Added app.Run() to make it a runnable example

For Other .NET Applications

For .NET applications that are not ASP.NET Core, you can initialize the client as follows:

using Waha;
using System.Net.Http; // Added for HttpClient
using System.Threading; // Added for CancellationToken
using System.Linq; // Added for FirstOrDefault

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

Why Use Waha-net?

Waha-net significantly simplifies integration with the WhatsApp HTTP API (WAHA) in your .NET projects. By abstracting the complexities of API calls, it allows developers to focus on their application's business logic. The library is written in C#, leveraging the robust .NET ecosystem, and is open-source, encouraging community contributions and feedback. It's a powerful solution for any application needing to interact with WhatsApp programmatically.

Links

Related repositories

Similar repositories that may be relevant next.

dotnet/skills: Curated .NET Agent Skills for AI Coding Agents

dotnet/skills: Curated .NET Agent Skills for AI Coding Agents

May 24, 2026

The dotnet/skills repository provides a curated collection of core skills and custom agents designed to assist AI coding agents with .NET and C# development. It offers a comprehensive set of plugins covering various aspects of the .NET ecosystem, from data access and diagnostics to AI integration and project upgrades. This resource empowers developers to enhance their AI-driven coding workflows with specialized .NET capabilities.

agent-skillsC#.NET
Radarr: Your Ultimate Movie Organizer for Usenet and Torrent Users

Radarr: Your Ultimate Movie Organizer for Usenet and Torrent Users

May 1, 2026

Radarr is a powerful movie collection manager designed for Usenet and BitTorrent users. It automates the process of monitoring, grabbing, sorting, and renaming movies, ensuring your library is always organized and up-to-date. With support for various download clients and media servers, Radarr streamlines your movie management workflow.

moviemoviesmedia management
KurrentDB: An Event-Native Database for Modern Event-Driven Architectures

KurrentDB: An Event-Native Database for Modern Event-Driven Architectures

April 19, 2026

KurrentDB is an innovative database designed for modern software and event-driven architectures. Its event-native approach simplifies data modeling and ensures data integrity, while an integrated streaming engine addresses distributed messaging and data consistency challenges. This powerful platform, formerly known as EventStoreDB, provides a robust solution for complex data management.

databaseevent-sourcingevent-store
Harden-Windows-Security: Enhance Your Windows System Security with Official Methods

Harden-Windows-Security: Enhance Your Windows System Security with Official Methods

December 2, 2025

The Harden-Windows-Security repository by HotCakeX provides robust tools and guides to secure Windows using official Microsoft methods. It offers two key applications, Harden System Security and AppControl Manager, available on the Microsoft Store, catering to personal, enterprise, and military security needs. The project emphasizes defense-in-depth and adheres to SLSA Level 3 compliance for secure development.

Windows SecurityCybersecuritySystem Hardening

Source repository

Open the original repository on GitHub.

13 counted GitHub visits

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️