Skip to content

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/video

Give 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:send
Path 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"}'
<?php

use GuzzleHttp\Client;

$client = new Client();
$response = $client->request('POST', 'https://loopx-console.test/api/user/whatsapp-qr/channels/105/send/image', [
    'headers' => [
        'Authorization' => 'Bearer $TOKEN',
        'Accept'        => 'application/json',
    ],
    'json' => [
        'chat_id' => '201066278084',
        'url' => 'https://example.com/offer.jpg',
        'caption' => 'Our October offer'
    ]
]);

$data = json_decode($response->getBody(), true);
const res = await fetch('https://loopx-console.test/api/user/whatsapp-qr/channels/105/send/image', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer $TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "chat_id": "201066278084",
    "url": "https://example.com/offer.jpg",
    "caption": "Our October offer"
  })
});

const data = await res.json();

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 ​

FieldTypeRequiredDescription
chat_idstringyesPhone number, chat id (…@c.us, …@lid) or group id (…@g.us)
filefileone of file / urlThe file to send (multipart upload)
urlstringone of file / urlPublic https URL of the file
captionstringnoText shown under the media, up to 1,024 characters. Not allowed for voice.
filenamestringnoFile name shown to the recipient (mainly for file)

Formats and size limits ​

KindAcceptedMax uploadNotes
imageJPEG (.jpg, .jpeg)5 MBWhatsApp needs JPEG — send PNG and other formats as file
fileany25 MBShown as a document
voice.ogg, .opus, .mp3, .m4a, .wav, .aac, .webm16 MBConverted to a WhatsApp voice note automatically
video.mp4, .3gp, .mov16 MBConverted 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.