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
| Header | Value |
|---|---|
X-API-Key | Your session API key |
Content-Type | application/json |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Phone number or group ID |
text | string | Yes | Message text |
quotedMessageId | string | No | Message ID to reply to |
Phone Number Formats
All formats are accepted:
919988066776- Plain number with country code (recommended)+919988066776- With plus sign919988066776@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
| Header | Value |
|---|---|
X-API-Key | Your session API key |
Content-Type | application/json |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Phone number or group ID |
image | string | Yes | Image URL, base64, or file path |
caption | string | No | Image caption |
filename | string | No | Custom 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
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Phone number or group ID |
video | string | Yes | Video URL, base64, or file path |
caption | string | No | Video caption |
filename | string | No | Custom 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
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Phone number or group ID |
audio | string | Yes | Audio URL, base64, or file path |
ptt | boolean | No | Send 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
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Phone number or group ID |
document | string | Yes | Document URL, base64, or file path |
filename | string | Yes | Document filename |
caption | string | No | Document 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
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Phone number or group ID |
sticker | string | Yes | Sticker 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
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Phone number or group ID |
name | string | Yes | Contact name |
phone | string | Yes | Contact 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
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Phone number or group ID |
latitude | number | Yes | Location latitude |
longitude | number | Yes | Location longitude |
description | string | No | Location 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"
}
}