Appearance
Send media
Sends an image, file, voice note or video to a person or a group. Choose the kind in the path:
POST /api/user/whatsapp-qr/channels/{channel}/send/image
POST /api/user/whatsapp-qr/channels/{channel}/send/file
POST /api/user/whatsapp-qr/channels/{channel}/send/voice
POST /api/user/whatsapp-qr/channels/{channel}/send/videoGive the media either as an uploaded file (multipart/form-data) or as a public https URL WhatsApp can download. Not both.
POST/api/user/whatsapp-qr/channels/{channel}/send/image
Required scope:
whatsapp-qr:sendPath parameters
integer
Request body (JSON)
curl -X POST "https://loopx-console.test/api/user/whatsapp-qr/channels/105/send/image" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"chat_id":"201066278084","url":"https://example.com/offer.jpg","caption":"Our October offer"}'Example response
{
"status": true,
"code": 200,
"validation": [],
"message": "Message Sent",
"data": {
"key": {
"remoteJid": "201066278084@s.whatsapp.net",
"fromMe": true,
"id": "3EB0C431D5A2F1B7E9A5"
},
"message": {
"imageMessage": {
"mimetype": "image/jpeg",
"caption": "Our October offer"
}
},
"messageTimestamp": "1791204800",
"status": "PENDING"
}
}The runnable widget above sends JSON only
To upload a file, use multipart/form-data — see the examples below.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
chat_id | string | yes | Phone number, chat id (…@c.us, …@lid) or group id (…@g.us) |
file | file | one of file / url | The file to send (multipart upload) |
url | string | one of file / url | Public https URL of the file |
caption | string | no | Text shown under the media, up to 1,024 characters. Not allowed for voice. |
filename | string | no | File name shown to the recipient (mainly for file) |
Formats and size limits
| Kind | Accepted | Max upload | Notes |
|---|---|---|---|
image | JPEG (.jpg, .jpeg) | 5 MB | WhatsApp needs JPEG — send PNG and other formats as file |
file | any | 25 MB | Shown as a document |
voice | .ogg, .opus, .mp3, .m4a, .wav, .aac, .webm | 16 MB | Converted to a WhatsApp voice note automatically |
video | .mp4, .3gp, .mov | 16 MB | Converted to MP4 automatically |
Upload a file
curl
bash
curl -X POST "https://api.genudo.ai/api/user/whatsapp-qr/channels/105/send/voice" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json" \
-F "chat_id=201066278084" \
-F "file=@./welcome.mp3"PHP (Guzzle)
php
<?php
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', 'https://api.genudo.ai/api/user/whatsapp-qr/channels/105/send/file', [
'headers' => [
'Authorization' => 'Bearer '.$token,
'Accept' => 'application/json',
],
'multipart' => [
['name' => 'chat_id', 'contents' => '120363025988123456@g.us'],
['name' => 'caption', 'contents' => 'Price list'],
['name' => 'file', 'contents' => fopen('./prices.pdf', 'r'), 'filename' => 'prices.pdf'],
],
]);Node.js
js
import fs from 'node:fs'
const form = new FormData()
form.append('chat_id', '201066278084')
form.append('caption', 'Product demo')
form.append('file', new Blob([fs.readFileSync('./demo.mp4')]), 'demo.mp4')
const res = await fetch('https://api.genudo.ai/api/user/whatsapp-qr/channels/105/send/video', {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
Accept: 'application/json',
// Do NOT set Content-Type — fetch sets the multipart boundary for you.
},
body: form,
})Response
data contains the sent WhatsApp message. key.id is the WhatsApp message id, and message holds an imageMessage, documentMessage, audioMessage or videoMessage, depending on the type.
Sends count toward your account's rate limit of 30 requests per minute.