Enterprise WhatsApp Automation Platform
API Documentation

Build Powerful Messaging Applications

A single REST endpoint for sending WhatsApp messages, media, documents, scheduled and bulk/personalized campaigns — fast, reliable and secure, in whichever language your stack already uses.

Live Environment API Key Authentication REST / HTTP (GET & POST) PHP · Node.js · Python · Java · C# · VB.NET
Base URL https://wahgreat.com/api/

Introduction

This documentation explains how to integrate wahgreat.com messaging services into your application over a simple HTTP API. The API is based on REST standards, so any HTTP client in any programming language can call it — PHP, JavaScript, Python, C#, VB.NET, Java, Node.js and more.

A single endpoint handles text, image and document messages, and supports single requests, personalized bulk requests, and scheduled delivery.

Authentication

Every request must include your api_key as a GET or POST parameter — there is no separate Authorization header. Get your credentials in three steps:

1. Create an accountRegister, then log in to the customer portal.
2. Get your API keyCopy your api_key from the dashboard.
3. Scan the QR codeConnect your WhatsApp number to your instance.
Keep your api_key secret — anyone with it can send messages from your connected WhatsApp number.

Base URL

This platform is multi-tenant: your Base URL is always your own account domain, shown below. Every example on this page uses it automatically.

Your Base URL https://wahgreat.com/api/
POST GET

/api/send.php

Send a plain text WhatsApp message. This is the default message type (type=0).

ParameterTypeRequiredDescription
api_keystringYesYour API key
mobilestringYesRecipient in international format, e.g. 923001234567
messagestringYesThe text message body

Example Request

curl --location --request POST 'https://wahgreat.com/api/send.php' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'api_key=YOUR-SECRET-API-KEY' \
--data-urlencode 'mobile=923XXXX' \
--data-urlencode 'message=HelloWorld'
<?php

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://wahgreat.com/api/send.php',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'api_key=YOUR-SECRET-API-KEY&mobile=923XXX&message=HelloWorld',
  CURLOPT_HTTPHEADER => array('Content-Type: application/x-www-form-urlencoded'),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
  'api_key': 'YOUR-SECRET-API-KEY',
  'mobile': '923XXXX',
  'message': 'HelloWorld'
});

axios({
  method: 'post',
  url: 'https://wahgreat.com/api/send.php',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  data: data
}).then(function (response) {
  console.log(response.data);
});
import http.client

conn = http.client.HTTPSConnection("wahgreat.com")
payload = 'api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&message=HelloWorld'
headers = { 'Content-Type': 'application/x-www-form-urlencoded' }
conn.request("POST", "/api/send.php", payload, headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))

Example Response

{
  "success": "true",
  "type": "API",
  "totalprice": "1",
  "totalgsm": "1",
  "remaincredit": "998",
  "results": [ { "status": "1" } ]
}
{
  "success": "false",
  "results": [
    { "error": "Invalid API KEY!" }
  ]
}
POST GET

Send Images

Set type=1 to send an image, either from a live URL or an uploaded file. Supported extensions: jpg, jpeg, gif, png, svg, webp, bmp. Max file size 3 MB.

Use url for a hosted image link, or file to upload directly from your system (e.g. file=C:/Users/Downloads/sample.jpg).
GET https://wahgreat.com/api/send.php?api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&type=1
    &url=https://sample-videos.com/img/Sample-jpg-image-50kb.jpg
    &caption=ImageCaption&priority=0
Try the live sample linkOpens the send-image request in a new tab
POST GET

Send Documents

Set type=2 to send a document. Most extensions are supported (zip, xlsx, csv, pptx, docx and more). Max file size 3 MB, via url or a direct file upload.

GET https://wahgreat.com/api/send.php?api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&type=2
    &url=https://www.africau.edu/images/default/sample.pdf&priority=0
Try the live sample linkOpens the send-document request in a new tab

Message Priority

The optional priority parameter creates a professional queue for your messages — lower values are sent first. Default value: 10.

ValueUse case
priority = 0High priority, e.g. OTP messages
priority = 10General messages (default)
priority = 20Non-urgent notifications to your customers
priority = 30Non-urgent promotional offers to your customers
priority = 40Lower urgency — queued with a 40 second delay
priority = 60Lower urgency — queued with a 60 second delay
priority = 120Bulk / low urgency — queued with a 2 minute delay
priority = 180Bulk / low urgency — queued with a 3 minute delay
priority = 240Bulk / low urgency — queued with a 4 minute delay
priority = 300Lowest urgency — queued with a 5 minute delay

Scheduled Messages

Set schedule=1 and provide schedule_time to deliver a message at a future date/time.

