Skip to main content

SMS: Send

Send one or more SMS messages via the Mersal API.

3 min read

Send one or more SMS messages in a single request. Pass multiple entries in the contact array to do a bulk send, and optionally schedule each message for future delivery or target a specific gateway.

Endpoint

POSThttps://mersal.it/api/sms/send

Authentication

Requires your personal API key via the Api-key header (or the api_key query/body fallback). See Authentication.

Request parameters

NameTypeRequiredDescription
contactarrayYesArray of recipients. Must contain at least 1 item.
contact.*.numberstringYesThe recipient's phone number.
contact.*.messagestringYesThe SMS message body.
contact.*.gateway_identifierstringNoUID of a specific SMS gateway to send through. Omit to use your account's default/active SMS gateway. Pass a specific gateway's UID to force that gateway — for example, to route through the Android SIM Gateway instead of an SMS API provider.
contact.*.schedule_atstringNoSchedule delivery for a future time, format Y-m-d H:i:s. Omit to send immediately.

Example request

curl -X POST https://mersal.it/api/sms/send \
  -H "Api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contact": [
      {
        "number": "+201234567890",
        "message": "Your order has shipped!"
      },
      {
        "number": "+201098765432",
        "message": "Reminder: your appointment is tomorrow at 10am.",
        "schedule_at": "2026-08-01 10:00:00"
      }
    ]
  }'

Example response

{
  "success": true,
  "message": "SMS queued successfully",
  "data": {
    "contact": [
      {
        "number": "+201234567890",
        "status": "queued"
      },
      {
        "number": "+201098765432",
        "status": "scheduled"
      }
    ]
  }
}

On validation failure, Mersal returns 422:

{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "contact.0.number": ["The contact.0.number field is required."]
  }
}

Errors

Common failure modes are a missing/invalid API key, an expired subscription, or a 422 validation error on the contact array. See Errors and Status Codes for the full reference.

Was this page helpful?
SMS: Send · Mersal Docs