Guides
Session Media
Send images, documents, video, and audio with POST /messages inside an open customer session —
via multipart upload or public HTTPS URL fields.
Templates vs session media
Outside the Cloud 24h window, use an approved template with a DOCUMENT/IMAGE/VIDEO header instead — see Template Media Headers.
1. Supported fields
| Upload field | URL alternative | Notes |
|---|---|---|
image | image_url | JPG/PNG/WebP and common formats |
document | document_url | PDF and office docs; optional filename |
video | video_url | MP4 preferred |
audio | audio_url | Common audio types |
message is optional when sending media and becomes the caption when provided. URL fields must be publicly downloadable over HTTPS; Washeej fetches them server-side before sending.
2. Scenario — PDF via URL
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,
"document_url": "https://files.example.com/docs/INV-1001.pdf",
"filename": "INV-1001.pdf",
"message": "Your invoice is attached"
}'
3. Scenario — multipart upload
cURL
curl -X POST "https://app.washeej.com/v1/messages" \
-H "client-id: YOUR_CLIENT_ID" \
-H "client-secret: YOUR_CLIENT_SECRET" \
-F "mobile_code=966" \
-F "mobile=500000000" \
-F "whatsapp_account_id=YOUR_ACCOUNT_ID" \
-F "message=Your invoice is attached" \
-F "document=@/path/to/INV-1001.pdf;type=application/pdf"
4. Practical limits
- API accepts large uploads; WhatsApp / Meta still enforce channel-side limits (prefer PDF ≤ 100 MB, images ≤ 5 MB, video ≤ 16 MB on Cloud).
- URL hosts must allow Washeej and Meta-adjacent fetches (no login HTML).
- Set
filenamewhen usingdocument_urlso the customer sees a clear name. - Works on Cloud and Device channels; Cloud still requires an open session outside templates.