Skip to content

SmsAddTemplate

POST sms/template

Creates a text template. Placeholders are written as {{name}} and filled from the data object at send time.

Binding a template to a triggerId is what turns it into an automatic notification: the module renders and queues it whenever that platform event fires, with no caller involved.

Access Control

Allowed role: admin. The template belongs to the brand of the caller.

Request

POST https://{broker_domain}/sms/template
{
  "name": "Deposit confirmed",
  "text": "{{name}}, your deposit of {{amount}} is confirmed",
  "language": "EN",
  "kind": "TRANSACTIONAL",
  "triggerId": 2
}
{
  "command": "SmsAddTemplate",
  "extID": "1",
  "data": {
    "name": "Deposit confirmed",
    "text": "{{name}}, your deposit of {{amount}} is confirmed",
    "language": "EN",
    "kind": "TRANSACTIONAL",
    "triggerId": 2
  }
}
const res = await platform.SmsAddTemplate({
  name: "Deposit confirmed",
  text: "{{name}}, your deposit of {{amount}} is confirmed",
  language: "EN",
  kind: "TRANSACTIONAL",
  triggerId: 2
});

Request Data

Field Type Required Description
name string Yes Template name, 1..255 characters
description string No Free-form note, up to 512 characters
text string Yes Message text with {{placeholders}}, 1..2000 characters
language string No Language code, default EN
triggerId int No Trigger that fires this template
profileId int No Restrict the template to one provider profile; omit to make it available to all
kind enum No TRANSACTIONAL or MARKETING (default)
status enum No ENABLED (default) or DISABLED

Behavior

  • The class matters more than it looks: a TRANSACTIONAL template keeps reaching customers who opted out of marketing and ignores send windows, so a confirmation code is not held until morning.
  • Placeholders are not validated against a schema — an unresolved one is reported at send time in missingPlaceholders and left visible in the text rather than silently blanked.
  • A template without profileId is offered for every profile of the brand; with profileId it appears only for that one.

Response Data

{
  "id": 4,
  "brand": "default",
  "name": "Deposit confirmed",
  "description": null,
  "text": "{{name}}, your deposit of {{amount}} is confirmed",
  "language": "EN",
  "kind": "TRANSACTIONAL",
  "triggerId": 2,
  "profileId": null,
  "status": "ENABLED",
  "createdAt": "2026-08-24 13:15:44"
}

Errors

Code Error Description
400 VALIDATION_ERROR Missing name or text, or text longer than 2000 characters
404 NOT_FOUND Trigger or profile not found in the brand