X-API-Key header.
GET https://your-domain.com/api/sessions
Complete guide to integrate WhatsApp messaging into your applications
Butuh API key?
Login atau daftar gratis untuk dapat API key dan mulai integrasi.
All requests use a single base URL and require an API key header.
X-API-Key header.
GET https://your-domain.com/api/sessions
Include your API key in every request using the X-API-Key header.
X-API-Key: YOUR_API_KEY
Get session counts for your account.
/api/sessions
curl -X GET https://your-domain.com/api/sessions \
-H "X-API-Key: YOUR_API_KEY"
{
"success": true,
"counts": {
"total": 5,
"connected": 3,
"connecting": 1,
"qr": 1,
"disconnected": 0
}
}
Create a new WhatsApp session.
/api/sessions
curl -X POST https://your-domain.com/api/sessions \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"sessionName": "My Business Account"}'
{
"success": true,
"sessionId": "abc-123-def-456",
"message": "Session created successfully"
}
Get detailed status of a specific session.
/api/sessions/:sessionId
curl -X GET https://your-domain.com/api/sessions/abc-123-def-456 \
-H "X-API-Key: YOUR_API_KEY"
{
"success": true,
"session": {
"id": "abc-123-def-456",
"name": "My Business Account",
"status": "connected",
"phone_number": "1234567890",
"created_at": "2024-01-01T00:00:00.000Z",
"isConnected": true
}
}
connecting
qr
connected
disconnected
Get QR code for session authentication. Returns a base64-encoded PNG.
/api/sessions/:sessionId/qr
curl -X GET https://your-domain.com/api/sessions/abc-123-def-456/qr \
-H "X-API-Key: YOUR_API_KEY"
{
"success": true,
"qrCode": "data:image/png;base64,iVBORw0KGgo..."
}
Reconnect a session — clears old credentials and generates a new QR code.
/api/sessions/:sessionId/reconnect
curl -X POST https://your-domain.com/api/sessions/abc-123-def-456/reconnect \
-H "X-API-Key: YOUR_API_KEY"
{
"success": true,
"message": "Session reconnection initiated"
}
Permanently delete a session and all its configurations.
/api/sessions/:sessionId
curl -X DELETE https://your-domain.com/api/sessions/abc-123-def-456 \
-H "X-API-Key: YOUR_API_KEY"
{
"success": true,
"message": "Session deleted successfully"
}
Send a text message via WhatsApp. Validates the recipient number by default.
/api/sessions/:sessionId/send
| Param | Type | Required | Description |
|---|---|---|---|
to |
string | Required | Phone number with country code (without +) |
message |
string | Required | Message text (max 4096 characters) |
skipValidation |
boolean | Optional | Skip WhatsApp number validation (default: false) |
curl -X POST https://your-domain.com/api/sessions/abc-123/send \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"to": "6281234567890",
"message": "Hello from WhatsApp API!"
}'
skipValidation: true to bypass this check.
{
"success": true,
"messageId": "3EB0C767D71D8D6E2CD5",
"message": "Message sent successfully"
}
{
"success": false,
"error": "Invalid WhatsApp Number",
"message": "The phone number is not registered on WhatsApp.",
"phoneNumber": "6281234567890"
}
Send media files (images, videos, audio, documents) via multipart/form-data.
/api/sessions/:sessionId/send-media
| Param | Type | Required | Description |
|---|---|---|---|
to |
string | Required | Phone number with country code |
media |
file | Required | File to send (max 50 MB) |
message |
string | Optional | Caption for the media |
Images
.jpg .jpeg .png .gif .webp
Videos
.mp4 .avi .mov .mkv .webm
Audio
.mp3 .wav .ogg .m4a .aac
Documents
.pdf .doc .docx .xls .xlsx
curl -X POST https://your-domain.com/api/sessions/abc-123/send-media \
-H "X-API-Key: YOUR_API_KEY" \
-F "to=6281234567890" \
-F "message=Check this out!" \
-F "media=@/path/to/image.jpg"
{
"success": true,
"messageId": "3EB0C767D71D8D6E2CD5",
"message": "Media sent successfully"
}
Validate if phone numbers are registered on WhatsApp. Up to 100 numbers per request.
/api/number-checker
| Param | Type | Required | Description |
|---|---|---|---|
sessionId |
string | Required | Session ID to use for checking |
phoneNumbers |
array | Required | Array of phone numbers with country code (max 100) |
curl -X POST https://your-domain.com/api/number-checker \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"sessionId": "abc-123-def-456",
"phoneNumbers": ["6281234567890", "6289876543210"]
}'
{
"success": true,
"message": "Number check completed",
"summary": {
"total": 2,
"valid": 1,
"invalid": 1
},
"results": [
{ "phoneNumber": "6281234567890", "isValid": true, "status": "valid" },
{ "phoneNumber": "6289876543210", "isValid": false, "status": "invalid" }
]
}
{
"success": false,
"error": "Number check limit reached",
"limit": 1000,
"used": 1000,
"remaining": 0,
"message": "You have reached your number check limit. Please upgrade your plan."
}
Standard HTTP status codes indicate success or failure.
| Code | Error | How to fix |
|---|---|---|
| 401 | Unauthorized | API key tidak valid atau tidak disertakan — cek header X-API-Key |
| 403 | Forbidden | Resource milik user lain — pastikan pakai session milik sendiri |
| 404 | Not Found | Session atau resource tidak ditemukan — cek sessionId dan path endpoint |
| 429 | Too Many Requests | Rate limit tercapai — backoff dan coba lagi dalam ~1 menit |
| 500 | Internal Server Error | Server error — hubungi support jika terjadi berulang |
{
"success": false,
"error": "Bad Request",
"message": "Phone number and message are required"
}
Ready-to-use full integration snippets.
curl -X POST https://your-domain.com/api/sessions/YOUR_SESSION_ID/send \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"to": "6281234567890", "message": "Hello from the API!"}'
curl -X POST https://your-domain.com/api/number-checker \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"sessionId": "YOUR_SESSION_ID",
"phoneNumbers": ["6281234567890", "6289876543210", "6285551234567"]
}'