The WhatsApp sending rules below are set by Meta.
You cannot send free text
WhatsApp does not permit business-initiated free-text messages. Every message you send through the API is an approved template, referenced by name, with values filled into its placeholders.
Before you send:
- Connect a WhatsApp Business account in the Arsel Dashboard under WhatsApp > Setup, and top up your WhatsApp wallet.
- Create your templates under WhatsApp > Templates, or with the Templates API.
- Wait for Meta to approve each one. Approval is not instant and templates can be rejected. Get Template reports the current status.
- Send by template name.
Sending
curl -X POST "https://api.arsel.sa/v1/whatsapp/send" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: booking-5521-confirmation" \
-d '{
"to": "+966512345678",
"template_name": "booking_confirmation",
"language": "ar",
"parameters": { "booking_ref": "5521", "date": "12 March" }
}'
to is a single recipient in E.164 format, not an array.
Filling in parameters
What belongs in parameters depends on the template's category:
| Category | What to pass |
|---|---|
AUTHENTICATION | The one-time code as code. If the template has a copy-code button, the value is repeated into it automatically, so pass it once. |
UTILITY | One entry per {{placeholder}} in the template body, keyed by placeholder name. |
MARKETING | Same as UTILITY, but subject to the recipient's marketing opt-out. |
language is requiredIf you omit language, Arsel resolves the template by name alone. If that name is approved in more than one language, the request returns 409 Conflict, so send the language code explicitly whenever a name exists in multiple languages.
parameters is absent from every response, because for an authentication template it holds the one-time code. If you need the code later, store it yourself.
Delivery status
202 means the provider accepted the message, not that it arrived. Poll GET /whatsapp/:id:
| Status | Meaning |
|---|---|
queued | Accepted by Arsel, not yet handed to the provider |
sent | The provider accepted it and returned a message ID |
delivered | Confirmed delivered to the recipient's device |
read | The recipient opened the message |
failed | See failure_reason |
read may never arrive, because recipients can disable read receipts. Use delivered as your success condition.
Billing
Each message is charged at the rate for the destination country and template category. The charge is held when the message is accepted and settled from the delivery receipt. A message the provider rejects is not charged.
Reference
| Send WhatsApp · List · Get | Transactional endpoints |
| Templates | Create, list, get, edit, delete |