📥 Request Body​
Use the following parameters to configure your message. Requests must be sent in JSON format.
| Parameter | Type | Status | Description |
|---|---|---|---|
phone | string | Required | Target number in international format (e.g., 628123456789). |
message | string | Required | Text message content or caption if sending media. |
media_url | string | Optional | Public URL of the media file (Image/Video/Document) to be sent. |
media_type | string | Optional | Type of media: image, video, audio, or document. |
retry_interval | int | Optional | Time delay (seconds) between attempts if the first delivery fails. |
expires_in | int | Optional | Message validity in seconds. After this, the message will not be sent. |
expires_at | string | Optional | Absolute expiration time in RFC3339 format. |
Expiration Priority
Use either expires_in or expires_at. If both are sent, Wagy will use expires_at as the primary reference and ignore expires_in.
Full Request Example​
{
"phone": "628123456789",
"message": "Hello, here is your shopping invoice!",
"media_url": "https://yourdomain.com/files/inv-001.pdf",
"media_type": "document",
"retry_interval": 120,
"expires_in": 3600
}
📤 Responses​
1. Success (200 OK)​
{
"status": "success",
"data": {
"message_id": 1024,
"status": "PENDING",
"quota_type": "pro",
"remaining": 499
},
"message": "Message queued"
}
2. Error Codes​
| Code | Message | Explanation |
|---|---|---|
| 400 | Invalid JSON payload | Incorrect JSON format or missing required parameters. |
| 401 | Unauthorized | Invalid API Key or mismatch with the device_id. |
| 402 | Quota exhausted | The message balance (Free/PRO) for that device has reached its limit. |
| 404 | Device not found | device_id is not registered in the Wagy system. |
💡 Use Cases & Payloads​
- Text Only
- Image
{
"phone": "628123456789",
"message": "Hello, this is a text message from Wagy!"
}
{
"phone": "628123456789",
"message": "Check out our latest promo!",
"media_url": "https://wagy.web.id/img/logo.jpg",
"media_type": "image"
}
Queue Note
Each message sent via the API is not immediately sent to WhatsApp; instead, it enters a Queue. Wagy will process the delivery with a natural delay.
Send single message
POST/:device_id/send
Enqueue a WhatsApp message for delivery through a specific device.
Request​
Responses​
- 200
- 400
- 401
- 402
- 404
- 500
- 503
Pesan berhasil masuk antrean
Format JSON salah atau parameter wajib kosong
API Key tidak valid atau tidak sesuai
Kuota pengiriman device sudah habis
Device tidak ditemukan
Internal server error
Device tidak terhubung (offline)