Campaigns & templates
For sending one message to many recipients — promotional and marketing SMS — use the Broadcast surface instead of repeating POST /messages. You can launch with raw text in payload (contentPattern). templateId is optional and only points at a saved template.
Working with campaigns requires an API key with the Broadcasts scope (contacts need Recipients). See API keys & scopes.
Broadcast templates
A template defines the message content and the channel it goes out on. Create one with POST /broadcast/templates (or in the portal under Broadcasts → Templates).
POST https://client.routeon.io/api/v1/broadcast/templates
X-API-Key: <API_KEY>
{
"name": "Demo SMS template",
"description": "Welcome message",
"extraRecipientList": [],
"filterList": [],
"tags": [],
"contentType": 1,
"content": {
"flowSteps": [
{
"channelType": 1,
"senderId": "Routeon",
"contentPattern": "Hello {{attribute.name}}, this is a demo.",
"deliveryCondition": "DELIVERY_SUCCESS",
"timeout": 172800
}
]
}
}
| Field | Type | Required | Meaning |
|---|---|---|---|
content |
object | Yes | The message flow. Holds flowSteps[]. |
contentType |
integer | Yes | Content model. 1 = Fallback, 2 = Chat Bot, 3 = RCS Capability Check. |
name |
string | No | Human-readable template name. |
description |
string | No | Free-form note. |
tags / filterList / extraRecipientList |
array | No | Optional default audience targeting baked into the template. |
Inside content.flowSteps[], each step describes one channel send:
| Field | Meaning |
|---|---|
channelType |
Channel enum — 1 = SMS (see Channels). |
senderId |
An Active Sender ID for that channel. |
contentPattern |
The message body. Insert per-contact variables with {{attribute.name}} — they are filled from the recipient’s attributes. |
deliveryCondition |
When the step is considered done, e.g. DELIVERY_SUCCESS. |
timeout |
Seconds to wait before the step gives up (e.g. 172800 = 48h). |
Templates are managed with the full CRUD set: GET /broadcast/templates (list, with limit/offset), GET/PUT/DELETE /broadcast/templates/{id}. The numeric id returned here is what you pass as templateId when launching.
Marketing campaigns require a pre-approved template. Coordinate the text with your account manager before launch.
Broadcasts
A broadcast is one launch of a template against an audience. Create it with POST /broadcast/broadcasts.
POST https://client.routeon.io/api/v1/broadcast/broadcasts
X-API-Key: <API_KEY>
{
"templateId": 123,
"launchTime": "",
"webhook": "https://your.app/hooks/routeon",
"recipientsList": [ { "phoneNumber": "905063565285" } ]
}
| Field | Type | Required | Meaning |
|---|---|---|---|
templateId |
integer | No | Optional id of a saved template. Omit it and put the text in payload.content.flowSteps[].contentPattern instead. |
launchTime |
string | No | Empty string or a timestamp in the past = launch immediately; a future ISO-8601 timestamp = schedule. |
webhook |
string | Yes | Callback URL for campaign status events. |
recipientsList |
array | No | Explicit list of { "phoneNumber": "..." }. Alternatively target by tags/filterList defined on the template or contact base. |
A successful launch returns HTTP 200; the response body may be empty. Alaris also notifies by email (alert_emails). A status webhook is a Routeon addition, not described in the Alaris campaign response.
Broadcast statuses
Statuses follow Alaris sms_campaign.status_id:
status_id |
Status | Meaning |
|---|---|---|
| 0 | completed |
All recipients have been processed. |
| 1 | scheduled |
Waiting for launchTime. |
| 2 | failed |
The campaign could not be delivered. The message field carries the reason. |
| 3 | canceled |
The campaign was stopped before completion. |
| 4 | in progress |
Sending is in progress. |
| 5 | paused |
The campaign is paused. |
The campaign webhook is a single event per state change — not one event per recipient. For per-recipient delivery detail, use delivery statuses (per-message webhooks / EDRs).
Content templates (OMNI)
Separately from Broadcast templates, the single-message surface can reference stored content templates by id (GET /templates, and the template field on POST /messages). These are canned bodies for transactional sends and are not the same objects as Broadcast templates. WhatsApp additionally has Meta-approved templates via GET /wa_templates.
Related API
- API Reference → Campaigns & templates (
broadcast.yaml) - Guide: Launch an SMS campaign
- Contacts for audience targeting by tag/attribute/filter