Legacy Cloud API
Templates
List approved Meta templates and send them via POST /inbox/send-template-message
with body variables, DOCUMENT/IMAGE/VIDEO headers, or OTP codes. Create, sync, and status tracking are available on /external-api/templates*
and on the WhatsApp Templates API
(Public API v1). Explicit template scopes required; Cloud accounts only; provider Meta delete deferred.
GET
/inbox/template-list
Public
https://app.washeej.com/external-api/inbox/template-list
List approved Cloud templates (default). Pass ?status=all for the full inventory.
cURL
curl -H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
https://app.washeej.com/external-api/inbox/template-list
POST
/inbox/send-template-message
Public
https://app.washeej.com/external-api/inbox/send-template-message
Send an approved Cloud template (text variables and/or DOCUMENT/IMAGE/VIDEO header media).
| Parameter | Type | Required | Description |
|---|---|---|---|
template_id
|
string | required | Washeej template ID or Meta whatsapp_template_id. |
mobile_code
|
string | required | Dial code. |
mobile
|
string | required | National number. |
body_variables
|
string[] | optional | Ordered body variable values (omit if body has no placeholders). |
header_variables
|
string[] | optional | TEXT header variable values. |
header_media_url
|
url | optional | Public HTTPS media URL when header_format is DOCUMENT/IMAGE/VIDEO (native file bubble). |
header_media_file
|
file | optional | Multipart upload alternative to header_media_url (also accepts media_file). |
whatsapp_account_id
|
integer | optional | Cloud account ID. |
from_number
|
string | optional | Alternative channel selector (digits only). |
cURL
curl -X POST https://app.washeej.com/external-api/inbox/send-template-message \
-H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"template_id": "YOUR_TEMPLATE_ID",
"mobile_code": "966",
"mobile": "500000000",
"whatsapp_account_id": YOUR_CLOUD_ACCOUNT_ID,
"header_media_url": "https://files.example.com/docs/INV-1001.pdf",
"body_variables": ["Ahmed", "INV-1001"]
}'
Notes
- DOCUMENT/IMAGE/VIDEO headers: pass header_media_url or header_media_file — Graph receives filename for DOCUMENT automatically (basename or header_media_filename). Oversized/failed media returns a clear error (not a silent skip).
- Text URL inside body: use body_variables — see Dynamic Invoice Link guide.
- AUTHENTICATION OTP: exactly one 4–8 digit code in body_variables; Washeej attaches the copy-code button parameter when required.
- template_id accepts local templates.id or Meta whatsapp_template_id.
- Cloud API channels only. Prefer whatsapp_account_id or exact from_number (mismatched from_number → sender_not_found).
- MARKETING templates may return marketing_suppressed for opted-out contacts.
Choose a pattern
| Goal | Fields | Guide |
|---|---|---|
| Native PDF / file bubble | header_media_url or header_media_file |
Template Media Headers |
| URL in message text | body_variables |
Dynamic Invoice Link |
| OTP / login | AUTHENTICATION + one 4–8 digit code | Authentication OTP |
Scenario — DOCUMENT PDF via URL
cURL
curl -X POST "https://app.washeej.com/external-api/inbox/send-template-message" \
-H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"template_id": "YOUR_TEMPLATE_ID",
"mobile_code": "966",
"mobile": "500000000",
"whatsapp_account_id": YOUR_CLOUD_ACCOUNT_ID,
"header_media_url": "https://files.example.com/docs/INV-1001.pdf",
"body_variables": ["Ahmed", "INV-1001"]
}'
File, not link
header_media_url is fetched by Meta server-to-server. The customer receives a WhatsApp document bubble — not the raw URL in text.
Scenario — multipart PDF upload
cURL
curl -X POST "https://app.washeej.com/external-api/inbox/send-template-message" \
-H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
-F "template_id=YOUR_TEMPLATE_ID" \
-F "mobile_code=966" \
-F "mobile=500000000" \
-F "whatsapp_account_id=YOUR_CLOUD_ACCOUNT_ID" \
-F "header_media_file=@/path/to/invoice.pdf;type=application/pdf" \
-F "body_variables[]=Ahmed" \
-F "body_variables[]=INV-1001"
Scenario — OTP
cURL
curl -X POST "https://app.washeej.com/external-api/inbox/send-template-message" \
-H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"template_id": "YOUR_AUTH_TEMPLATE_ID",
"mobile_code": "966",
"mobile": "500000000",
"whatsapp_account_id": YOUR_CLOUD_ACCOUNT_ID,
"body_variables": ["482913"]
}'
Scenario — URL in body text
cURL
curl -X POST "https://app.washeej.com/external-api/inbox/send-template-message" \
-H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"template_id": "YOUR_TEMPLATE_ID",
"mobile_code": "966",
"mobile": "500000000",
"whatsapp_account_id": YOUR_CLOUD_ACCOUNT_ID,
"body_variables": [
"https://files.example.com/invoices/attachment?id=UUID"
]
}'