Contents

WhatsApp Connect

Send from your own WhatsApp numbers linked by QR code: single, media and bulk messages.

WhatsApp Connect is a plugin that sends messages from your own WhatsApp numbers, linked by scanning a QR code — like WhatsApp Web. There are no templates to approve: send any text, personalised per recipient, with an optional image, video or document. Messages are reported through the same statuses and webhooks as SMS, and messages people send back arrive in your dashboard inbox, the API and message.received webhooks.

Unofficial protocol — use it responsibly

WhatsApp Connect uses the WhatsApp Web protocol, not the official WhatsApp Business Platform. WhatsApp can restrict or ban numbers that send unsolicited or high-volume messages. Message people who expect to hear from you, keep the default pacing, and use a number you can afford to lose. For approved templates at scale, use WhatsApp (Business Platform) instead.

Set up

  1. In the dashboard, open Plugins and activate WhatsApp Connect (company owners and admins). Pick a subscription plan if SMS21 offers one; otherwise each message is charged from your wallet.
  2. Open WhatsApp Connect → Devices, add a device and scan its QR code with WhatsApp on your phone (Settings → Linked devices → Link a device). The device shows connected within a few seconds. Keep the phone online occasionally, or WhatsApp unlinks it after about 14 days.
  3. Create an API key with the whatsapp_connect:send scope under API keys. Test keys never use a device, so you can build against them first.

Send a message

POST /whatsapp-connect/send queues one message and returns 202 with the message. A connected device sends it at its own pace.

FieldTypeDescription
tostringrequiredRecipient in international format, e.g. 919876543210.
textstringrequiredUp to 4096 characters (1024 as a media caption). Personalise with {{name}}, or {{name|fallback}} for a default.
variablesobjectoptionalValues for the placeholders, by name.
mediaobjectoptional{ type, url, filename? } — see Media.
deviceIdstringoptionalSend from this device (wad_…). Omit to rotate across connected devices.
typestringoptionaltransactional (default) or promotional — the pricing category.
curl -X POST https://sms21.in/v1/whatsapp-connect/send \
  -H "X-API-Key: $SMS21_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-A1042-shipped" \
  -d '{"to":"919876543210","text":"Hi {{name|there}}, order {{order}} has shipped.","variables":{"name":"Asha","order":"A-1042"}}'

Media

Add media to send a file, with text as its caption. SMS21 downloads it from a public https URL (no redirects) when the message is sent.

typeAccepted files
imageJPEG, PNG or WebP
videoMP4 or 3GPP
documentAny file except HTML; set filename to the name the recipient sees.
curl -X POST https://sms21.in/v1/whatsapp-connect/send \
  -H "X-API-Key: $SMS21_API_KEY" -H "Content-Type: application/json" \
  -d '{"to":"919876543210","text":"Your invoice is attached.","media":{"type":"document","url":"https://cdn.example.com/INV-1042.pdf","filename":"Invoice-1042.pdf"}}'

Send to a WhatsApp group

Your linked numbers can post to the WhatsApp groups they are in. GET /whatsapp-connect/groups lists them (filter with deviceId or search); pass a group's groupId to POST /whatsapp-connect/send instead of to. Text, placeholders and media work as for a number.

RuleWhat happens
Who sendsA linked number that is in the group, preferring one that is online. Pin one with deviceId if several of your numbers are in the group.
Admin-only groupsWhen only admins may post (onlyAdminsCanSend), the number must be an admin; otherwise the send is refused with 400.
Group listRefreshed a few seconds after a device connects and whenever groups change (joined, left, renamed, promoted).
Left the group laterA queued message ends as rejected with NOT_IN_GROUP (not charged).
PriceOne message, priced at the sending number’s country.
# 1. Find the group
curl https://sms21.in/v1/whatsapp-connect/groups?search=sales -H "X-API-Key: $SMS21_API_KEY"
# {"success":true,"data":[{"groupId":"120363025246125486@g.us","name":"Sales team",
#   "deviceId":"wad_…","participants":42,"onlyAdminsCanSend":false,"canSend":true,…}]}

# 2. Send to it
curl -X POST https://sms21.in/v1/whatsapp-connect/send \
  -H "X-API-Key: $SMS21_API_KEY" -H "Content-Type: application/json" \
  -d '{"groupId":"120363025246125486@g.us","text":"Team, the October report is ready."}'

Groups and WhatsApp's rules

Post only to groups that expect your messages. Automated posting to groups people did not ask for is the quickest way to get a number banned.

Bulk campaigns

POST /whatsapp-connect/bulk queues a campaign (202). Send exactly one of recipients (up to 5 000, each with its own variables) or listId (a saved contact list whose columns fill the placeholders). Every recipient’s text is checked up front, so a missing value fails the request instead of sending a broken message.

FieldTypeDescription
textstringrequiredThe message, with placeholders.
recipientsarrayoptional[{ to, variables? }] — duplicates are collapsed.
listIdstringoptionalA contact list (lst_…).
namestringoptionalLabel shown in reports.
mediaobjectoptionalSame as for a single message.
deviceIdstringoptionalPin the campaign to one device; omit to spread it over all.
scheduledAtstringoptionalISO 8601 send time; omit to start now.
typestringoptionalpromotional (default) or transactional.
curl -X POST https://sms21.in/v1/whatsapp-connect/bulk \
  -H "X-API-Key: $SMS21_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: festive-offer-2026" \
  -d '{
    "name": "Festive offer",
    "text": "Hi {{name|there}}, enjoy 20% off this week.",
    "media": {"type": "image", "url": "https://cdn.example.com/offer.jpg"},
    "recipients": [
      {"to": "919876543210", "variables": {"name": "Asha"}},
      {"to": "919812345678"}
    ]
  }'
