Skip to content
Wbiztool

Messaging API

Send Message to a WhatsApp Group API

Send a WhatsApp text, image or document to a WhatsApp group that your connected number is a member of. Use it for team announcements, community updates and broadcast notifications.

POSThttps://wbiztool.com/api/v1/send_msg/group/

Body: JSON, form fields, or multipart/form-data when uploading a file

The message is queued and sent to the group from your WhatsApp number. The response gives you a msg_id you can use to check its status.

Quick example#

curl -X POST https://wbiztool.com/api/v1/send_msg/group/ \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": 12345,
    "api_key": "YOUR_API_KEY",
    "whatsapp_client": 678,
    "msg_type": 0,
    "group_name": "Sales Team Mumbai",
    "msg": "Reminder: *weekly review* starts at 4 PM today."
  }'

Replace 12345, YOUR_API_KEY and 678 with your own values. See Authentication for where to find them.

Request parameters#

Authentication

client_idintegerrequired

Your API Client ID from Settings → API keys.

api_keystringrequired

Your API key from the same page.

whatsapp_clientintegerRequired if the owner has more than one connected number

ID of the WhatsApp number to send from, from WhatsApp settings. It must be a number that belongs to the workspace owner. If you leave it out and the owner has exactly one connected number, that number is used.

Group and message

group_namestringrequired

Name of the WhatsApp group, written exactly as it appears in WhatsApp. Send it as a string. A JSON number such as 2024 returns an HTML error page (HTTP 500). See How the group is found.

msg_typeintegeroptional

0 text (default), 1 image, 2 file or document.

msgstringRequired when msg_type is 0

Message text. For images and files it's the caption and can be empty. WhatsApp formatting works: *bold*, _italic_, ~strikethrough~. message is accepted as an alias.

Images and files

img_urlstringRequired when msg_type is 1 and no file is uploaded

Public http or https URL of the image.

file_urlstringRequired when msg_type is 2 and no file is uploaded

Public http or https URL the file can be downloaded from directly.

filefileoptional

Upload the image or file instead of giving a URL. Send the request as multipart/form-data with the field named file.

file_namestringoptional

File name the group sees, such as price-list.pdf. Its extension decides how the file is sent, so include one. It's sent in lower case, characters such as & : ? * $ ; are replaced with _, and it's cut to 150 characters. If you leave it out, the name comes from the URL or the uploaded file.

Delivery options

expire_after_secondsintegeroptional

Mark the message as expired (status 4) if it hasn't been sent within this many seconds, for example 3600 for one hour. A background job does this at least 30 seconds after the deadline, so don't rely on it for deadlines shorter than a minute.

webhookstringoptional

URL that receives a POST when the message is sent or fails. The payload is the same as for Send message.

Images and files follow the same rules as Send message: URLs are downloaded when you call the API (up to 100 MB). When the message is sent, images over 16 MB and videos over 64 MB fail, WAV and OGG audio isn't supported, and files (msg_type 2) without a supported extension get .pdf added, uploaded ones included. File names are sent in lower case. See Sending images and files for the full list of extensions and errors.

To upload a file, use the multipart examples on Send message, replacing the URL with /api/v1/send_msg/group/ and phone/country_code with group_name.

Image from a URL
curl -X POST https://wbiztool.com/api/v1/send_msg/group/ \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": 12345,
    "api_key": "YOUR_API_KEY",
    "whatsapp_client": 678,
    "msg_type": 1,
    "group_name": "Sales Team Mumbai",
    "img_url": "https://example.com/reports/weekly-sales.png",
    "msg": "This week'\''s sales summary"
  }'

How the group is found#

Wbiztool doesn't check the group name when you call the API. When the message is being sent, Wbiztool searches your WhatsApp chats for group_name and opens the first result. Because of this:

  • Your connected WhatsApp number must be a member of the group.
  • Use the full group name exactly as WhatsApp shows it, including emoji and punctuation. Spaces at the start and end are ignored.
  • Make the name unique. A short or partial name can match a different chat that appears first in search.
  • If nothing matches, only admins can send messages in the group and your number isn't an admin, or only community admins can post, the message fails with the error Group not found.
  • If your number has left the group, the message fails with the error Group member blocked.

Group problems don't show up in the API response. Use a webhook or Message status to find out whether the message was sent.

Using the official client#

The Python client calls this endpoint for you.

Python
from wbiztool_client import WbizToolClient

client = WbizToolClient(api_key="YOUR_API_KEY", client_id=12345)

result = client.send_message_to_group(
    group_name="Sales Team Mumbai",
    msg="Reminder: weekly review starts at 4 PM today.",
    whatsapp_client=678,
)
print(result)

Errors raise requests.HTTPError. Read the reason with e.response.json()["message"].

Response#

A successful request returns HTTP 200:

{
  "status": 1,
  "message": "Created",
  "msg_id": 9817263
}
FieldTypeDescription
statusinteger1 if the message was queued, 0 if the request failed.
messagestringCreated on success, otherwise the error.
msg_idintegerID of the queued message. Save it to check the status later. Only present on success.

"status": 1 means the message was queued, not that it reached the group. Use a webhook or Message status to confirm it was sent.

Errors#

Errors return HTTP 400 with status set to 0:

{ "status": 0, "message": "Group Name cant be null" }
MessageHow to fix it
Auth Error - Please send correct API key and Client idSend a non-empty api_key.
Invalid client id.Send client_id as a number.
Auth Error: invalid api keyCheck the key exists, hasn't been deleted and belongs to this client_id.
Group Name cant be nullAdd group_name.
Msg cant be nullText messages (msg_type 0) need msg.
Image Url Can't be nullFor msg_type 1, send img_url or upload a file.
File Url Can't be nullFor msg_type 2, send file_url or upload a file.
Invalid file url, Can't download / Invalid file urlThe URL isn't public, timed out, or the file is over 100 MB.
Invalid whatsapp client NoneThat whatsapp_client ID doesn't belong to the workspace owner. See the warning above.
Invalid whatsapp client id.Send whatsapp_client. It's required unless the owner has exactly one connected number.
Not enough creditsYour plan has no messages left.
Demo Account can not access apisUse a regular account.
Account DisabledYour account is disabled. Contact support.
Invalid JSON format: …The JSON body isn't valid, often because of a trailing comma or an unescaped line break in msg. Use \n for new lines.

Tips#

  • Test the name first: send a short text to the group and check Message status before you automate anything.
  • Renamed groups: if someone renames the group in WhatsApp, update group_name in your integration too.
  • Message types: only 0, 1 and 2 are valid values for msg_type. Any value that isn't a whole number returns an HTML error page (HTTP 500) instead of JSON.
  • Several groups at once: Send to multiple numbers accepts group names mixed with phone numbers in one request.