API Documentation

Everything you need to send messages via the WA Gateway API

Send Message

POST/api/messages/send
method: sendText

Send Text Message

Request body
# curl example
curl -X POST \
  https://your-domain.com/api/messages/send \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "YOUR_CLIENT_ID",
    "sessionId": "YOUR_SESSION_ID",
    "method": "sendText",
    "to": "919876543210",
    "text": "Hello from WA Gateway! 👋"
  }'
method: sendImage

Send Image

Request body
{
  "clientId": "YOUR_CLIENT_ID",
  "sessionId": "YOUR_SESSION_ID",
  "method": "sendImage",
  "to": "919876543210",
  "imageUrl": "https://example.com/image.jpg",
  "caption": "Check this out!"
}
method: sendDocument

Send Document

Request body
{
  "clientId": "YOUR_CLIENT_ID",
  "sessionId": "YOUR_SESSION_ID",
  "method": "sendDocument",
  "to": "919876543210",
  "docUrl": "https://example.com/invoice.pdf",
  "filename": "invoice_001.pdf"
}
method: sendVideo

Send Video

Request body
{
  "clientId": "YOUR_CLIENT_ID",
  "sessionId": "YOUR_SESSION_ID",
  "method": "sendVideo",
  "to": "919876543210",
  "videoUrl": "https://example.com/clip.mp4",
  "caption": "Watch this!"
}
method: sendAudio

Send Audio

Request body
{
  "clientId": "YOUR_CLIENT_ID",
  "sessionId": "YOUR_SESSION_ID",
  "method": "sendAudio",
  "to": "919876543210",
  "audioUrl": "https://example.com/track.mp3"
}
method: sendVoice

Send Voice Note

Request body
{
  "clientId": "YOUR_CLIENT_ID",
  "sessionId": "YOUR_SESSION_ID",
  "method": "sendVoice",
  "to": "919876543210",
  "audioUrl": "https://example.com/voice-note.ogg"
}

Success Response

200 OK
{
  "success": true,
  "messageId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "sent",
  "timestamp": "2026-06-28T12:00:00.000Z"
}

Request Parameters

ParameterTypeRequiredDescription
clientIdstringRequiredYour unique client identifier
sessionIdstringRequiredThe session (WhatsApp number) to send from
methodstringRequiredsendText | sendImage | sendDocument | sendVideo | sendAudio | sendVoice
tostringRequiredRecipient phone with country code (e.g. 919876543210)
textstringsendTextMessage text content
imageUrlstringsendImagePublic URL of the image
captionstringOptionalCaption for the image or video
docUrlstringsendDocumentPublic URL of the document
filenamestringsendDocumentFilename shown to recipient
videoUrlstringsendVideoPublic URL of the video
audioUrlstringsendAudio / sendVoicePublic URL of the audio or voice note

Error Codes

CodeMeaning
400Missing or invalid fields
401Unauthorized — missing or invalid token
403Invalid clientId for this account
404Session not found
429Rate limit or session quota exceeded
500Internal server error