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)
| Parameter | Type | Description |
|---|---|---|
sender_id | Number | An approved sender ID for the message Refer here. |
priority | String | The message priority. Must be one of: authentication, utility, or marketing. |
campaign | String | A tag to categorize the message, which can be used for filtering later. |
message | String | The content of the message to send. |
schedule | String | The date-time to send the message (as a date string). Use null if the message should be sent instantly. |
recipients | Array | A list of recipient phone numbers to send the message to. Use null if contact_list_id is provided. |
contact_list_id | Number | The 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."
}