[Yandex Cloud documentation](../../index.md) > [Yandex Cloud Notification Service](../index.md) > [Concepts](index.md) > SMS

# SMS in Yandex Cloud Notification Service


With Cloud Notification Service, you can send [text messages (SMS)](https://en.wikipedia.org/wiki/SMS) using _SMS notification channels_. Russian phone numbers in [E.164](https://en.wikipedia.org/wiki/E.164) format are supported, e.g., `+79991112233`. SMS messages are signed with sender text names. The maximum length of one SMS is 160 Latin characters or 70 Cyrillic characters. Longer texts are sent using multiple SMS messages.

{% note info %}

The service is subject to limitations. For more information, see [Yandex Cloud Notification Service quotas and limits](limits.md).

{% endnote %}

You can create multiple SMS notification channels with different [senders](#senders). One of the channels is set as the default one. This channel will be used to send SMS messages if no channel is specified in the API request or AWS CLI command.

## Senders {#senders}

SMS notification channels can use the following types of senders:
* [Shared sender](#common-sender)
* [Individual senders](#individual-sender)

### Shared sender {#common-sender}

An SMS notification channel with a _shared sender_ is a good option for testing the service's features and has the following advantages:
* You do not have to register the sender's name with the telecom operator.
* No monthly subscription fee is charged.

There are restrictions in place for this type of sender:
* All SMS messages are signed with a shared service name.
* Promotional SMS messages are not allowed.
* A [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud) can contain only one SMS notification channel with a shared sender.
* A channel can only operate in a [sandbox](sms.md#sandbox) with a limited number of test phone numbers.

### Individual sender {#individual-sender}

{% note info %}

Businesses and individual entrepreneurs can register an individual sender name.

{% endnote %}

An SMS notification channel with an _individual sender_ is suitable for the product environment and has the following advantages:
* All SMS messages are signed with the sender's unique text name.
* After leaving the [sandbox](#sandbox) you can send SMS to any Russian phone numbers in [E.164](https://en.wikipedia.org/wiki/E.164) format.

There are restrictions and rules in place for this type of sender:
* The sender's text name will be registered with the service provider.
* You will be charged a monthly subscription fee for using the sender's text name.
* In the [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud), one sender's text name can correspond to one SMS notification channel.

Sender's text name is registered via support.

{% note info %}

Registering a sender's text name may take from 2 to 4 weeks.

{% endnote %}

The SMS notification channel with an individual sender is originally created in the [sandbox](sms.md#sandbox).

#### SMS templates {#templates}

_SMS templates_ help you optimize costs by detecting the type of each SMS notification, which directly affects the [cost](../pricing.md) of sending.

* `Transaction`: Used to notify about financial transactions, e.g., crediting, debiting, transfer, and reservation of funds, accrual of interest on deposit, etc.
* `Service`: Used to notify users about the status of services, maintenance works, terms of service updates, etc.
* `Authorization`: Used to send data required for various authorization procedures, verifications, confirmations of actions/transactions, or consents.

If an SMS notification does not fall under any of these types, it is treated as _advertising_ by default.

SMS templates are only used in SMS notification channels with an individual sender.

You can [create](../operations/sms/manage-templates.md#create) an SMS template in the [management console](https://console.yandex.cloud). Upon creation, the template is assigned the `Registering` [status](#template-status) and submitted for registration with telecom providers. A [support](https://center.yandex.cloud/support) ticket will be created at the same time. Registering a template takes two to four weeks. Once all telecom providers complete template registration, the template switches to the `Active` status.

To delete a template with the `Active` status, you must first [deregister](../operations/sms/manage-templates.md#deregister) it with the telecom providers. In this case, the template status becomes `Deregistering`. Once all telecom providers complete template deregistration, the template switches to the `Deregistered` status, at which point you can [delete](../operations/sms/manage-templates.md#delete-deregistered) the template in Cloud Notification Service.

If you want to delete a template in the `Registering` status, cancel its registration first. To do this, write about your intention in the support ticket that was previously generated when creating the template.

If the template has not been used for two months, it may be automatically unregistered by the telecom providers and deleted from Cloud Notification Service.

#### Template content {#template-contents}

An SMS template text may contain letters, digits, and special characters^1^. The template text must not:

* Contain any non-standard spaces (e.g., non-breaking spaces)
* Start or end with a space
* Include two or more consecutive spaces
* Include special characters beyond those allowed in placeholder elements^1^.

The template may include the following placeholder variables:

#|
||
**Variable** | **Description**
||
||
`%w` {align="center"} | Any continuous sequence of letters, digits, or special characters^1^.
||
||
`%w{1,n}` {align="center"}
|
A limited sequence of one to `n` words, separated by one or more spaces. The following conditions must be met:
* Words may consist of letters, digits, or special characters^1^.
* `n` must be between `2` and `20`.
||
||
`%d` {align="center"} | Any continuous sequence of digits or special characters^1^.
||
||
`%d{1,n}` {align="center"}
|
A limited sequence of one to `n` numbers, separated by one or more spaces. The following conditions must be met:
* Numbers may consist of digits or special characters^1^.
* `n` must be between `2` and `20`.
||
||
`%d+` {align="center"} | A sequence of numbers (digits or special characters^1^), separated by one or more spaces.
||
|#

^1^ Sequences matching `%d` and `%w` may also include the following special characters: `!`, `№`, `#`, `%`, `.`, `,`, `:`, `;`, `?`, `\`, `/`, `(`, `)`, `+`, `-`, `“`, `”`, `―`, `_`, `'`, `"`, `` ` ``, `&`, `^`, `{`, `}`, `[`, `]`, `<`, `>`, and `.|`, `@`, `$`, `=`, `~`, and `*`.

{% note info %}

The `%w+` variable is not allowed.

{% endnote %}

{% cut "SMS template examples" %}

**Transaction template:**

```
Operation: withdrawal of %d RUB. Card *%d. Balance: %d RUB. %w
```

SMS notification example:

```
Operation: withdrawal of 1500 RUB. Card *4321. Balance: 8500 RUB. Store
```

**Service template:**

```
Dear customer! On %d from %d to %d, maintenance work will be performed. The %w service will be unavailable.
```

SMS notification example:

```
Dear customer! On 20/03/2026 from 02:00 to 06:00, maintenance work will be performed. The internet banking service will be unavailable.
```

**Authentication template:**

```
Verification code: %d. Do not share this code with anyone.
```

SMS notification example:

```
Verification code: 123456. Do not share this code with anyone.
```

{% endcut %}

#### Defining the SMS notification type from a template {#sms-type-detection}

When sending an SMS notification, Cloud Notification Service automatically matches the message text to a registered template and applies pricing based on the template type. Only templates with the `Active` [status](#template-status) are considered for matching. When matching a SMS notification text to templates, the following order applies:

* Service notification templates.
* Authentication notification templates.
* Transaction notification templates.

The notification text must exactly match the template, including the character case, the number and type of spaces; also, the text must not contain any undefined special characters.

The SMS type is defined according to the first matching template. If no match is found, the message is classified as promotional.

During [sending](../operations/sms/send.md), you can explicitly specify a template ID using the `CNS.SMS.TemplateARN` attribute. If the message text does not match the specified template, the message will not be sent.

{% note warning %}

Before sending, make sure your SMS text conforms to the intended template.

{% endnote %}

#### Template status {#template-status}

A template can have one of the following statuses:

* `Registering`: Template is being registered with telecom providers.
* `Active`: Template can be used for sending SMS notifications.
* `Deregistering`: Template is being deregistered (unregistered) with telecom providers. Deregistration is required before deleting the template from your Cloud Notification Service.
* `Deregistered`: Deregistration with telecom providers is complete. You can now delete the template in Cloud Notification Service.

## Sandbox {#sandbox}

A _sandbox_ is a test environment, in which you can send SMS messages only to _test phone numbers_.

Each test phone number is registered in a channel using a confirmation code from an SMS. By adding a number, you agree to receive messages to it.

You can delete a test phone number 24 hours after adding it. To add this number again, you will need to reconfirm it.

For channels with an individual sender, you can contact support to exit the sandbox mode.

You can also request an increase in the service quotas together with your request to exit the sandbox mode.

#### Useful links {#see-also}

* [Service overview](index.md)
* [Getting started with SMS](../quickstart-sms.md)
* [Getting started with the service via the AWS CLI](../tools/aws-cli.md)
* [Push notifications](push.md)