SMS & WhatsApp Messaging

Send bulk messages

Send up to 10,000 messages in one request. channel whatsapp sends free-form text from your connected WhatsApp Business number (403 WHATSAPP_NOT_CONNECTED otherwise); each recipient must have written to your number in the last 24 hours. Entries the platform refuses — outside that window (OUT_OF_24H_WINDOW), opted out, … — are listed under rejected with their error code and are never charged.

post/messages/bulk

Request

  • Base URL: https://api.envoisms.ma/v1
  • URL: https://api.envoisms.ma/v1/messages/bulk
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Unique string (max 255 chars) making this batch safe to retry without double-sending. See the Idempotency section above.

Request body

fromstring
channel'sms' | 'whatsapp' | 'telegram' | 'voice' | 'rcs'

Use sms by default. whatsapp sends free-form text from your connected WhatsApp Business number; each recipient must have written to you in the last 24 hours, and recipients outside that window are listed under rejected (OUT_OF_24H_WINDOW) and not charged. Bulk carries no templates — use campaigns for template sends.

Example request

{
  "messages": [
    {
      "to": "+212612345678",
      "message": "Bonjour {{name}}!"
    }
  ]
}

Response

Batch queued

batch_idstring
totalinteger

Messages queued

channelstring

Example response

{
  "messages": [
    {
      "status": "queued"
    }
  ],
  "rejected": [
    {
      "code": "OUT_OF_24H_WINDOW"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.