Skip to main content

Send Messages

Endpoint

POST  /sms/messages

Description

The /sms/messages endpoint sends a message to one or more recipients. The message can be sent immediately or scheduled for later delivery. You can send messages to a list of recipients or a contact group.

Body Parameters (required)

ParameterTypeDescription
sender_idNumberAn approved sender ID for the message Refer here.
priorityStringThe message priority. Must be one of: authentication, utility, or marketing.
campaignStringA tag to categorize the message, which can be used for filtering later.
messageStringThe content of the message to send.
scheduleStringThe date-time to send the message (as a date string). Use null if the message should be sent instantly.
recipientsArrayA list of recipient phone numbers to send the message to. Use null if contact_list_id is provided.
contact_list_idNumberThe ID of the contact group to send messages to Refer here. Use null if recipients is provided.
info

Each recipient must include it's country code. Eg. +233200000000

Example Request

curl -X POST "https://service-prod.api.comms360.africa/api/sms/messages" \
-H "Content-Type: application/json" \
-d '{
"sender_id": 29,
"priority": "authentication",
"campaign": "user-verification",
"message": "Your verification code is 123456",
"schedule": null,
"recipients": ["+23320000000", "+23320000000"],
"contact_list_id": null
}'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json

{
"responsecode": 201,
"data": {
"success": true,
"messageId": "1000000"
},
"responsemessage": "Sms message effected successfully."
}