โ† Back to Blog

How to Send WhatsApp Messages via REST API in 5 Minutes

Learn how to send WhatsApp messages programmatically using a simple REST API call โ€” no Meta approval, no business account required. Live in under 5 minutes.

Send WhatsApp Messages via REST API in 5 Minutes

WhatsApp is the world's most popular messaging app with over 2 billion users.
Reaching your customers on WhatsApp used to mean going through Meta's lengthy
approval process โ€” weeks of waiting, business verification, and per-message fees.

GetWhatsAPI changes that. Scan a QR code with your personal or business
WhatsApp number, get an API token, and start sending messages immediately.


Prerequisites

  • A GetWhatsAPI account (register free)
  • Your WhatsApp number linked via the dashboard
  • Your API token from the API & Security page

After registering, go to Connect WhatsApp in the dashboard and scan the
QR code with WhatsApp on your phone:

Open WhatsApp โ†’ โ‹ฎ Menu โ†’ Linked Devices โ†’ Link a Device

Your instance connects within seconds.


Step 2 โ€” Get Your API Token

Navigate to API & Security in the sidebar. Copy your Bearer token.


Step 3 โ€” Send Your First Message

Using curl

curl -X POST https://getwhatsapi.com/api/v1/messages/send-json \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": "+1234567890",
    "text": "Hello from GetWhatsAPI! ๐Ÿ‘‹"
  }'

Using Python

import httpx

TOKEN = "your_api_token_here"

response = httpx.post(
    "https://getwhatsapi.com/api/v1/messages/send-json",
    headers={"Authorization": f"Bearer {TOKEN}"},
    json={
        "recipient": "+1234567890",
        "text": "Hello from GetWhatsAPI! ๐Ÿ‘‹"
    }
)

print(response.json())
# {"message_id": "...", "timestamp": "...", "conversation_id": "..."}

Using Node.js

const response = await fetch(
  "https://getwhatsapi.com/api/v1/messages/send-json",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_TOKEN",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      recipient: "+1234567890",
      text: "Hello from GetWhatsAPI! ๐Ÿ‘‹",
    }),
  }
);

const data = await response.json();
console.log(data);

Step 4 โ€” Send Media (Images, PDFs)

Need to send an image or document? Use the multipart endpoint:

curl -X POST https://getwhatsapi.com/api/v1/messages/send \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "recipient=+1234567890" \
  -F "text=Please find your invoice attached." \
  -F "[email protected]"

Supported formats: JPEG, PNG, GIF, WebP, PDF (max 16 MB).


Step 5 โ€” Receive Messages (Inbox)

Poll the inbox endpoint to read incoming messages:

curl https://getwhatsapi.com/api/v1/messages/inbox \
  -H "Authorization: Bearer YOUR_TOKEN"

Plan Limits

Plan Messages/month Price
Trial 50/day (14 days) Free
Starter 2,000 $19
Business 8,000 $49
Growth 20,000 $99
Enterprise Unlimited Custom

What's Next?

  • Read the full API reference
  • Set up an IP whitelist in API & Security for extra protection
  • Explore OTP and order notification use cases

Start your free trial today โ€” no credit card required.