API Reference
Messages
Send free-form session messages (text, media, location, Cloud interactive/commerce) and fetch message details.
Session vs template
On Cloud API, free-form sends require an open ~24h customer care window. Outside that window use Templates. Full decision table: Session Window vs Templates.
POST
/messages
messages:send
https://app.washeej.com/v1/messages
Send a free-form session message (text, media, location, or Cloud interactive/commerce) on Cloud or Device channels.
| Parameter | Type | Required | Description |
|---|---|---|---|
mobile_code
|
string | required | Country dial code without +. |
mobile
|
string | required | National number digits only. |
whatsapp_account_id
|
integer | optional | Preferred channel ID from GET /devices. Use this in multi-number accounts. |
from_number
|
string | optional | Alternative channel selector — digits only, no + or spaces. |
message
|
string | optional | Text body or media caption. Required unless sending media/interactive/location/product. |
image
|
file | optional | Image upload (multipart). |
document
|
file | optional | Document upload (multipart). |
video
|
file | optional | Video upload (multipart). |
audio
|
file | optional | Audio upload (multipart). |
image_url
|
url | optional | Public HTTPS image URL (fetched server-side). |
document_url
|
url | optional | Public HTTPS document URL (fetched server-side). |
video_url
|
url | optional | Public HTTPS video URL. |
audio_url
|
url | optional | Public HTTPS audio URL. |
filename
|
string | optional | Display filename when using document_url. |
latitude
|
number | optional | Location latitude (send with longitude). |
longitude
|
number | optional | Location longitude (send with latitude). |
name
|
string | optional | Optional location title. |
address
|
string | optional | Optional location address line. |
cta_url_id
|
integer | optional | Dashboard CTA URL asset ID (Cloud only). |
interactive_list_id
|
integer | optional | Dashboard interactive list ID (Cloud only). |
product
|
json | optional | Commerce product payload (Cloud). |
created_order_data
|
json | optional | Commerce order payload (Cloud). |
cURL
curl -X POST https://app.washeej.com/v1/messages \
-H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"mobile_code": "966",
"mobile": "500000000",
"whatsapp_account_id": YOUR_ACCOUNT_ID,
"message": "Hello from Washeej API"
}'
Response
{
"ok": true,
"data": {
"message_id": 300541,
"conversation_id": 20717,
"whatsapp_message_id": "wamid.XXX"
},
"meta": {
"request_id": "uuid"
}
}
Notes
- Inside the Cloud 24-hour customer care window you can send free-form messages. Outside that window use templates — see Guides → Session Window.
- Prefer whatsapp_account_id on multi-number accounts — see Guides → Channel Selection.
- Session media via multipart or *_url fields — see Guides → Session Media.
- CTA / lists / product require Cloud API — see Guides → Interactive Messages.
- Cloud numbers may return billing_blocked when Meta payment eligibility fails.
Common errors:
billing_blocked, validation_error, capability_error, not_found, invalid_phone
GET
/messages/{id}
messages:read
https://app.washeej.com/v1/messages/{id}
Get a single message by Washeej message ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
id
path
|
integer | required | Internal message ID. |
cURL
curl -H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
https://app.washeej.com/v1/messages/300541
Channel targeting
| Channel | How to target | Session rules |
|---|---|---|
| Cloud API | whatsapp_account_id (preferred) or from_number |
Free-form inside 24h; templates outside |
| Device / QR | whatsapp_account_id or from_number |
Routes through GOWA; no Meta template requirement |
Details: Channel Selection.
Common send patterns
- Session Media — PDF/image/video/audio via upload or
*_url - Interactive Messages — CTA, lists, location, product/order cards
- Integration Playbook — end-to-end SaaS checklist