DEV Community

Cover image for Stop Paying Per Message — Send WhatsApp Messages Free With Your Own API
Abdullah Al Adnan
Abdullah Al Adnan

Posted on

Stop Paying Per Message — Send WhatsApp Messages Free With Your Own API

WPSent lets you send and receive WhatsApp messages via a simple REST API. No monthly fees. No per-message charges. Just scan a QR code and you're live in 60 seconds.


If you've ever needed to send WhatsApp messages from your app, bot, or automation — you already know how expensive it gets.

The official WhatsApp Business API charges per conversation. Third-party services charge per message. And most of them make you jump through hoops just to get an API key.

WPSent is different. It's free, open-source, and takes 60 seconds to set up.


What Is WPSent?

WPSent is a WhatsApp API gateway you can use in two ways:

  1. Use the hosted version at wpsent.xyz — no setup required
  2. Self-host it on your own server for complete control

Either way, you get:

  • ✅ A REST API to send WhatsApp messages
  • ✅ Receive inbound messages via webhooks
  • ✅ A dashboard to monitor all your message logs
  • ✅ Support for text, emojis, reactions, stickers, and media
  • ✅ Multiple users on the same instance
  • ✅ No per-message fees. Ever.

Getting Started in 60 Seconds

Step 1 — Visit wpsent.xyz

Go to wpsent.xyz and enter your phone number in international format.

+880 1711 000000
+1 415 000 0000
+44 7700 000000
Enter fullscreen mode Exit fullscreen mode

Any format works — WPSent cleans it up automatically.

Step 2 — Scan the QR Code

A QR code appears on screen. Open WhatsApp on your phone:

WhatsApp → Linked Devices → Link a Device → Point camera at screen

That's the same flow as WhatsApp Web. Takes about 5 seconds.

Step 3 — Get Your Credentials

After scanning, you land on your dashboard. You'll see two things:

Credential What it is
Client ID — e.g. cid_a3f9b2 Your public identifier. Safe to use in URLs.
API Secret Key — e.g. f47ac10b-58cc... Your private key. Keep this secret.

Copy both. You'll use them for every API call.


Sending Your First Message

With your credentials, sending a WhatsApp message is a single HTTP request:

cURL

curl -X POST "https://wpsent.xyz/send?clientid=cid_a3f9b2&key=YOUR_SECRET&to=8801711000000" \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello from WPSent! 👋"}'
Enter fullscreen mode Exit fullscreen mode

Node.js

const res = await fetch(
  'https://wpsent.xyz/send?clientid=cid_a3f9b2&key=YOUR_SECRET&to=8801711000000',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ message: 'Hello from WPSent! 👋' })
  }
);
const data = await res.json();
console.log(data); // { ok: true, logId: '...' }
Enter fullscreen mode Exit fullscreen mode

Python

import requests

requests.post(
    'https://wpsent.xyz/send',
    params={'clientid': 'cid_a3f9b2', 'key': 'YOUR_SECRET', 'to': '8801711000000'},
    json={'message': 'Hello from WPSent! 👋'}
)
Enter fullscreen mode Exit fullscreen mode

The phone number goes in the to parameter — digits only, no + needed (though + works too).


Receiving Messages with Webhooks

Want to get notified when someone sends you a WhatsApp message? Add a webhook from your dashboard.

Go to Dashboard → Webhooks → Add Webhook, enter your URL, and choose POST or GET.

Every time you receive a message, WPSent fires a request to your URL:

{
  "event": "message_received",
  "from": "8801711000000",
  "body": "Hey, I need help with my order!",
  "type": "text",
  "timestamp": "2024-01-01T10:30:00.000Z"
}
Enter fullscreen mode Exit fullscreen mode

Works for everything — text, emojis, reactions ([Reaction: 👍]), stickers, images, voice notes, and locations. Your webhook endpoint receives a clean, consistent payload every time.

Example Flask webhook receiver:

from flask import Flask, request
app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
    data = request.json
    print(f"Message from {data['from']}: {data['body']}")
    return {'ok': True}
Enter fullscreen mode Exit fullscreen mode

Your Dashboard

Every account gets a clean dashboard at wpsent.xyz/dashboard showing:

  • 📊 Stats — total sent, received, and failed message counts
  • 📋 Message logs — last 100 messages with direction, type, and status
  • 🧪 Playground — send a test message right from the browser
  • 🔗 Webhooks — add, pause, and delete webhook URLs
  • 📖 Code examples — copy-paste snippets in curl, Node.js, and Python

WPSent vs Paid WhatsApp APIs

WPSent Paid APIs
Cost Free (self-hosted) $0.005–$0.08 per message
Setup time 60 seconds Days to weeks (approval process)
Business verification Not required Required
Your phone number ✅ Use your own ❌ They assign you one
Message logs ✅ Yours, in MongoDB ❌ On their servers
Webhooks ✅ Any URL, GET or POST Varies
Open source ✅ Full source on GitHub ❌ Closed
Data privacy ✅ Your server ❌ Third-party servers

At 1,000 messages a month on a typical paid API, you're spending $5–80/month just for the privilege of using your own WhatsApp number. WPSent costs nothing.


Self-Hosting WPSent

Want complete control? Host your own instance in 3 steps.

Option 1 — Railway (easiest, ~$5/month)

  1. Fork the repo on GitHub
  2. Go to railway.app → New Project → Deploy from GitHub
  3. Add environment variable: MONGO_URI = your MongoDB Atlas connection string
  4. Deploy

Railway reads the included nixpacks.toml and installs everything automatically — Node.js, Chromium, all dependencies. No manual setup.

Option 2 — Your own server (~$4/month)

# On a fresh Ubuntu VPS
git clone https://github.com/wpsent/wpsent
cd wpsent
cp .env.example .env
# Edit .env → add your MongoDB URI
sudo apt-get install -y chromium-browser
npm install
npm start
Enter fullscreen mode Exit fullscreen mode

Visit http://YOUR_SERVER_IP:3000 and you're live.

Option 3 — Local machine (free)

Same as above but on your own computer. Perfect for personal automation, home servers, or Raspberry Pi.


Use Cases

People are using WPSent for:

  • 🛒 Order notifications — send customers a WhatsApp message when their order ships
  • 🤖 Chatbots — receive messages via webhook, process them, reply via API
  • 📢 Broadcast messages — send updates to a list of contacts from a script
  • 🔔 Alerts — get notified on WhatsApp when your server goes down, a form is submitted, or a payment is received
  • 📅 Reminders — scheduled messages via a cron job + the API
  • 🏠 Home automation — trigger WhatsApp messages from Home Assistant or Node-RED

Get Started

Hosted version: wpsent.xyz — free, no sign-up, just scan and go

Self-host: github.com/wpsent/wpsent — full source, GPL3 license

Questions? Open an issue on GitHub or reach out on wpsent.xyz.


Tags: whatsapp, api, opensource, selfhosted, automation, nodejs, webhook, free, tutorial, devtools

Top comments (0)