Guides

Channel Selection

How to choose which WhatsApp number sends each API message when an account has multiple Cloud and Device channels.

Always be explicit in production If you omit channel selectors on a multi-number account, Washeej picks a default. That may not be the number your customer expects.

1. List channels

cURL
curl -H "client-id: YOUR_CLIENT_ID" \
     -H "client-secret: YOUR_CLIENT_SECRET" \
     https://staging-mobile.washeej.com/v1/devices

Each item includes id (use as whatsapp_account_id), phone_number, channel_type (cloud / device / coexistence), and connection status.

2. Selection priority

  1. whatsapp_account_id — preferred; exact channel ID from GET /devices.
  2. from_number — digits only (country code + national number, no + / spaces). Matched after normalizing digits.
  3. Default — connected Cloud channel when the endpoint prefers Cloud (templates), otherwise the account default / first available channel.

3. Examples

Send text on a specific Cloud number
curl -X POST "https://staging-mobile.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_CLOUD_ACCOUNT_ID,
    "message": "Hello from the sales line"
  }'
Same send using from_number
curl -X POST "https://staging-mobile.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",
    "from_number": "966920000000",
    "message": "Hello from the sales line"
  }'

4. Capability matrix

CapabilityCloud / CoexistenceDevice / QR
Free-form session messagesYes (inside 24h)Yes
Meta templatesYesNo
Interactive lists / CTA URLYesNo
Catalog / product cardsYesNo
Hosted Meta onboardingYes

Sending a template on a Device channel returns capability_error.

5. Defaults

Mark a channel as default with POST /devices/{id}/default. Still pass whatsapp_account_id explicitly in multi-brand or multi-country setups.