WhatsApp groups are essential for businesses looking to connect with their teams, customers, or communities. However, manually managing them can be time-consuming. What if you could automate the creation and messaging of WhatsApp groups? With Wassenger and C#, it’s easy 🤖
🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!
In this guide, we’ll show you how to:
✅ Create a WhatsApp Group ✅ Send Messages to a WhatsApp Group ✅ Automate Group Messaging for Updates and Announcements
Why Automate WhatsApp Group Messaging? 🤔
Manually managing and messaging WhatsApp groups can be a hassle. Automating the process allows you to:
✅ Save Time — No more sending individual messages to multiple groups.
✅ Boost Engagement — Keep your teams or customers updated in real time.
✅ Improve Consistency — Ensure messages are sent at the right time without missing updates.
✅ Scale Communication — Reach more people effortlessly with automated messaging.
📢 Want to get started? Sign up for Wassenger now! 🚀
Requirements
- Having a WhatsApp number already linked to the platform and online.
- Group ID (WID) which can be found in two ways:
- On your WhatsApp number’s management panel, go to “Groups”. From there you will see the channels your number has access to.
- Using the API, query the available groups in your device for this endpoint.
Prepare the request
Target API URL using the POST method to create a group
http://api.wassenger.com/v1/devices/{deviceId}/groups
Target API URL using the POST method to send messages to a group
https://api.wassenger.com/v1/messages
Required HTTPS headers > Obtain your API key here
Content-Type: application/json
Token: $API_TOKEN
🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!
Are you a developer?
Explore how to use the code in your browser without installing any software.
Also, you can find different languages you can test on Replit.com:
1. How to Create a WhatsApp Group Using C#
Creating a WhatsApp group through Wassenger API is easy. Here’s how to do it in C#:
C# (RestClient)
// This code requires you to have installed RestSharp package. // Documentation: https://restsharp.dev // Installation: https://www.nuget.org/packages/RestSharp
var client = new RestClient("https://api.wassenger.com/v1/devices/group\_id/groups"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Token", "API TOKEN GOES HERE"); request.AddParameter("application/json", "{\"name\":\"Customer Support Group\",\"description\":\"This is a group sample description\",\"participants\":[{\"phone\":\"+393517224449\",\"admin\":true},{\"phone\":\"+393517224449\",\"admin\":false}],\"permissions\":{\"edit\":\"admins\",\"send\":\"all\",\"invite\":\"admins\",\"approval\":false}}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
C# (HttpClient)
// This code uses the built-in HttpClient package in the .NET framework. // Documentation: https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-6.0
using System.Net.Http.Headers; var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Post, RequestUri = new Uri("https://api.wassenger.com/v1/devices/group\_id/groups"), Headers = { { "Token", "API TOKEN GOES HERE" }, }, Content = new StringContent("{\"name\":\"Customer Support Group\",\"description\":\"This is a group sample description\",\"participants\":[{\"phone\":\"+393517224449\",\"admin\":true},{\"phone\":\"+393517224449\",\"admin\":false}],\"permissions\":{\"edit\":\"admins\",\"send\":\"all\",\"invite\":\"admins\",\"approval\":false}}") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } } }; using (var response = await client.SendAsync(request)) { response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body); }
✅ This creates a new WhatsApp group named “Customer Support Group” and adds two participants.
🤩 🤖 Wassenger is a complete communication platform and API solution for WhatsApp. Explore more than 100+ API use cases and automate anything on WhatsApp by signing up for a free trial and getting started in minutes!
2. How to Send Messages to a WhatsApp Group Using C#
Once the group is created, you can send messages to it using the group’s unique ID:
Send Text Message with C# (RestClient)
// This code requires you to have installed RestSharp package.
// Documentation: https://restsharp.dev
// Installation: https://www.nuget.org/packages/RestSharp
var client = new RestClient("https://api.wassenger.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Token", "API TOKEN GOES HERE");
request.AddParameter("application/json", "{\"group\":\"group_id@g.us\", \"message\":\"Sample group message\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Send Text Message with C# (HttpClient)
// This code uses the built-in HttpClient package in the.NET framework.
// Documentation: https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-6.0
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.wassenger.com/v1/messages"),
Headers =
{
{ "Token", "API TOKEN GOES HERE" },
},
Content = new StringContent("{\"group\":\"group_id@g.us\", \"message\":\"Sample group message\"}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using(var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
You can also add media to your messages:
Send Media Message with C# (RestClient)
// This code requires you to have installed RestSharp package.
// Documentation: https://restsharp.dev
// Installation: https://www.nuget.org/packages/RestSharp
var client = new RestClient("https://api.wassenger.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Token", "API TOKEN GOES HERE");
request.AddParameter("application/json", "{\"group\":\"group_id@g.us\", \"message\":\"This is a caption for an image message\", \"media\":{\"url\":\"https://picsum.photos/seed/picsum/600/400\", \"viewOnce\":false}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Send Media Message with C# (HttpClient)
// This code uses the built-in HttpClient package in the.NET framework.
// Documentation: https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-6.0
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.wassenger.com/v1/messages"),
Headers =
{
{ "Token", "API TOKEN GOES HERE" },
},
Content = new StringContent("{\"group\":\"group_id@g.us\", \"message\":\"This is a caption for an image message\", \"media\":{\"url\":\"https://picsum.photos/seed/picsum/600/400\", \"viewOnce\":false}}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using(var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
✅ This sends a message to the specified WhatsApp group automatically.
Was this helpful? Find more examples in our API Live Tester 🤖
3. How to Schedule Messages in a WhatsApp Group Using C#
Scheduling messages allows you to send updates at the perfect time:
Schedule Message with C# (RestClient)
// This code requires you to have installed RestSharp package.
// Documentation: https://restsharp.dev
// Installation: https://www.nuget.org/packages/RestSharp
var client = new RestClient("https://api.wassenger.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Token", "API TOKEN GOES HERE");
request.AddParameter("application/json", "{\"group\":\"group_id@g.us\", \"message\":\"This is a scheduled message to be sent tomorrow to a group chat.Date format is based on ISO 8601 format with default UTC time zone\", \"deliverAt\":\"2025-03-06T09:27:39.374Z\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Schedule Message with C# (HttpClient)
// This code uses the built-in HttpClient package in the.NET framework.
// Documentation: https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-6.0
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.wassenger.com/v1/messages"),
Headers =
{
{ "Token", "API TOKEN GOES HERE" },
},
Content = new StringContent("{\"group\":\"group_id@g.us\", \"message\":\"This is a scheduled message to be sent tomorrow to a group chat.Date format is based on ISO 8601 format with default UTC time zone\", \"deliverAt\":\"2025-03-06T09:27:39.374Z\"}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using(var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
✅ This schedules a message to be sent at a later time automatically.
Was this helpful? Find more examples in our API Live Tester 🤖
Frequently Asked Questions (FAQ) 🤔
1. Can I use Wassenger API to remove users from a WhatsApp group?
This guide focuses on messaging, but Wassenger API does provide options for group management, including adding or removing users.
📢 Need more help? Visit the Wassenger Help Center for detailed documentation and support!
2. Can I send images, videos, or documents to WhatsApp groups using Wassenger API?
Absolutely! Wassenger API allows you to send multimedia content such as images, videos, PDFs, and more to your WhatsApp groups.
3. How can I check if my message was successfully delivered to a WhatsApp group?
You can use the Wassenger API to retrieve message status updates, ensuring your messages are delivered and read.
4. Can I mention specific users in a WhatsApp group message?
Yes! You can mention specific participants by including their phone numbers in the message payload.
📌 Ready to automate your WhatsApp messaging? Start your free trial today! 🚀
With Wassenger and C#, you can create, send, and schedule messages to WhatsApp groups effortlessly, making communication smoother and more efficient.







