Skip to main content

Messaging

Send various types of messages including text, images, videos, documents, and more.

Send Text Message

Send a text message to a WhatsApp number or group.

POST /sessions/{id}/send

Headers

HeaderValue
X-API-KeyYour session API key
Content-Typeapplication/json

Request Body

ParameterTypeRequiredDescription
tostringYesPhone number or group ID
textstringYesMessage text
quotedMessageIdstringNoMessage ID to reply to

Phone Number Formats

All formats are accepted:

  • 919988066776 - Plain number with country code (recommended)
  • +919988066776 - With plus sign
  • 919988066776@s.whatsapp.net - Full WhatsApp ID

Example Request

curl -X POST http://localhost:3000/sessions/{id}/send \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"text": "Hello from WhatsApp API!"
}'

Response

{
"success": true,
"messageId": "3EB0ABC123456789",
"to": "919988066776@s.whatsapp.net",
"type": "text",
"status": "sent",
"timestamp": "2026-01-28T10:05:00.000Z"
}

Reply to Message

Reply to a specific message by including the quotedMessageId.

POST /sessions/{id}/send

Request Body

{
"to": "919988066776",
"text": "This is a reply!",
"quotedMessageId": "3EB0ABC123456789"
}

Example Request

curl -X POST http://localhost:3000/sessions/{id}/send \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"text": "This is a reply!",
"quotedMessageId": "3EB0ABC123456789"
}'

Send Image

Send an image with optional caption.

POST /sessions/{id}/send/image

Headers

HeaderValue
X-API-KeyYour session API key
Content-Typeapplication/json

Request Body

ParameterTypeRequiredDescription
tostringYesPhone number or group ID
imagestringYesImage URL, base64, or file path
captionstringNoImage caption
filenamestringNoCustom filename

Image Sources

The image parameter accepts:

  • URL: https://example.com/image.jpg
  • Base64: data:image/jpeg;base64,/9j/4AAQ...
  • File path (inside container): /data/media/image.jpg

Example Request

curl -X POST http://localhost:3000/sessions/{id}/send/image \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"image": "https://example.com/image.jpg",
"caption": "Check out this image!",
"filename": "photo.jpg"
}'

Response

{
"success": true,
"messageId": "3EB0ABC123456789",
"to": "919988066776@s.whatsapp.net",
"type": "image",
"status": "sent",
"timestamp": "2026-01-28T10:05:00.000Z"
}

Send Video

Send a video with optional caption.

POST /sessions/{id}/send/video

Request Body

ParameterTypeRequiredDescription
tostringYesPhone number or group ID
videostringYesVideo URL, base64, or file path
captionstringNoVideo caption
filenamestringNoCustom filename

Example Request

curl -X POST http://localhost:3000/sessions/{id}/send/video \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"video": "https://example.com/video.mp4",
"caption": "Watch this video!",
"filename": "video.mp4"
}'

Send Audio / Voice Note

Send an audio file or voice note.

POST /sessions/{id}/send/audio

Request Body

ParameterTypeRequiredDescription
tostringYesPhone number or group ID
audiostringYesAudio URL, base64, or file path
pttbooleanNoSend as voice note (default: false)

Example Request

curl -X POST http://localhost:3000/sessions/{id}/send/audio \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"audio": "https://example.com/audio.mp3",
"ptt": true
}'

Send Document

Send a document/file with optional caption.

POST /sessions/{id}/send/document

Request Body

ParameterTypeRequiredDescription
tostringYesPhone number or group ID
documentstringYesDocument URL, base64, or file path
filenamestringYesDocument filename
captionstringNoDocument caption

Example Request

curl -X POST http://localhost:3000/sessions/{id}/send/document \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"document": "https://example.com/file.pdf",
"filename": "report.pdf",
"caption": "Here is the document you requested"
}'

Send Sticker

Send a sticker (WebP format recommended).

POST /sessions/{id}/send/sticker

Request Body

ParameterTypeRequiredDescription
tostringYesPhone number or group ID
stickerstringYesSticker URL, base64, or file path

Example Request

curl -X POST http://localhost:3000/sessions/{id}/send/sticker \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"sticker": "https://example.com/sticker.webp"
}'

Send Contact

Send a contact card.

POST /sessions/{id}/send/contact

Request Body

ParameterTypeRequiredDescription
tostringYesPhone number or group ID
namestringYesContact name
phonestringYesContact phone number

Example Request

curl -X POST http://localhost:3000/sessions/{id}/send/contact \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"name": "John Doe",
"phone": "919876543210"
}'

Send Location

Send a location with coordinates.

POST /sessions/{id}/send/location

Request Body

ParameterTypeRequiredDescription
tostringYesPhone number or group ID
latitudenumberYesLocation latitude
longitudenumberYesLocation longitude
descriptionstringNoLocation description

Example Request

curl -X POST http://localhost:3000/sessions/{id}/send/location \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"latitude": 28.6139,
"longitude": 77.2090,
"description": "New Delhi, India"
}'

Presence & Typing

Send Typing Indicator

Show "typing..." to the recipient.

POST /sessions/{id}/typing

curl -X POST http://localhost:3000/sessions/{id}/typing \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"isTyping": true
}'

To stop typing:

{
"to": "919988066776",
"isTyping": false
}

Send Recording Indicator

Show "recording audio..." to the recipient.

POST /sessions/{id}/recording

curl -X POST http://localhost:3000/sessions/{id}/recording \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "919988066776",
"isRecording": true
}'

Mark Messages as Read

POST /sessions/{id}/read

curl -X POST http://localhost:3000/sessions/{id}/read \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"chatId": "919988066776@s.whatsapp.net",
"messageIds": ["3EB0ABC123456789"]
}'

Download Media

Download media (image, video, audio, document) from a received message.

GET /sessions/{id}/media/{messageId}

Example Request

curl -H "X-API-Key: wask_your_session_key" \
http://localhost:3000/sessions/{id}/media/3EB0ABC123456789

Response

{
"success": true,
"media": {
"data": "base64_encoded_media_data...",
"mimetype": "image/jpeg",
"filename": "image.jpg"
}
}