Skip to main content

📥 Request Body​

Use the following parameters to configure your message. Requests must be sent in JSON format.

ParameterTypeStatusDescription
phonestringRequiredTarget number in international format (e.g., 628123456789).
messagestringRequiredText message content or caption if sending media.
media_urlstringOptionalPublic URL of the media file (Image/Video/Document) to be sent.
media_typestringOptionalType of media: image, video, audio, or document.
retry_intervalintOptionalTime delay (seconds) between attempts if the first delivery fails.
expires_inintOptionalMessage validity in seconds. After this, the message will not be sent.
expires_atstringOptionalAbsolute 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​

CodeMessageExplanation
400Invalid JSON payloadIncorrect JSON format or missing required parameters.
401UnauthorizedInvalid API Key or mismatch with the device_id.
402Quota exhaustedThe message balance (Free/PRO) for that device has reached its limit.
404Device not founddevice_id is not registered in the Wagy system.

💡 Use Cases & Payloads​

{
"phone": "628123456789",
"message": "Hello, this is a text message from Wagy!"
}
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​

Pesan berhasil masuk antrean