📥 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, or document. If media_url is provided but media_type is omitted, Wagy will automatically detect the media type based on the downloaded file content. |
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. |
scheduled_at | string | Optional | Scheduled delivery time in RFC3339 format (e.g., 2026-07-20T10:00:00Z). If left empty, the message is sent immediately. |
Use either expires_in or expires_at. If both are sent, Wagy will use expires_at as the primary reference and ignore expires_in.
If you specify expires_in along with scheduled_at, the expiration time will be calculated relative to the scheduled time (scheduled_at), rather than the time the message is queued.
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,
"scheduled_at": "2026-07-20T10:00:00Z",
"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
- Scheduled Message
{
"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"
}
{
"phone": "628123456789",
"message": "Hello! This is a scheduled automated reminder.",
"scheduled_at": "2026-07-20T10:00:00Z",
"expires_in": 3600
}
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)