EndpointPurpose
GET /whatsapp-connect/bulkList campaigns, newest first.
GET /whatsapp-connect/bulk/{batchId}Progress counts.
GET /whatsapp-connect/bulk/{batchId}/recipientsThe message created for each recipient, or why it was skipped (suppressed or blocked numbers).
POST /whatsapp-connect/bulk/{batchId}/cancelStops recipients not yet created; messages already queued are still sent.

Devices and pacing

GET /whatsapp-connect/devices lists your linked numbers with status (connected, qr_pending, disconnected or logged_out), sentToday and dailyLimit — useful for a health check before a campaign. Devices are linked, paused and removed only in the dashboard, because linking needs a phone.

  • Each device waits sendIntervalSeconds (plus random jitter) between messages and stops at its dailyLimit; both are set per device in the dashboard. Slow, human-like sending protects your number.
  • Without deviceId, messages rotate across connected devices, so adding a device raises throughput.
  • A message waits in queued while no device is free. If no device sends it within 24 hours it ends as expired and is not charged.

Statuses and webhooks

Messages have channel: "whatsapp_connect" and fire the usual webhook events.

StatusMeaningCharged
queuedWaiting for a device.—
submittedAccepted by WhatsApp’s servers (one grey tick).Yes
deliveredReached the recipient’s phone (two ticks).Yes
rejectedThe number is not on WhatsApp (NOT_ON_WHATSAPP).No
failedWhatsApp refused it or the media could not be sent.Refunded if your rate includes failure refunds
expiredNo device sent it within 24 hours.No

Receive messages

Messages people send to a linked number — text, photos, videos, voice notes, documents, stickers, locations and contacts — are stored as they arrive, including messages posted in groups the number is in. Status updates and channels are ignored. You can read and reply to them in the dashboard (WhatsApp Connect → Inbox), list them with GET /inbound, and receive them as message.received webhooks.

  • Each device has receiveInbound (on by default) and an optional inboundProjectId. Without one, a message is reported under the project that last messaged the person, else your oldest project. Webhooks of that project receive it.
  • Replies starting with STOP add the sender to your opt-out list (campaigns skip them); START removes them. This only applies to direct messages, not to what people say in groups.
  • Group messages carry groupId (the group, "…@g.us"); from is the member who wrote it and senderName their profile name. When WhatsApp hides a member's number, from is their privacy ID instead of a phone number. Reply to the group by sending to its groupId. Direct messages have groupId: null.
  • Receiving is free. A reply you send is an ordinary WhatsApp Connect message: send it with deviceId set to the device the person wrote to.

Webhook payload

Subscribe an endpoint to message.received (dashboard: WhatsApp Connect → Webhooks, which also sends a sample event). WhatsApp Connect events carry channel: "whatsapp_connect":

{
  "id": "evt_01k6c0w1v9ph7n3x2q8r5s4t6m",
  "event": "message.received",
  "timestamp": "2026-10-03T09:41:07.000Z",
  "inboundId": "inb_01k6c0w1v4m2f8e6d0c9b7a5z3",
  "channel": "whatsapp_connect",
  "deviceId": "wad_01k5x7r2b8n4m6q0w3e5t7y9u1",
  "from": "919876543210",
  "senderName": "Asha Sharma",
  "groupId": null,
  "to": "919812345678",
  "text": "[image] Is this the right size?",
  "media": {
    "type": "image",
    "mimeType": "image/jpeg",
    "filename": null,
    "url": "https://sms21.in/v1/inbound/inb_01k6c0w1v4m2f8e6d0c9b7a5z3/media"
  },
  "keyword": null,
  "action": "none"
}
FieldTypeDescription
fromstringrequiredThe sender, E.164 digits without "+".
tostringrequiredYour linked number that received it.
senderNamestring | nullrequiredTheir WhatsApp profile name, when shared.
textstringrequiredThe message. Media is labelled, e.g. [image] caption, [location] … maps link. Untrusted input.
mediaobject | nullrequiredtype (image, video, audio, document, sticker), mimeType, filename and url. Download the file with an API key of the project (scope reports:read). Files up to 16 MB are kept.
deviceIdstringrequiredThe device (wad_…) — use it to reply from the same number.

Fetch messages and files

# Newest first; also filter with from, to, receivedFrom, receivedTo
curl "https://sms21.in/v1/inbound?channel=whatsapp_connect" -H "X-API-Key: $SMS21_API_KEY"

# The photo, voice note or document of one message
curl -o file.bin "https://sms21.in/v1/inbound/inb_01k6c0w1v4m2f8e6d0c9b7a5z3/media"   -H "X-API-Key: $SMS21_API_KEY"

Billing

Each message is charged at the WhatsApp Connect price in your rate card, held from your wallet when it is queued. On a subscription plan, messages first use the plan’s monthly allowance; beyond it they are charged from the wallet at the plan’s overage price. Without enough balance the request fails with 402 INSUFFICIENT_BALANCE.

Errors

HTTPCodeWhat to do
403PLUGIN_NOT_ACTIVEActivate WhatsApp Connect under Plugins.
403PLUGIN_NOT_AVAILABLEThe plugin is switched off platform-wide; contact support.
409WA_DEVICE_NOT_LINKEDLink a device and scan its QR code first.
400WA_MEDIA_URL_INVALIDUse a public https URL of a supported type.
404NOT_FOUNDThe deviceId or listId is not in this company, or none of your numbers is in the groupId.
402INSUFFICIENT_BALANCETop up the wallet.

Test keys

With a test key no device is used: messages are reported delivered after a moment, and numbers ending in 0000 are reported as not on WhatsApp (rejected). Test messages are never charged.

Every field and response is in the API reference under WhatsApp Connect.