WhatsApp API for real-time business messages
Send WhatsApp text messages, with up to four images, from your website, app or CRM with a single HTTP request. Use it on its own or alongside our SMS API for SMS fallback.
- HTTP GET
- any language
- 4
- images per message
- Real time
- submission
GET https://web.cloudwhatsapp.com/wapp/api/send
?apikey=••••••
&mobile=919876543210
&msg=Hi Ravi, your order #1001 has been shipped.
&img1=https://…/order-1001.jpg Save the response for your records.
Critical message? Fall back to GET /sendSMS → SMSEndpoint
One endpoint sends text, images, or both. Use HTTP GET with URL-encoded query parameters.
| Action | Endpoint | Parameters | Notes |
|---|---|---|---|
| Send WhatsApp message | https://web.cloudwhatsapp.com/wapp/api/send | apikey, mobile, msg, img1 – img4 | Text, images, or text with images. One mobile number per request. |
Parameters
| Parameter | Required | Description | Example |
|---|---|---|---|
| apikey | Yes | Your secret WhatsApp API key | xxxxxxxxxx |
| mobile | Yes | Recipient number with country code, digits only | 919876543210 |
| msg | Yes, unless sending only images | URL-encoded message text | Hi Ravi, your order has been shipped. |
| img1 | No | Public image link (https, JPG or PNG) | https://example.com/a.jpg |
| img2, img3, img4 | No | More image links, up to four in total | https://example.com/b.jpg |
Code samples
Send a WhatsApp message with an image in your language of choice.
curl -G "https://web.cloudwhatsapp.com/wapp/api/send" \
--data-urlencode "apikey=$WA_API_KEY" \
--data-urlencode "mobile=919876543210" \
--data-urlencode "msg=Hi Ravi, your order #1001 has been shipped." \
--data-urlencode "img1=https://example.com/order-1001.jpg"<?php
$params = [
'apikey' => getenv('WA_API_KEY'),
'mobile' => '919876543210',
'msg' => 'Hi Ravi, your order #1001 has been shipped.',
'img1' => 'https://example.com/order-1001.jpg', // optional
];
$url = 'https://web.cloudwhatsapp.com/wapp/api/send?' . http_build_query($params);
echo file_get_contents($url); // save the response for your recordsconst params = new URLSearchParams({
apikey: process.env.WA_API_KEY,
mobile: '919876543210',
msg: 'Hi Ravi, your order #1001 has been shipped.',
img1: 'https://example.com/order-1001.jpg', // optional
});
const res = await fetch(`https://web.cloudwhatsapp.com/wapp/api/send?${params}`);
console.log(await res.text()); // save the response for your recordsimport os, requests
params = {
"apikey": os.environ["WA_API_KEY"],
"mobile": "919876543210",
"msg": "Hi Ravi, your order #1001 has been shipped.",
"img1": "https://example.com/order-1001.jpg", # optional
}
r = requests.get("https://web.cloudwhatsapp.com/wapp/api/send", params=params, timeout=15)
print(r.text) # save the response for your recordsBest practices
- Message only customers who have agreed to receive WhatsApp messages from you
- Call the API from your server and keep the API key in an environment variable
- If a key is ever shared in an email, chat or screenshot, ask us to replace it
- URL-encode the message and use public https links for images
- For OTPs and critical alerts, fall back to SMS when the WhatsApp request fails
Prefer not to code?
WhatsApp is built into our ready integrations.
Frequently asked questions
Can I send images with the WhatsApp API?
Yes. Add up to four public image links as img1, img2, img3 and img4 in the same request. Use https links to JPG or PNG files.
Are WhatsApp messages sent in real time?
Yes. Each request is submitted immediately. Save the response your request returns for your records.
Do WhatsApp messages need DLT templates?
No. DLT registration applies to SMS. WhatsApp messages must follow WhatsApp’s own policies, so message only customers who have agreed to hear from you.
Can I send SMS if a WhatsApp message fails?
Yes. Our WooCommerce/WordPress plugin has a “WhatsApp, SMS if it fails” option, and you can do the same in your own code by calling our SMS API when the WhatsApp request returns an error.
In what format should I send the mobile number?
Send the number with the country code and no + or spaces, for example 919876543210 for an Indian number. Our plugins add the country code for you.
Where do I get my WhatsApp API key?
Contact our team to set up WhatsApp messaging on your account. Keep the key secret and call the API from your server, never from a browser or mobile app.
Set up WhatsApp messaging
Our team activates WhatsApp on your account and helps you send your first message.
