Everything you need to integrate WhatsApp messaging into your application. Simple REST endpoints, multiple SDKs, and copy-paste examples.
The Onyx WhatsApp API lets you send and receive WhatsApp messages programmatically using a simple HTTP REST interface. You can send text, images, PDFs, documents and more — to individuals or groups — from any programming language or platform.
The API uses an unofficial WhatsApp connection tied to your own WhatsApp number via a QR scan. Your messages are delivered directly from your number.
Base URL for all API requests: https://onyxberry.com/services/wapi/Api2
Important: This is an unofficial WhatsApp solution. Sending unsolicited bulk messages can risk your number being blocked. Always use random delays between messages, target genuine contacts, and read our Terms and WhatsApp's Terms of Service. We are not responsible for any bans or service interruptions.
Before making any API calls, you need to connect your WhatsApp number to our cloud service.
Every API request requires your Client ID and API Key, passed as URL path segments. You can find these in the API tab of your dashboard after login.
https://onyxberry.com/services/wapi/Api2/{method}/{YOUR_CLIENT_ID}/{YOUR_API_KEY}
Replace {YOUR_CLIENT_ID} and {YOUR_API_KEY} with the values from your dashboard API tab. In the SDK examples below, these are shown as YOUR_USER_ID and YOUR_API_KEY — they are the same credentials.
Send a plain text message to any WhatsApp number. The number must include the country code with + prefix.
| Parameter | Type | Required | Description |
|---|---|---|---|
number | string | Required | Recipient's WhatsApp number with country code, e.g. +971566599829 |
message | string | Required | Text content. Supports WhatsApp formatting: *bold*, ~strikethrough~, ```monospace``` |
require_once __DIR__ . '/OnyxWhatsAppClient.php'; $client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); $result = $client->sendText('+971566599829', 'Hello! This is sent via Onyx API 👋'); print_r($result);
curl -X POST \ "https://onyxberry.com/services/wapi/Api2/sendText/YOUR_USER_ID/YOUR_API_KEY" \ -d "number=+971566599829" \ -d "message=Hello from Onyx API!"
const { OnyxWhatsAppClient } = require('./index'); const client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); client.sendText('+971566599829', 'Hello! 👋') .then(res => console.log(res));
from onyx_whatsapp_sdk import OnyxWhatsAppClient client = OnyxWhatsAppClient("YOUR_USER_ID", "YOUR_API_KEY") result = client.send_text('+971566599829', 'Hello! 👋') print(result)
{ "status": 200, "message": "WhatsApp chat has been queued for sending!", "data": false, "saved_message_id": 8821, "message_status": "pending", "message_status_code": 0 }Save saved_message_id from the response. Use Get Message Status to track delivery. Per-recipient ordering: if you send multiple messages to the same number, the platform automatically waits until the previous message is delivery-confirmed (ACK) before sending the next one to that recipient — so split messages stay in order even when ACKs arrive late.
{ "status": 400, "message": "Invalid phone number!" }
{ "status": "error", "response": "Invalid Credentials" }
{ "status": 500, "error": "WhatsApp account doesn't exist!" }Queue up to 100 messages in a single API call. Each message is delivered asynchronously through the same queue as single messages — your configured random delay (set in Dashboard → Random Delay Settings) is applied between every send to keep your WhatsApp account safe.
| Field | Type | Required | Description |
|---|---|---|---|
messages | array | Required | Array of message objects. Each must have number and message. Max 100 items. |
messages[].number | string | Required | Phone number with country code and + prefix (e.g. +971566599829). The + is stripped automatically server-side. |
messages[].message | string | Required | Message text. Max 4096 characters. |
require_once __DIR__ . '/OnyxWhatsAppClient.php'; $client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); $response = $client->sendBulk([ ['number' => '+971566599829', 'message' => 'Hi Ahmed! Your invoice #1001 is ready.'], ['number' => '+971501234567', 'message' => 'Hi Sara! Your order has been shipped.'], ['number' => '+971509876543', 'message' => 'Hi Khalid! Your appointment is confirmed.'], ]); echo "Queued: " . $response['queued'] . " messages\n"; echo "Batch ID: " . $response['batch_id'] . "\n";
curl -X POST \ "https://onyxberry.com/services/wapi/Api2/sendBulk/YOUR_USER_ID/YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "number": "+971566599829", "message": "Hi Ahmed! Your invoice #1001 is ready." }, { "number": "+971501234567", "message": "Hi Sara! Your order has been shipped." }, { "number": "+971509876543", "message": "Hi Khalid! Your appointment is confirmed." } ] }'
from onyx_whatsapp_sdk import OnyxWhatsAppClient client = OnyxWhatsAppClient("YOUR_USER_ID", "YOUR_API_KEY") messages = [ {"number": "+971566599829", "message": "Hi Ahmed! Your invoice #1001 is ready."}, {"number": "+971501234567", "message": "Hi Sara! Your order has been shipped."}, {"number": "+971509876543", "message": "Hi Khalid! Your appointment is confirmed."}, ] data = client.send_bulk(messages) print(f"Queued: {data['queued']} messages") print(f"Batch ID: {data['batch_id']}")
const { OnyxWhatsAppClient } = require('./index'); const client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); const messages = [ { number: '+971566599829', message: 'Hi Ahmed! Your invoice #1001 is ready.' }, { number: '+971501234567', message: 'Hi Sara! Your order has been shipped.' }, { number: '+971509876543', message: 'Hi Khalid! Your appointment is confirmed.' }, ]; client.sendBulk(messages).then(res => { console.log(`Queued: ${res.queued}`); console.log(`Batch: ${res.batch_id}`); });
{
"status": "success",
"response": "3 message(s) queued successfully.",
"batch_id": "a3f2c1d0-4e5b-4f6a-8b9c-0d1e2f3a4b5c",
"queued": 3,
"queued_messages": [
{ "recipient": "971566599829", "saved_message_id": 8821, "message_status": "pending", "message_status_code": 0 }
],
"skipped": [],
"credits_remaining": 4997,
"estimated_completion": {
"min_seconds": 15,
"max_seconds": 45,
"note": "Actual delivery time depends on your configured message delay (5–15s). Adjust in Dashboard → Settings."
},
"warning": "IMPORTANT: Sending bulk messages carries a risk of WhatsApp account suspension...",
"anti_ban_notice": {
"delay_applied": "A random 5–15s delay is enforced between each message by the delivery engine.",
"duplicate_filtering": "Duplicate phone numbers within this batch were automatically removed.",
"queue_based": "Messages are delivered asynchronously — your account is never flooded.",
"recommendation": "For large campaigns (200+ contacts), split into daily batches.",
"onyxberry_liability": "OnyxBerry is not responsible for WhatsApp account bans."
}
}| Rule | Limit | Purpose |
|---|---|---|
| Max messages per call | 100 | Prevents memory overload and request timeouts |
| Bulk calls per minute | 5 | Prevents rapid-fire campaign relaunching |
| Inter-message delay | Your delay_from–delay_to setting | Mimics human typing speed to avoid WhatsApp spam detection |
| Duplicate numbers | Auto-removed | Prevents double-messaging same contact |
| Async queue | Max 5,000 queued | Queue returns 429 if full — retry later |
| Message age drop | 6 hours | Stale messages are dropped to avoid delivering outdated content |
Send any media file from a publicly accessible URL. Supports images, PDFs, Word docs, Excel files, videos and more. Maximum file size: 10MB.
| Parameter | Type | Required | Description |
|---|---|---|---|
number | string | Required | Recipient WhatsApp number with country code |
url | string | Required | Direct public URL to the file (e.g. https://example.com/invoice.pdf) |
caption | string | Optional | Text caption to accompany the file |
require_once __DIR__ . '/OnyxWhatsAppClient.php'; $client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); $result = $client->sendFromURL( '+971566599829', 'https://example.com/invoice.pdf', 'Your November Invoice 📄' ); print_r($result);
curl -X POST \ "https://onyxberry.com/services/wapi/Api2/sendFromURL/YOUR_CLIENT_ID/YOUR_API_KEY" \ -d "number=+971566599829" \ -d "url=https://example.com/invoice.pdf" \ -d "caption=Your November Invoice 📄"
const { OnyxWhatsAppClient } = require('./index'); const client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); client.sendFromURL('+971566599829', 'https://example.com/invoice.pdf', 'Your November Invoice 📄') .then(res => console.log(res));
from onyx_whatsapp_sdk import OnyxWhatsAppClient client = OnyxWhatsAppClient("YOUR_USER_ID", "YOUR_API_KEY") result = client.send_from_url( "+971566599829", "https://example.com/invoice.pdf", "Your November Invoice 📄" ) print(result)
{ "status": 200, "message": "WhatsApp chat has been queued for sending!", "data": false, "saved_message_id": 8821, "message_status": "pending", "message_status_code": 0 }Save saved_message_id from the response. Use Get Message Status to track delivery. Per-recipient ordering: if you send multiple messages to the same number, the platform automatically waits until the previous message is delivery-confirmed (ACK) before sending the next one to that recipient — so split messages stay in order even when ACKs arrive late.
Send a text message to a WhatsApp group. Use the group's internal ID (e.g. [email protected]). Get your Group IDs from the dashboard (Messages → My WA Groups) or the Get Groups API endpoint.
| Parameter | Type | Required | Description |
|---|---|---|---|
groupName | string | Required | WhatsApp Group ID (e.g. [email protected]) |
message | string | Required | Text message to send to the group |
require_once __DIR__ . '/OnyxWhatsAppClient.php'; $client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); $result = $client->sendTextInGroup( '[email protected]', 'Hello everyone! Team meeting at 3 PM 👋' ); print_r($result);
curl -X POST \ "https://onyxberry.com/services/wapi/Api2/sendTextInGroup/YOUR_CLIENT_ID/YOUR_API_KEY" \ -d "[email protected]" \ -d "message=Hello everyone! Team meeting at 3 PM 👋"
const { OnyxWhatsAppClient } = require('./index'); const client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); client.sendTextInGroup('[email protected]', 'Hello everyone! Team meeting at 3 PM 👋') .then(res => console.log(res));
from onyx_whatsapp_sdk import OnyxWhatsAppClient client = OnyxWhatsAppClient("YOUR_USER_ID", "YOUR_API_KEY") result = client.send_text_in_group( "[email protected]", "Hello everyone! Team meeting at 3 PM 👋" ) print(result)
Send a PDF, image, or document to a WhatsApp group from a publicly accessible URL. Maximum file size: 10MB.
| Parameter | Type | Required | Description |
|---|---|---|---|
groupName | string | Required | WhatsApp Group ID |
url | string | Required | Public URL of the file to send |
caption | string | Optional | Caption for the file |
require_once __DIR__ . '/OnyxWhatsAppClient.php'; $client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); $result = $client->sendFromURLInGroup( '[email protected]', 'https://example.com/report.pdf', 'Monthly report attached 📄' ); print_r($result);
curl -X POST \ "https://onyxberry.com/services/wapi/Api2/sendFromURLInGroup/YOUR_CLIENT_ID/YOUR_API_KEY" \ -d "[email protected]" \ -d "url=https://example.com/report.pdf" \ -d "caption=Monthly report attached 📄"
const { OnyxWhatsAppClient } = require('./index'); const client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); client.sendFromURLInGroup('[email protected]', 'https://example.com/report.pdf', 'Monthly report attached 📄') .then(res => console.log(res));
from onyx_whatsapp_sdk import OnyxWhatsAppClient client = OnyxWhatsAppClient("YOUR_USER_ID", "YOUR_API_KEY") result = client.send_from_url_in_group( "[email protected]", "https://example.com/report.pdf", "Monthly report attached 📄" ) print(result)
Verify whether a phone number is registered on WhatsApp before sending messages to it.
| Parameter | Type | Required | Description |
|---|---|---|---|
number | string | Required | Phone number with country code to check |
require_once __DIR__ . '/OnyxWhatsAppClient.php'; $client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); $result = $client->isRegisteredUser('+971566599829'); print_r($result);
curl -X POST \ "https://onyxberry.com/services/wapi/Api2/isRegisteredUser/YOUR_CLIENT_ID/YOUR_API_KEY" \ -d "number=+971566599829"
const { OnyxWhatsAppClient } = require('./index'); const client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); client.isRegisteredUser('+971566599829') .then(res => console.log(res));
from onyx_whatsapp_sdk import OnyxWhatsAppClient client = OnyxWhatsAppClient("YOUR_USER_ID", "YOUR_API_KEY") result = client.is_registered_user("+971566599829") print(result)
truefalseLook up the delivery status of a message you previously sent using the saved_message_id returned from any send endpoint. You can only query messages belonging to your own account — attempting to read another user's message ID returns 404.
Automatic per-recipient ordering: When you send several messages to the same WhatsApp number, Onyx holds each subsequent message until the previous one to that recipient is delivery-confirmed. You can still fire API calls back-to-back — extra messages are queued (status pending) and released automatically when the ACK arrives. Messages to different recipients are not blocked by each other.
https://onyxberry.com/services/wapi/Api2/getMessageStatus?user_id=...&api_key=...&id=8821
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Your Client ID |
api_key | string | Yes | Your API Key |
id | integer | Yes | Message ID from saved_message_id (aliases: message_id, saved_message_id) |
{
"status": 200,
"message": "Message status",
"data": {
"id": 8821,
"recipient": "+971566599829",
"message": "Your order has shipped!",
"message_type": null,
"message_status": "delivered",
"message_status_code": 1,
"created_at": "2026-07-18 08:30:00",
"updated_at": "2026-07-18 08:30:12",
"retry_count": 0,
"fail_reason": null
}
}
Retrieve incoming WhatsApp messages received on your connected number — paginated, newest first. Use this to build chatbots, support inboxes, or trigger your own backend workflows.
You can also view received chats directly from the Bot & Actions page in your dashboard — no API call needed. Auto-reply rules are configured there too.
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Your API User ID |
api_key | string | Yes | Your API Key |
page | integer | No | Page number (default: 1) |
limit | integer | No | Results per page (default: 20, max: 50) |
$url = "https://onyxberry.com/services/wapi/Api2/getReceivedChats?user_id=YOUR_USER_ID&api_key=YOUR_API_KEY&page=1&limit=20"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true); foreach ($data['data'] as $chat) { echo $chat['account'] . ' said: ' . $chat['message'] . PHP_EOL; }
curl -X GET "https://onyxberry.com/services/wapi/Api2/getReceivedChats?user_id=YOUR_USER_ID&api_key=YOUR_API_KEY&page=1&limit=20"
import requests r = requests.get('https://onyxberry.com/services/wapi/Api2/getReceivedChats', params={ 'user_id': 'YOUR_USER_ID', 'api_key': 'YOUR_API_KEY', 'page': 1, 'limit': 20, }) for chat in r.json()['data']: print(chat['account'], 'said:', chat['message'])
const axios = require('axios'); axios.get('https://onyxberry.com/services/wapi/Api2/getReceivedChats', { params: { user_id: 'YOUR_USER_ID', api_key: 'YOUR_API_KEY', page: 1, limit: 20 } }).then(res => { res.data.data.forEach(c => console.log(c.account, 'said:', c.message)); });
{
"status": 200,
"message": "Received WhatsApp Chats",
"data": [
{
"id": 301,
"account": "+447380294906",
"recipient": "+639760713666",
"message": "Hello, I need help!",
"attachment": null,
"created": 1711234567
}
]
}| Field | Description |
|---|---|
account | The sender's WhatsApp number (who sent the message to you) |
recipient | Your connected WhatsApp number that received the message |
message | The text content of the received message |
attachment | URL of any media attachment, or null |
created | Unix timestamp of when the message was received |
Use our ready-made libraries to integrate in minutes — no need to write raw HTTP code. All endpoint examples above use these official SDKs.
Note: Older docs mentioned WhatsappAPI.php — that legacy class is no longer provided. Use OnyxWhatsAppClient.php from the PHP SDK v3 ZIP below.
OnyxWhatsAppClient.php in your project (same folder as your script is easiest).require_once __DIR__ . '/OnyxWhatsAppClient.php'; $client = new OnyxWhatsAppClient('YOUR_USER_ID', 'YOUR_API_KEY'); // Validate credentials print_r($client->validateCredentials()); // Send text print_r($client->sendText('+971500000000', 'Hello from Onyx SDK v3')); // Send media from URL print_r($client->sendFromURL('+971500000000', 'https://example.com/invoice.pdf', 'Invoice')); // Send bulk (up to 100) print_r($client->sendBulk([ ['number' => '+971500000001', 'message' => 'Hi A'], ['number' => '+971500000002', 'message' => 'Hi B'], ])); // Groups & received chats print_r($client->getGroups()); print_r($client->getReceivedChats(1, 20));
Watch these walkthroughs to get started quickly with the Onyx WhatsApp API.
| Code | Meaning | Response |
|---|---|---|
| 200 | Success | Message queued for sending |
| 400 | Bad Request | Invalid phone number or missing parameters |
| 401 | Unauthorized | Invalid Client ID or API Key |
| 402 | Insufficient Credits | Account has no remaining message credits |
| 500 | Server Error | WhatsApp not connected or server error |
Returns a list of all WhatsApp groups your connected number is a member of, including the Group ID (gid) you need to send group messages via the API.
Dashboard shortcut: You no longer need to contact support to get your Group IDs. While your WhatsApp is connected, go to Messages in your dashboard and click "My WA Groups" in the left sidebar. You can search, view all groups, and copy any Group ID with one click.
https://onyxberry.com/services/wapi/Api2/getGroups?user_id=...&api_key=...
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Your API User ID (found in dashboard → Account Information) |
api_key | string | Yes | Your API Key |
<?php
$user_id = 'YOUR_USER_ID';
$api_key = 'YOUR_API_KEY';
$url = "https://onyxberry.com/services/wapi/Api2/getGroups?user_id=$user_id&api_key=$api_key";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($http_code === 200) {
$data = json_decode($response, true);
foreach ($data['data'] as $group) {
echo $group['name'] . ' → ' . $group['gid'] . PHP_EOL;
}
}
curl -X GET "https://onyxberry.com/services/wapi/Api2/getGroups?user_id=YOUR_USER_ID&api_key=YOUR_API_KEY"
import requests
params = {
'user_id': 'YOUR_USER_ID',
'api_key': 'YOUR_API_KEY',
}
r = requests.get('https://onyxberry.com/services/wapi/Api2/getGroups', params=params)
if r.status_code == 200:
for group in r.json()['data']:
print(group['name'], '→', group['gid'])
const axios = require('axios');
axios.get('https://onyxberry.com/services/wapi/Api2/getGroups', {
params: { user_id: 'YOUR_USER_ID', api_key: 'YOUR_API_KEY' }
}).then(res => {
res.data.data.forEach(g => console.log(g.name, '->', g.gid));
});
{
"status": 200,
"message": "WhatsApp Groups",
"data": [
{ "gid": "[email protected]", "name": "My Test Group" },
{ "gid": "[email protected]", "name": "Family Group" },
{ "gid": "[email protected]", "name": "Support Team" }
]
}
Copy the gid value and pass it as the recipient in the Group Text or Group Media endpoints:
{
"user_id": "YOUR_USER_ID",
"api_key": "YOUR_API_KEY",
"send_to": "[email protected]", // ← paste gid here
"body": "Hello everyone! 👋"
}
@g.us suffix) are stable — they don't change unless the group is deleted and recreated.The Account Management API lets approved accounts fully manage their WhatsApp session, QR code, message quota, and outbound message history from their own CRM — without using the Onyx dashboard.
Available on request. This feature is disabled by default. Contact support to have CRM API enabled on your account. Once enabled, use the same Client ID and API Key as the standard messaging API.
Base URL for Account Management endpoints: https://onyxberry.com/services/wapi/AccountApi
These endpoints are separate from Api2 and do not change any existing messaging API behaviour. If the feature is not enabled, all Account Management calls return HTTP 403.
startSession to launch the WhatsApp cloud client.getQr and getStatus until connected: true.Api2/sendText and other messaging endpoints.getQuota and getMessages from your CRM dashboard.Returns the current WhatsApp connection state for your account — whether the session is connected, running, waiting for QR scan, or disconnected.
https://onyxberry.com/services/wapi/AccountApi/getStatus/client_id/api_key
{
"status": 200,
"message": "WhatsApp session status",
"data": {
"connected": true,
"session_running": true,
"status_text": "WhatsApp is ready",
"whatsapp_status": "",
"pending_command": null,
"has_qr": false,
"last_activity": "2026-07-18 09:15:00",
"sending_paused": false,
"realtime_only": false,
"package_expiry": "2027-07-18"
}
}
Returns the current QR code image (base64 data URL) when the session is waiting for a scan. Poll this endpoint after calling startSession. When connected is true, the QR field will be empty.
https://onyxberry.com/services/wapi/AccountApi/getQr/client_id/api_key
{
"status": 200,
"message": "QR code ready for scanning.",
"data": {
"connected": false,
"status_text": "Waiting for QR scan...",
"qr_code": "data:image/png;base64,iVBORw0KGgo..."
}
}
Display the qr_code value directly in an <img src="..."> tag in your CRM UI.
Control your WhatsApp cloud session programmatically. All three endpoints use POST and accept credentials in the URL path (same as messaging APIs).
https://onyxberry.com/services/wapi/AccountApi/startSession/client_id/api_key
https://onyxberry.com/services/wapi/AccountApi/stopSession/client_id/api_key
https://onyxberry.com/services/wapi/AccountApi/resetSession/client_id/api_key
Returns your plan allowance, consumed count, remaining credits, and package expiry date — useful for displaying usage in your CRM.
https://onyxberry.com/services/wapi/AccountApi/getQuota/client_id/api_key
{
"status": 200,
"message": "Message quota usage",
"data": {
"plan_name": "Pro Plan",
"account_enabled": true,
"total_allowed": 5000,
"total_consumed": 1247,
"remaining": 3753,
"package_expiry": "2027-07-18",
"usage_percent": 24.94
}
}
Returns paginated outbound messages sent via the API for your account. Use this to sync delivery status into your CRM.
https://onyxberry.com/services/wapi/AccountApi/getMessages?user_id=...&api_key=...&page=1&limit=20&filter=all
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Your Client ID |
api_key | string | Yes | Your API Key |
page | integer | No | Page number (default: 1) |
limit | integer | No | Results per page (default: 20, max: 50) |
filter | string | No | all, pending, delivered, failed, disabled, invalid, unconfirmed |
{
"status": 200,
"message": "Outbound messages",
"data": {
"page": 1,
"limit": 20,
"total": 142,
"total_pages": 8,
"filter": "all",
"messages": [
{
"id": 8821,
"recipient": "+971566599829",
"message": "Your order has shipped!",
"status": "delivered",
"status_code": 1,
"created_at": "2026-07-18 08:30:00",
"updated_at": "2026-07-18 08:30:12",
"retry_count": 0,
"fail_reason": null
}
]
}
}
The Auto-Reply Bot lets you automatically respond to incoming WhatsApp messages based on keyword rules. When a message matches your configured keywords, the bot instantly sends a reply — with text, image, or document — without any code on your side.
This feature requires the Auto-Reply Bot Add-on and an active connected WhatsApp session. Configure your rules from Dashboard → Auto-Reply Bot.
| Match Type | Description | Example |
|---|---|---|
Contains | Message contains the keyword anywhere | keyword: hello → matches "hello there" |
Exact (Case Insensitive) | Full message equals keyword, any case | keyword: hi → matches "HI" or "hi" |
Exact (Case Sensitive) | Full message must match exactly | keyword: Hi → only matches "Hi" |
Regex | Message matches a regular expression | pattern: order\s*#\d+ |
None (Always Reply) | Replies to every incoming message | — |
You can use these shortcodes inside your reply message text — they are replaced with live values at the time of sending:
| Shortcode | Replaced With |
|---|---|
{{phone}} | Sender's phone number |
{{message}} | The original message text that triggered the reply |
{{date.now}} | Current date (e.g. 2026-03-04) |
{{date.time}} | Current time (e.g. 14:32:10) |
Auto-replies only fire when your WhatsApp is connected and live. If your session disconnects, rules will stop working until you reconnect from the Cloud page.
Webhooks let Onyx WhatsApp API push real-time events to your own server using HTTP POST requests with a JSON body. Use them to sync messages with your CRM, trigger automations, update order status, or log activity — without polling the API.
Webhooks are available on request. Contact support to have the feature enabled on your account, then configure your URLs from Dashboard → Webhooks. You can set one URL for sent messages and one for received messages, and view delivery logs in the same page.
| Event | When It Fires | Dashboard URL Field |
|---|---|---|
message.received |
When a new incoming WhatsApp message is captured on your connected number (Receiving must be ON) | Receive webhook URL |
message.sent |
When an outbound message is confirmed delivered by WhatsApp — not when it is merely queued or sent to the server | Send webhook URL |
All webhook calls use HTTP POST with Content-Type: application/json, User-Agent: Onyx-WAPI-Webhook/1.0, and X-Onyx-User-Id (your account ID). Your endpoint should accept POST only, verify the user ID matches your account, and respond with HTTP 2xx as quickly as possible.
{
"event": "message.received",
"user_id": 123,
"timestamp": 1710000000,
"message": {
"from": "971566599829",
"to": "971501234567",
"chat_id": "[email protected]",
"body": "Hello, I need help with my order",
"has_media": false,
"message_id": "3EB0...",
"timestamp": 1710000000
}
}
{
"event": "message.sent",
"user_id": 123,
"timestamp": 1710000000,
"delivery": {
"ack": 2,
"confirmed": true
},
"message": {
"saved_message_id": "456",
"recipient": "971566599829",
"message": "Your order has shipped!",
"media_url": null,
"command": "sendText",
"whatsapp_message_id": "3EB0..."
}
}
The delivery.ack value reflects WhatsApp's delivery status. A send webhook fires only when delivery is confirmed (typically ack ≥ 2, meaning delivered to the recipient's device).
Your endpoint reads the raw JSON body from the POST request. Process quickly and return HTTP 200 — offload heavy work to a background queue if needed.
// webhook.php — must accept POST only if ($_SERVER['REQUEST_METHOD'] !== 'POST') { http_response_code(405); exit('Method not allowed'); } $raw = file_get_contents('php://input'); $data = json_decode($raw, true); $expectedUserId = 123; // your Onyx user ID from the dashboard if ((int) ($_SERVER['HTTP_X_ONYX_USER_ID'] ?? 0) !== $expectedUserId || (int) ($data['user_id'] ?? 0) !== $expectedUserId) { http_response_code(403); exit('Forbidden'); } if (!is_array($data) || empty($data['event'])) { http_response_code(400); exit('Invalid payload'); } switch ($data['event']) { case 'message.received': // e.g. create a support ticket from $data['message']['from'] and body break; case 'message.sent': // e.g. mark order as delivered in your CRM break; } http_response_code(200); echo 'OK';
app.post('/webhook/receive', express.json(), (req, res) => { const { event, message } = req.body; if (event === 'message.received') { console.log('New message from', message.from, ':', message.body); } res.sendStatus(200); });
After webhooks are enabled, open Dashboard → Webhooks to:
| Topic | Details |
|---|---|
| Receive webhooks | Require Receiving ON (same as the Received Chats / Auto-Reply inbox capture). |
| Send webhooks | Fire only after WhatsApp confirms delivery — not when the message is first queued. |
| URL limits | One send URL and one receive URL per account is allowed. |
| HTTPS recommended | Use https:// endpoints in production. Both http:// and https:// are accepted. |
| Idempotency | Your handler may receive the same logical event more than once on retries — design for safe re-processing. |
Your endpoint must respond with HTTP 2xx within a few seconds. Slow or failing endpoints are logged in your dashboard but will not block WhatsApp messaging. For long-running tasks, acknowledge with 200 immediately and process in a background job or queue.
WhatsApp uses a combination of AI-based pattern detection, user reports, and device/account signals to identify abusive senders. The key signals they watch for:
Use this as a daily volume guide. These are conservative estimates — actual tolerance varies by account age, history, and recipient behaviour.
Your random delay (set in Dashboard → Settings) is applied between every message by the delivery engine. This is the single most important protection against WhatsApp bans.
First — OnyxBerry is not responsible for WhatsApp account bans (see Terms & Conditions). However, here's what you can try:
Onyx API includes several automatic safeguards — but they are not a substitute for responsible usage:
Create your free account and get your API keys in under a minute.