Send WhatsApp messages from your own number with simple HTTP requests. No SDK required — works from browser, cURL, PHP, Python, Node.js, Google Sheets, and more.
Successful response:
All API requests are made to your MessageAPI instance:
Paths in this document are relative to the base URL above.
Every API request requires your API key. Pass it in one of two ways:
| Method | Example |
|---|---|
| Query parameter | ?apikey=msg_your_key_here |
| HTTP header | X-API-Key: msg_your_key_here |
Tip: prefer the X-API-Key header over query params to keep your key out of logs and browser history.
Before calling the API, ensure the following:
Two interfaces are available: a simple GET API at /send.php and a JSON REST API under /api/v1/. Authentication is the same for both.
| Method | Path | Description |
|---|---|---|
GET | /send.php | Send text, image or PDF via query parameters |
POST | /api/v1/send | Send a text message (JSON body) |
POST | /api/v1/send/image | Send an image from a public URL |
POST | /api/v1/send/document | Send a PDF from a public URL |
GET | /api/v1/status | WhatsApp connection status and daily usage |
GET | /api/v1/messages/:id | Check delivery status of a sent message |
Every endpoint returns JSON. Successful operations use HTTP 200. Client and server errors use 4xx codes with a descriptive message.
Every send endpoint returns a messageId. Use it with GET /api/v1/messages/:id to check delivery status.
When a send attempt fails after the message is logged, the error response may include messageId as well.
Example — missing parameter:
/send.php
Send a plain-text WhatsApp message. The simplest integration — a single GET request.
| Parameter | Type | Required | Description |
|---|---|---|---|
recipient | string | Yes | Phone with country code, no + (e.g. 12125551234) or group ID (e.g. 120363...@g.us) |
apikey | string | Yes | Your API key |
text | string | Yes | Message body |
/send.php
Send an image from a direct public URL. Optional caption with the text parameter.
| Parameter | Type | Required | Description |
|---|---|---|---|
recipient | string | Yes | Phone or group ID (120363...@g.us) |
apikey | string | Yes | Your API key |
file | string | Yes | Direct public URL to the image (.jpg, .png, etc.) |
text | string | No | Caption text |
/send.php
Send a PDF document from a direct public URL.
| Parameter | Type | Required | Description |
|---|---|---|---|
recipient | string | Yes | Phone or group ID (120363...@g.us) |
apikey | string | Yes | Your API key |
document | string | Yes | Direct public URL to a PDF file |
filename | string | No | Display name (default: document.pdf) |
/api/v1/status
Check whether WhatsApp is connected and how many messages you have sent in the rolling 24-hour window.
Or pass the API key as a header:
Response example:
| Field | Type | Description |
|---|---|---|
connected | boolean | true if WhatsApp is linked and ready to send |
phone | string | Connected number (country code, no +), or null |
dailyLimit | integer | null | Daily cap for your plan. null on Unlimited |
messagesToday | integer | Messages sent in the last 24 hours |
dailyLimit is null on the Unlimited plan (no cap). Trial: 50/day · Personal: 150/day.
/api/v1/messages/:id
After sending a message, use the returned messageId to check whether it was delivered or failed.
Requires the X-API-Key header. You can only query messages sent by your own account.
Response example:
| Field | Description |
|---|---|
pending | Send in progress |
sent | Delivered to WhatsApp successfully |
failed | Send failed — see error |
Limits apply per account on a rolling 24-hour window. The status endpoint returns your current usage.
Daily message limits depend on your plan:
| Plan | Daily limit |
|---|---|
| Trial | 50 messages |
| Personal | 150 messages |
| Unlimited | No limit |
| HTTP code | Meaning |
|---|---|
400 | Bad request — missing params, WhatsApp not connected, invalid URL |
401 | Invalid or missing API key |
403 | Subscription inactive or expired |
429 | Daily message limit reached |
Personal plan allows up to 5 recipients (no groups). Unlimited supports any recipient and groups.
For integrations that prefer POST requests with JSON bodies and header authentication.
All REST endpoints require the X-API-Key header and Content-Type: application/json.
/api/v1/send
| Parameter | Type | Required | Description |
|---|---|---|---|
recipient | string | Yes | Phone or group ID |
to | string | No | Alias for recipient (REST only) |
text | string | Yes | Message body |
/api/v1/send/image
| Parameter | Type | Required | Description |
|---|---|---|---|
recipient | string | Yes | Phone or group ID |
file | string | Yes | Direct public URL to the image |
image | string | No | Alias for file (REST image endpoint) |
text / caption | string | No | Caption text |
/api/v1/send/document
| Parameter | Type | Required | Description |
|---|---|---|---|
recipient | string | Yes | Phone or group ID |
document | string | Yes | Direct public URL to a PDF file |
filename | string | No | Display name (default: document.pdf) |
Use the same endpoints as for individual chats. Set recipient to the group ID (120363...@g.us) instead of a phone number.
| Parameter | Required | Description |
|---|---|---|
recipient | Yes | Group ID from Settings (e.g. 120363...@g.us) |
apikey | Yes | Your API key |
text | Yes | Message body |
Same parameters as Send image or Send PDF — only change recipient to the group ID.
With the Unlimited plan, MessageAPI can POST events to your server. Configure the webhook URL in Settings.
Download a minimal PHP script that logs each webhook request to a file. Upload it to your server, paste the URL in Settings, and use Test incoming to verify.
All plans can receive an email when WhatsApp disconnects. Enable or disable this in Settings → WhatsApp Connection. Unlimited accounts also receive a session.disconnected webhook event.
| Event | Description |
|---|---|
message.received | Someone sent a text message to your WhatsApp |
message.sent | An outbound message was delivered successfully |
message.failed | An outbound message failed to send |
session.disconnected | WhatsApp disconnected and could not be restored automatically |
Every delivery is a POST with Content-Type: application/json:
For group messages, isGroup is true, groupId is set, and participant is the sender's number.
After each send via the API, MessageAPI can notify your webhook when the message is sent or fails:
The message.id matches the messageId returned by send endpoints and the status query.
reason is logged_out when WhatsApp was unlinked from another device, or connection_lost when the session could not be restored automatically.
message.sent event.Messages are sent from your own WhatsApp number. WhatsApp enforces its own limits and may restrict accounts that send unsolicited or high-volume messages.