Send Text API

Api Docs Sending Text Messages

Method : POST | GET

Endpoint: {{ url('/') }}/send-message

Request Body : (JSON if POST, query params if GET)

Parameter Type Required Description
api_key string Yes Your API Key from dashboard
phone / sender string Yes Your device number (WhatsApp number used to send)
to / number string Yes Recipient number(s). Use | for multiple: 6281xxx|6282xxx
message string Yes Text message content. Supports {number} and {opt1|opt2|opt3} spin syntax
footer string No Footer text appended below the message
msgid string No WhatsApp message ID to reply to (quoted reply)
full number No Set to 1 to include raw Baileys response in output

{{-- ── Example 1: Basic ── --}}
Example: Basic Send

cURL (POST)

curl -X POST {{ url('/') }}/send-message \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY",
    "phone": "6281234567890",
    "to": "6289876543210",
    "message": "Hello from MPWA Gateway!"
  }'

cURL (GET)

curl "{{ url('/') }}/send-message?api_key=YOUR_API_KEY&phone=6281234567890&to=6289876543210&message=Hello"

JSON Response 200

{
  "success": true,
  "message": "1 message(s) sent successfully",
  "data": {
    "total_recipients": 1,
    "success": 1,
    "failed": 0,
    "results": [
      {
        "to": "6289876543210",
        "status": "success",
        "message_id": "3EB0C41E9D2DFXXXXXXXXX@s.whatsapp.net",
        "timestamp": "2026-07-19T03:15:00.000Z"
      }
    ]
  }
}

{{-- ── Example 2: Multiple Recipients ── --}}
Example: Multiple Recipients

JSON Request

{
  "api_key": "YOUR_API_KEY",
  "phone": "6281234567890",
  "to": "6289876543210|628111222333",
  "message": "Broadcast message",
  "footer": "Sent via MPWA"
}

JSON Response 200 (partial)

{
  "success": true,
  "message": "1 message(s) sent successfully",
  "data": {
    "total_recipients": 2,
    "success": 1,
    "failed": 1,
    "results": [
      {
        "to": "6289876543210",
        "status": "success",
        "message_id": "3EB0C41E9D2DFXXXXXXXXX@s.whatsapp.net",
        "timestamp": "2026-07-19T03:15:00.000Z"
      },
      {
        "to": "628111222333",
        "status": "failed",
        "message_id": null,
        "error": "Rate limit reached: session_cap. Wait 120s.",
        "timestamp": "2026-07-19T03:15:01.000Z"
      }
    ]
  }
}

{{-- ── Example 3: Reply ── --}}
Example: Reply to Message (msgid)

JSON Request

{
  "api_key": "YOUR_API_KEY",
  "phone": "6281234567890",
  "to": "6289876543210",
  "message": "Thanks for your message!",
  "msgid": "3EB031F83D74BF480052B9"
}

{{-- ── Error Responses ── --}}
Error Responses

400 Missing parameters

{
  "success": false,
  "message": "Missing required parameters. Required: api_key, phone, to, message"
}

401 Invalid API key or device

{
  "success": false,
  "message": "Invalid api_key"
}

503 Device not connected

{
  "success": false,
  "message": "Device is not connected. Please scan QR code first."
}

504 Gateway timeout

{
  "success": false,
  "message": "Gateway timeout (18s). The message may have been sent — do NOT retry."
}

Anti-Ban Protection
Rate limiting and content variation are automatically applied. Messages are throttled per-device. If rate-limited, the API returns status: "failed" with a "wait" field. No retry on timeout — to prevent double-send.