GET https://wahgreat.com/api/send.php?api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&message=HelloWorld
    &schedule=1&schedule_time=2026-07-19 03:47:35&priority=0
Try the live sample linkOpens the scheduled-message request in a new tab

Bulk / Personalized Messages

Set personalized=1 and pass a JSON array to message to send customized text to many recipients in a single request — each message body can be different.

GET https://wahgreat.com/api/send.php?api_key=YOUR-SECRET-API-KEY&personalized=1&priority=0
    &message=[{"mobile":923101234567,"message":"Hello Ahmad Shahzad"},
              {"mobile":923011234567,"message":"Hello Ali Ahmad"},
              {"mobile":923331234567,"message":"Hello Mustafa Kamal"}]
Personalized requests support text and image messages only — documents are not supported in this mode.

Full Parameter Reference

Complete list of parameters accepted by /api/send.php.

ParameterRequiredDescription
api_key*YesYour API key
mobile*YesPhone with international format, e.g. 923001234567
message*YesText message body (or a JSON array when personalized=1)
priorityNoQueue priority — see Message Priority. Default 10.
typeNo0 = Text (default), 1 = Image, 2 = Document
urlNoLive HTTP link to the image/document (when type=1 or 2)
fileNoDirect file upload instead of url, e.g. file=C:/Users/Downloads/sample.jpg
scheduleNoSet to 1 along with schedule_time — see Scheduled Messages
personalizedNoSet to 1 for bulk/customized sends — see Bulk / Personalized

Response Format

Every request returns a JSON object with a success flag and a results array.

{
  "success": "true",       // "true" or "false"
  "type": "API",
  "totalprice": "1",       // messages billed
  "totalgsm": "1",         // recipients processed
  "remaincredit": "998",   // credit remaining after this request
  "results": [ ... ]
}

Error Handling

When a request fails, success is "false" and results contains an object with an error message describing what went wrong.

Example messageTypical cause
Invalid API KEY!The api_key is missing, incorrect, or has been reset
Empty! Please Type Recipient Mobile Number!The mobile parameter was not sent
Empty! Please Type Your Message!The message parameter was not sent
Always check the success field before assuming a message was queued — see Parameters for valid value ranges.

Postman Collection

Import our ready-made collection to explore every request without writing code.

Open Postman Collectionhttps://documenter.getpostman.com/view/9576087/2s9Ykraevk

Code Samples

Full working examples for sending a basic text message in every supported language.

<?php

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://wahgreat.com/api/send.php',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'api_key=YOUR-SECRET-API-KEY&mobile=923XXX&message=HelloWorld',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
  'api_key': 'YOUR-SECRET-API-KEY',
  'mobile': '923XXXX',
  'message': 'HelloWorld'
});
var config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://wahgreat.com/api/send.php',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
var settings = {
  "url": "https://wahgreat.com/api/send.php",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  "data": {
    "api_key": "YOUR-SECRET-API-KEY",
    "mobile": "923XXXX",
    "message": "HelloWorld"
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
import http.client

conn = http.client.HTTPSConnection("wahgreat.com")
payload = 'api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&message=HelloWorld'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/api/send.php", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location --request POST 'https://wahgreat.com/api/send.php' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'api_key=YOUR-SECRET-API-KEY' \
--data-urlencode 'mobile=923XXXX' \
--data-urlencode 'message=HelloWorld'
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&message=HelloWorld");
Request request = new Request.Builder()
  .url("https://wahgreat.com/api/send.php")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();
Imports System.Net
Imports System.Text

Module example
Sub Main()
Dim WebRequest As HttpWebRequest
WebRequest = HttpWebRequest.Create("https://wahgreat.com/api/send.php")
Dim postdata As String = "api_key={TOKEN}&mobile=&body=HelloWorld"
Dim enc As UTF8Encoding = New System.Text.UTF8Encoding()
Dim postdatabytes As Byte() = enc.GetBytes(postdata)
WebRequest.Method = "POST"
WebRequest.ContentType = "application/x-www-form-urlencoded"
WebRequest.GetRequestStream().Write(postdatabytes, 0, postdatabytes.Length)
Dim ret As New System.IO.StreamReader(WebRequest.GetResponse().GetResponseStream())
Console.WriteLine(ret.ReadToEnd())
End Sub
End Module
var options = new RestClientOptions("https://wahgreat.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/send.php", Method.Post);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("api_key", "YOUR-SECRET-API-KEY");
request.AddParameter("mobile", "923XXXX");
request.AddParameter("message", "HelloWorld");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);

Support

Need help integrating? We're here.

Chat with us on WhatsAppSales & support:
Frequently Asked QuestionsCommon questions about the platform