--- title: "Create an SMS campaign using the API" slug: "api-create-sms" updated: 2026-09-16T10:01:14Z published: 2026-09-16T10:01:14Z canonical: "docs.xtremepush.com/api-create-sms" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt > Use this file to discover all available pages before exploring further. # Create an SMS campaign using the API 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., ```Code "messages": { "9": { "SMS_CONTENT PARAMS" } } ``` A JSON object containing the SMS params | | sms | ```Code "sms": { "from": "xtremepush", "text": "Hello" } ``` | | from | The from header that is used to identify your brand | | text | The body text of the SMS message | > [!NOTE] > SMS from names > > SMS from names replaces the sender number in your SMS message seen by your audience and are captured by the `from` parameter. These need to be pre-configured from the [SMS settings](/documentation/docs/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](/v1-api/apidocs/campaign-modal-properties). In this example a personalisation tag has been added in the SMS text to pull in the users' first names. ```shell 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: ![750](https://cdn.document360.io/b056e88b-f6c1-4bd2-b5b8-08e9336a17c9/Images/Documentation/481e12f-sms_example_message(1).png?sv=2026-02-06&spr=https&st=2026-10-30T01%3A59%3A39Z&se=2026-10-30T02%3A59%3A39Z&sr=c&sp=r&sig=SxY4oi9f1Y1V10d0RyOl6%2BPgDpz3VHjgORn9wWhh2LM%3D)