Skip to content

Send text ​

Sends a text message from the channel's WhatsApp number to a person or a group.

POST/api/user/whatsapp-qr/channels/{channel}/send/text
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/text" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"chat_id":"201066278084","text":"Hi Mahmoud, your order is ready for pickup."}'
<?php

use GuzzleHttp\Client;

$client = new Client();
$response = $client->request('POST', 'https://loopx-console.test/api/user/whatsapp-qr/channels/105/send/text', [
    'headers' => [
        'Authorization' => 'Bearer $TOKEN',
        'Accept'        => 'application/json',
    ],
    'json' => [
        'chat_id' => '201066278084',
        'text' => 'Hi Mahmoud, your order is ready for pickup.'
    ]
]);

$data = json_decode($response->getBody(), true);
const res = await fetch('https://loopx-console.test/api/user/whatsapp-qr/channels/105/send/text', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer $TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "chat_id": "201066278084",
    "text": "Hi Mahmoud, your order is ready for pickup."
  })
});

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": "3EB0C431D5A2F1B7E9A4"
    },
    "message": {
      "extendedTextMessage": {
        "text": "Hi Mahmoud, your order is ready for pickup."
      }
    },
    "messageTimestamp": "1791204800",
    "status": "PENDING"
  }
}

Request body ​

FieldTypeRequiredDescription
chat_idstringyesPhone number with country code, a chat id (…@c.us, …@lid) or a group id (…@g.us)
textstringyesMessage text, up to 10,000 characters

Send to a group ​

Use the group's id from List groups:

json
{ "chat_id": "120363025988123456@g.us", "text": "Morning team — 14 new leads today." }

Response ​

data contains the sent WhatsApp message.

FieldTypeDescription
key.idstringWhatsApp message id
key.remoteJidstringThe chat the message went to
statusstringDelivery status at send time, usually PENDING

A bare phone number is sent to …@c.us.

Sends count toward your account's rate limit of 30 requests per minute.