Back to blogs

How to Send Bulk WhatsApp Messages Using the ChatBreez API

By ChatBreez TeamUpdated May 28, 20269 min read

How to Send Bulk WhatsApp Messages Using the ChatBreez API

Whether you're running a marketing campaign, sending order notifications, or broadcasting alerts to thousands of users, bulk WhatsApp messaging is one of the most effective ways to reach your audience. WhatsApp boasts open rates north of 90% — dwarfing email — making it the channel of choice for businesses that need their messages actually read.

In this guide, you'll learn how to send bulk WhatsApp messages programmatically using the ChatBreez API a developer-friendly, no-per-message-fee WhatsApp API that lets you connect multiple numbers and send unlimited messages from $5/month.

Why Use an API to Send Bulk WhatsApp Messages?

Manually sending WhatsApp messages doesn't scale. Once you need to reach hundreds or thousands of contacts, you need an automated solution. A REST API approach gives you:

  • Full control — loop over your contact list, personalize each message, and handle failures gracefully.
  • No template approval headaches — unlike the official WhatsApp Business API, ChatBreez doesn't require pre-approved message templates.
  • Cost predictability — flat monthly pricing with no per-message charges means sending 10,000 messages costs the same as sending 10.
  • Integration flexibility — plug it into your CRM, e-commerce platform, cron job, or internal tooling.

Prerequisites

Before we start, make sure you have:

  1. A ChatBreez account (14-day free trial, no credit card required).
  2. A connected WhatsApp number (you'll scan a QR code in the dashboard).
  3. Your API Key from the ChatBreez dashboard.
  4. curl installed on your machine (comes pre-installed on macOS and most Linux distros).

Step 1: Set Up Your ChatBreez Instance

Log in to your ChatBreez dashboard and:

  1. Navigate to InstancesAdd Instance.
  2. Enter your WhatsApp number in international format without the + sign (e.g., 254700000000).
  3. Give it a memorable name — you'll use this in every API URL (e.g., marketing-bot).
  4. Scan the QR code with your WhatsApp app under Linked Devices → Link a Device.

Once connected, grab your API Key from the API Keys section of the dashboard.

Step 2: Understand the Send-Text Endpoint

All API requests go to the base URL:

https://api.chatbreez.com

To send a text message, the endpoint is:

POST /whatsapp/send-text/:instance

Where :instance is the name you gave your WhatsApp instance. Authentication is handled via the X-API-Key header — include it on every request.

A minimal request body looks like this:

{
  "recipient": "254123456789",
  "text": "Hello! This message was sent via ChatBreez."
}

Step 3: Send a Single Message with cURL

Let's verify everything works before building the bulk loop. Replace YOUR_API_KEY and my-instance with your actual values:

curl -X POST https://api.chatbreez.com/whatsapp/send-text/my-instance \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": "254712345678",
    "text": "Hello from ChatBreez! 👋"
  }'

A successful response returns HTTP 201 Created. If you see 401 Unauthorized, double-check your API key. 400 Bad Request means a required field is missing or malformed.

Step 4: Send Bulk Messages with a Bash Script

Now for the main event. The pattern for bulk messaging is simple: loop through a list of recipients and call the API for each one, with a small delay between requests to be a good citizen.

Prepare Your Contact List

Create a plain-text file called contacts.txt with one phone number per line (international format, no +):

254712345678
254723456789
254734567890
254745678901
254756789012

The Bulk Send Script

Save the following as bulk_send.sh:

#!/usr/bin/env bash

# ── Configuration ────────────────────────────────────────────────
API_KEY="YOUR_API_KEY"
INSTANCE="my-instance"
BASE_URL="https://api.chatbreez.com/whatsapp/send-text/${INSTANCE}"
CONTACTS_FILE="contacts.txt"
MESSAGE="Hi there! 🎉 We have an exclusive offer just for you. Visit chatbreez.com to learn more."
DELAY_SECONDS=1   # Pause between messages (be respectful, avoid spam flags)
# ─────────────────────────────────────────────────────────────────

SUCCESS=0
FAILED=0
TOTAL=$(wc -l < "$CONTACTS_FILE")

echo "Starting bulk send to ${TOTAL} contacts..."
echo "─────────────────────────────────────"

while IFS= read -r PHONE; do
  # Skip empty lines
  [[ -z "$PHONE" ]] && continue

  HTTP_STATUS=$(curl -s -o /tmp/cb_response.json -w "%{http_code}" \
    -X POST "$BASE_URL" \
    -H "X-API-Key: $API_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"recipient\": \"${PHONE}\", \"text\": \"${MESSAGE}\"}")

  if [[ "$HTTP_STATUS" == "201" ]]; then
    echo "✅  Sent to ${PHONE}"
    ((SUCCESS++))
  else
    BODY=$(cat /tmp/cb_response.json)
    echo "❌  Failed for ${PHONE} (HTTP ${HTTP_STATUS}): ${BODY}"
    ((FAILED++))
  fi

  sleep "$DELAY_SECONDS"

