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 fieldURL alternativeNotes
imageimage_urlJPG/PNG/WebP and common formats
documentdocument_urlPDF and office docs; optional filename
videovideo_urlMP4 preferred
audioaudio_urlCommon 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 filename when using document_url so the customer sees a clear name.
  • Works on Cloud and Device channels; Cloud still requires an open session outside templates.