๐ Send Web WhatsApp Message
Send messages using a Web WhatsApp Channel (integration_2). This supports text, media (image, video, document, audio), and both group and individual recipients.
๐ Endpoint
POST /api/v1/web-whatsapp/:id/messages:id= ID of the Web WhatsApp channel
๐ Authentication
All requests must include a valid API key passed as a Bearer token in the Authorization header:
You can get your API key from the /companies page.
Authorization: Bearer YOUR_API_KEY๐ฅ Request
๐ธ Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | โ Yes | Web WhatsApp Channel ID |
๐ธ Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
phone_number | string | โ Yes | Recipient's phone number (international format) |
recipient_type | string | โ Yes | Either "number" or "group" |
type | string | โ Yes | Type of message: text, image, video, audio, document |
message | string | โ For text | Message content (text only) |
link | string | โ For media | Public URL to the media file |
caption | string | Optional | Media caption (for image/video/document) |
๐งช Example Requests
curl -X POST https://smart.botatende.com/api/v1/web-whatsapp/57/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "254712XXXXXX",
"recipient_type": "number",
"type": "text",
"message": "Hello from Web WhatsApp"
}'curl --location 'https://smart.botatende.com/api/v1/web-whatsapp/57/messages' \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "254712XXXXXX",
"recipient_type": "number",
"type": "audio",
"message": "Hello",
"caption": "Caption",
"link": "https://botatende-bulk-message.nyc3.digitaloceanspaces.com/customer/messages/attachments/bdf4504d-6fa5-4d3b-a826-13464d722a3f-cenaza-4.mp3.opus"
}'๐ค Response
โ Success (200)
Example (Text Message)
{
"message": "Message sent successfully",
"data": [
{
"index": 0,
"result": {
"key": {
"remoteJid": "254712XXXXXX@s.whatsapp.net",
"fromMe": true,
"id": "3EB04AB1CAAB22C9F6BF04"
},
"message": {
"extendedTextMessage": {
"text": "Hello"
}
},
"messageTimestamp": "1750913718",
"status": "PENDING"
}
}
]
}Example (Audio Message)
{
"message": "Message sent successfully",
"data": [
{
"index": 0,
"result": {
"key": {
"remoteJid": "254712XXXXXX@s.whatsapp.net",
"fromMe": true,
"id": "3EB0A1B6AACA12B67CACE6"
},
"message": {
"audioMessage": {
"url": "https://mmg.whatsapp.net/...",
"mimetype": "audio/ogg; codecs=opus",
"fileLength": "267445",
"seconds": 31,
"ptt": true
}
},
"messageTimestamp": "1750914095",
"status": "PENDING"
}
}
]
}โ Error Responses
Invalid Channel ID
{ "error": "Invalid request", "code": "invalid_id_param" }Missing Required Fields
{ "error": "type is required", "code": "missing_type" }Channel Not Found
{ "message": "Unknown Channel" }Internal Error
{
"message": "Something went wrong. Our team has been notified and will look into this shortly"
}