done < "$CONTACTS_FILE"

echo "─────────────────────────────────────"
echo "Done. ✅ ${SUCCESS} sent | ❌ ${FAILED} failed"

Make it executable and run it:

chmod +x bulk_send.sh
./bulk_send.sh

Sample output:

Starting bulk send to 5 contacts...
─────────────────────────────────────
✅  Sent to 254712345678
✅  Sent to 254723456789
✅  Sent to 254734567890
❌  Failed for 254745678901 (HTTP 400): {"error":"Invalid recipient"}
✅  Sent to 254756789012
─────────────────────────────────────
Done. ✅ 4 sent | ❌ 1 failed

Step 5: Personalize Each Message

Bulk doesn't have to mean generic. You can personalize messages per recipient by storing names alongside phone numbers. Update contacts.txt to a CSV format:

254712345678,Alice
254723456789,Bob
254734567890,Carol

Then adjust the script to read both fields:

while IFS=',' read -r PHONE NAME; do
  [[ -z "$PHONE" ]] && continue

  MESSAGE="Hi ${NAME}! 👋 Your exclusive offer is waiting. Check it out at chatbreez.com."

  curl -s -o /dev/null -w "%{http_code}" \
    -X POST "$BASE_URL" \
    -H "X-API-Key: $API_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"recipient\": \"${PHONE}\", \"text\": \"${MESSAGE}\"}"

  sleep 1
done < contacts.txt

Now every recipient gets a message with their name — a small touch that meaningfully improves engagement.

Step 6: Send Media in Bulk (Images, Documents, Videos)

ChatBreez also supports rich media messages via the /whatsapp/send-media/:instance endpoint. Sending a promotional image to your entire list is just as straightforward:

curl -X POST https://api.chatbreez.com/whatsapp/send-media/my-instance \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": "254712345678",
    "mediaUrl": "https://yourdomain.com/promo-banner.jpg",
    "mediaType": "image",
    "caption": "🔥 Our biggest sale of the year starts NOW!"
  }'

Wrap this in the same loop pattern from Step 4 to blast a media campaign to your full list.

Best Practices for Bulk WhatsApp Messaging

Getting to the inbox is just the first step — staying there requires responsible sending habits:

PracticeWhy It Matters
Add delays between messagesRapid-fire sending can trigger spam detection. 0.5–2 seconds between messages is a safe range.
Keep messages relevantOnly message contacts who have opted in and expect to hear from you.
Personalize where possibleFirst-name greetings and contextual content reduce block/report rates.
Handle errors and retryLog failed deliveries and retry after a backoff period.
Respect opt-outsMaintain an unsubscribe list and honour removal requests immediately.
Test before blastingAlways send to a small test group first to verify formatting and links.

Common Use Cases for Bulk WhatsApp Messaging

With the script pattern above, you can power a wide range of real-world workflows:

  • E-commerce: Order confirmations, shipping updates, delivery notifications.
  • Marketing campaigns: Flash sales, product launches, event announcements.
  • Real-time alerts: Server downtime notices, fraud alerts, appointment reminders.
  • Customer support: Proactive outreach, satisfaction surveys, follow-ups.
  • Internal communications: Staff shift reminders, HR announcements, emergency alerts.

Why ChatBreez for Bulk WhatsApp Messaging?

There are several WhatsApp API providers on the market. Here's what sets ChatBreez apart for bulk use cases:

  • No per-message fees — send 100 or 100,000 messages for the same flat monthly price.
  • No template approval required — skip the Meta approval process and start sending immediately.
  • Multi-number support — connect up to 10 numbers (Enterprise plan) to distribute load across instances.
  • No daily message cap — every plan includes unlimited daily sends.
  • Simple REST API — standard JSON over HTTPS, no SDKs required.
  • Starts at $5/month — accessible for solo developers and small businesses.

Wrapping Up

Sending bulk WhatsApp messages with the ChatBreez API boils down to a simple loop: iterate over your contact list, POST to /whatsapp/send-text/:instance for each recipient, and handle the response. With a small Bash script and your API key, you can be up and running in under 10 minutes.

Ready to get started? Create your free ChatBreez account — no credit card needed, 14-day free trial included. See the full send-text endpoint reference and try requests live in the API Playground.


Have questions or need help with your integration? Reach out via the ChatBreez email, the support team is fast and developer-friendly.