To create an SMS you will need to add an SMS message in your POST params when calling the create method. Parameters used in SMS message content are listed below:
Parameters
Parameter | Description |
|---|---|
messages | Set to number 9 for SMS i.e., A JSON object containing the SMS params |
sms | |
from | The from header that is used to identify your brand |
text | The body text of the SMS message |
SMS from names
SMS from names replaces the sender number in your SMS message seen by your audience and are captured by the
fromparameter. These need to be pre-configured from the SMS settings page.
Example
The SMS channel is turned on with "sms": 1 and the SMS type 9 is added to the messages object with parameters for the SMS content. In this example "broadcast": 1 is used to target your entire available user base. Conditions that target a subsection of your audience, and scheduling and other options can be added as described in the campaign model guide.
In this example a personalisation tag has been added in the SMS text to pull in the users' first names.
curl --request POST \
--url https://external-api.xtremepush.com/api/external/create/campaign \
--header 'content-type: application/json' \
--data '{
"apptoken": "YOUR_APPTOKEN",
"title": "SMS example via API",
"sms": 1,
"broadcast": 1,
"messages": {
"9": {
"sms": {
"from": "xtremepush",
"text": "{{first_name}}, check out our SMS API test"
}
}
}
}'Your resulting SMS from above would look something like this one:
.png?sv=2026-02-06&spr=https&st=2026-09-29T16%3A04%3A00Z&se=2026-09-29T16%3A15%3A00Z&sr=c&sp=r&sig=sv2XdI9Ub61nSa9erB8m4X7wJq63wI7ZzMZjFHyx2Ns%3D)