Recommended: Existing integrations may continue unchanged. New integrations should add
X-API-Version: 1, use POST JSON and include a unique Idempotency-Key for every logical message.Endpoint
POST https://www.webwms2u.com/api/send-message.php
Authorization: Bearer YOUR_API_KEY
X-API-Version: 1
Idempotency-Key: order-10082-confirmation
Content-Type: application/json
Accept: application/json
X-API-KEY remains supported. Bearer authentication is recommended for new integrations.
Automatic routing
- Meta key: official Cloud API, including coexistence numbers.
- Personal key: the connected device assigned to the API key.
- The key determines the channel; clients should not submit a channel value.
- Each accepted outbound message uses one WebWMS2U credit.
Request fields
| v1 field | Legacy alias | Requirement | Description |
|---|---|---|---|
to | direct_number | Required | International recipient number, normally 8–15 digits. A leading + is accepted. |
type | message_type | Optional | text, media, document, location or interactive. |
text.body | message | Text messages | Text or media caption, up to 4,096 characters. |
template.id | template_id | Templates | Your WebWMS2U template ID. Meta templates must be active and approved. |
template.parameters | custom_fields | Optional | Object keyed from 1, matching placeholders such as {{1}}. |
payload | message_payload | Non-text | Media, location or interactive message data. |
scheduled_at | send_time | Optional | UTC ISO 8601 or YYYY-MM-DD HH:MM:SS; up to one year ahead. |
Examples
Text message
{
"to": "+60123456789",
"type": "text",
"text": { "body": "Hello from WebWMS2U!" }
}
Approved Meta or personal template
{
"to": "60121234567",
"template": {
"id": 261,
"parameters": { "1": "John", "2": "INV-10082" }
},
"scheduled_at": "2026-08-12T06:30:00Z"
}
Image or document
{
"to": "60123456789",
"type": "media",
"text": { "body": "Please see the attached brochure." },
"payload": {
"type": "document",
"url": "https://example.com/brochure.pdf",
"filename": "brochure.pdf"
}
}
Location
{
"to": "60123456789",
"type": "location",
"payload": {
"latitude": 3.130219,
"longitude": 101.683756,
"name": "Our office",
"address": "Kuala Lumpur, Malaysia"
}
}
cURL example
curl --request POST 'https://www.webwms2u.com/api/send-message.php' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'X-API-Version: 1' \
--header 'Idempotency-Key: order-10082-confirmation' \
--header 'Content-Type: application/json' \
--data '{"to":"60123456789","type":"text","text":{"body":"Hello!"}}'
Accepted response
HTTP/1.1 202 Accepted
{
"success": true,
"message": "Message queued successfully",
"platform": "meta",
"cost": 1,
"message_type": "text",
"message_id": 81234,
"status": "queued",
"scheduled_at": "2026-08-11T17:30:00+00:00",
"idempotent_replay": false,
"request_id": "..."
}
Queued does not mean delivered. It confirms validation, credit reservation and queue insertion. Final delivery remains subject to Meta/device availability, recipient status and WhatsApp policies.
Track message progress
Use the authenticated Message Status API to retrieve the latest known status, or configure signed delivery-status webhooks to receive updates automatically.
Meta and coexistence rules
- Cloud API and coexistence use the same official Meta outbound rules.
- Free-form text, media, location and interactive messages require an open customer-service window.
- Outside that window, use an active Meta-approved template.
- Personal-device messaging does not use Meta template approval, but remains subject to WhatsApp policies and device connectivity.
Backward compatibility
X-API-KEYand all documented legacy field names remain supported.- Legacy clients without
X-API-Version: 1continue receiving HTTP 200 withsuccess: falsefor application errors. - Legacy GET sending and query-string API keys remain temporarily accepted but are deprecated because URLs may be logged.
- See the API Response Guide for stable error codes and HTTP statuses.