💬 SalesByte

Messages

Send WhatsApp messages via the API.

Send a message

POST /api/v1/messages

Send a text, image, video, or document to any WhatsApp number or group.

Request body

{
  "to": "+919876543210",
  "text": "Hello! This is a test message."
}

Parameters

FieldTypeRequiredDescription
tostringPhone number with country code, or a group JID
textstring✅ (unless sending media)The message text
imageUrlstringPublic URL of an image to send
videoUrlstringPublic URL of a video to send
documentUrlstringPublic URL of a document to send
fileNamestring❌ (required with documentUrl)File name shown to recipient

Response

{
  "success": true,
  "message_id": "3EB0A1B2C3D4E5"
}

Examples

Send a text message:

curl -X POST https://app.salesbyte.in/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "text": "Hi Rahul, your order is ready for pickup!"
  }'

Send an image:

curl -X POST https://app.salesbyte.in/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "imageUrl": "https://example.com/invoice.jpg",
    "text": "Here is your invoice."
  }'

Send to a group:

curl -X POST https://app.salesbyte.in/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "120363XXXXXXXXX@g.us",
    "text": "Team meeting at 3 PM today."
  }'

JavaScript example

const response = await fetch('https://app.salesbyte.in/api/v1/messages', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    to: '+919876543210',
    text: 'Hello from the API!',
  }),
});
 
const data = await response.json();
console.log(data.message_id);

On this page