Sending messages programmatically to a WhatsApp group can be helpful for quick action and automating communications. Whether it’s for pipeline notifications, alerts, or updates, this guide will help you use APIs to send messages directly into WhatsApp groups or chats. Among many providers, Whapi (whapi.cloud) stands out for its free sandbox plan and affordable pricing.
- To be noted, this is not a sponsored or promotional post. In my current position last year, I had to send pipeline failure notifications into a WhatsApp group, and I struggled because other options, including the official API, only supported single-person messaging. Later, I found Whapi to be a useful solution.
Why Whapi?
Whapi offers a powerful yet straightforward solution to integrate WhatsApp messaging.
- Sandbox Plan: Free forever! Allows sending up to 150 messages daily and 1,000 API calls monthly.
- Developer Plan: Starts at $29/month for advanced features.
- Ease of Use: Comes with a clean API and detailed documentation for developers.
Step 1: Setting Up Whapi
To get started, sign up for a Whapi account on whapi.cloud. Once you’re logged in:
- Get Your API Token: This is required to authenticate your requests.
- Test in the Sandbox: Use their free plan to test your integration.
- Authorize WhatsApp: Open your WhatsApp app in phone and login into WhatsApp web to give permission.
Step 2: Fetch Group IDs
To send messages to a group, you need the Group’s ID. To get it, simply call the Whapi’s https://gate.whapi.cloud/groups
API endpoint with credential or simply from the dashboard.

{
"groups": [
{
"id": "[email protected]",
"name": "DevOps Team",
"type": "group"
},
{
"id": "[email protected]",
"name": "Project Updates",
"type": "group"
}
]
}
From this response, note down the id of the group you want to send a message to.
Step 3: Sending a Message to a Group
Here’s a Python script to send messages programmatically to a WhatsApp group using Whapi.
import requests
def send_whatsapp_group_message(api_url, api_token, group_id, message):
# Prepare WhatsApp API request headers
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_token}"
}
# WhatsApp message body
body = {
"typing_time": 0,
"to": group_id,
"body": message
}
# Make the POST request
response = requests.post(f"{api_url}/send", headers=headers, json=body)
# Check the response
if response.status_code == 200:
print("Message sent successfully:", response.json())
else:
print("Failed to send message:", response.text)
API_URL = "https://gate.whapi.cloud/messages/text"
API_TOKEN = "your_api_token"
GROUP_ID = "[email protected]" # Replace with the group ID you retrieved
MESSAGE = "Hello, DevOps Team! This is a test message."
send_whatsapp_group_message(API_URL, API_TOKEN, GROUP_ID, MESSAGE)
Replace the placeholders (API_TOKEN
, GROUP_ID
, and MESSAGE
) with your actual details.

Other WhatsApp API Providers
If you’re exploring additional options, here are a few other providers:
- Twilio: A trusted platform for SMS and WhatsApp messaging with robust API support.
- 360Dialog: Offers a WhatsApp Business API at competitive pricing.
- Vonage: Provides messaging APIs with a developer-friendly interface.
With this article, you can now send pipeline notifications or other alerts using API to WhatsApp group. If you’re facing any issue let me know in the comment.