Rabt WhatsApp CRM

API Reference

Sending Messages

Send WhatsApp messages programmatically from your app or website using the RabtCRM API.

First, make sure you have a valid API key and an active WhatsApp instance.


Send a Text Message

Request:

POST https://rabtcrm.com/api/v1/messages/send
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Body:

{
  "instanceName": "your-instance-name",
  "to": "201012345678",
  "message": "Hello! This is a message from RabtCRM."
}

Fields:

FieldTypeDescription
instanceNamestringWhatsApp instance name (from the Instances page)
tostringRecipient number in international format, no +
messagestringMessage text

Success Response:

{
  "success": true,
  "messageId": "3EB0C767D360",
  "status": "sent"
}

Send an Image

{
  "instanceName": "your-instance-name",
  "to": "201012345678",
  "type": "image",
  "mediaUrl": "https://example.com/image.jpg",
  "caption": "Check out our new product πŸ“¦"
}

Send a Document (PDF)

{
  "instanceName": "your-instance-name",
  "to": "201012345678",
  "type": "document",
  "mediaUrl": "https://example.com/invoice.pdf",
  "filename": "Invoice.pdf"
}

Send Interactive Buttons

{
  "instanceName": "your-instance-name",
  "to": "201012345678",
  "type": "buttons",
  "message": "How can we help you?",
  "buttons": [
    { "id": "1", "text": "Technical Support" },
    { "id": "2", "text": "Track Order" },
    { "id": "3", "text": "Talk to Agent" }
  ]
}

Sending to Multiple Recipients

For bulk sending, use the Broadcast feature from the platform UI β€” the API is designed for individual sends, not mass messaging.

Warning: Sending large volumes of messages rapidly via API can get your number banned. Use Broadcasts for safe bulk sending.


Tracking Message Status

The response contains a messageId. You can track delivery from the conversation view inside the platform:

StatusMeaning
sentMessage dispatched from the server
deliveredMessage reached the recipient's phone
readRecipient read the message βœ“βœ“
failedSend failed β€” check error details

Code Examples

Node.js

const axios = require('axios');

await axios.post('https://rabtcrm.com/api/v1/messages/send', {
  instanceName: 'my-instance',
  to: '201012345678',
  message: 'Hello from my app!',
}, {
  headers: { Authorization: 'Bearer YOUR_API_KEY' },
});

PHP

$ch = curl_init('https://rabtcrm.com/api/v1/messages/send');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
  'instanceName' => 'my-instance',
  'to'           => '201012345678',
  'message'      => 'Hello from PHP!',
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY',
  'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Next Step

← Connection Issues