API
Log in
Documentation › Messages › Send WhatsApp Web message
POST

Send WhatsApp Web message

POSThttps://app.sendapp.ai/api/whatsapp-web/send
Send a text or media message via WhatsApp Web (browser automation). Set type=text for text or type=media to attach a file.
Parameters
apikey required
Your API Key.
token required
Account token.
number required
Recipient number (e.g. 1234567890).
type required
text or media.
message optional
Message text (required if type=text).
media_url optional
URL of the media file (required if type=media).
filename optional
File name for the media.
Request
curl -X POST 'https://app.sendapp.ai/api/whatsapp-web/send' \
  -H 'Content-Type: application/json' \
  -d '{
    "apikey": "YOUR_API_KEY",
    "token": "YOUR_ACCOUNT_TOKEN",
    "number": "1234567890",
    "type": "text",
    "message": "Hi, this is a test message!"
  }'
<?php
$ch = curl_init('https://app.sendapp.ai/api/whatsapp-web/send');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'apikey'  => 'YOUR_API_KEY',
        'token'   => 'YOUR_ACCOUNT_TOKEN',
        'number'  => '1234567890',
        'type'    => 'text',
        'message' => 'Hi, this is a test message!',
    ]),
]);
echo curl_exec($ch);
curl_close($ch);
const res = await fetch('https://app.sendapp.ai/api/whatsapp-web/send', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    apikey: 'YOUR_API_KEY',
    token: 'YOUR_ACCOUNT_TOKEN',
    number: '1234567890',
    type: 'text',
    message: 'Hi, this is a test message!'
  })
});
console.log(await res.json());
Response (200 OK)
{
  "status": "success",
  "message": "Message sent successfully"
}
Error
{
  "status": "error",
  "message": "No active WhatsApp Web instance found"
}