SMS in Yandex Cloud Notification Service
With Cloud Notification Service, you can send text messages (SMS)+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
The service is subject to limitations. For more information, see Yandex Cloud Notification Service quotas and limits.
You can create multiple SMS notification channels with different 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
SMS notification channels can use the following types of senders:
Shared 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 can contain only one SMS notification channel with a shared sender.
- A channel can only operate in a sandbox with a limited number of test phone numbers.
Individual sender
Note
Businesses and individual entrepreneurs can register an individual sender name.
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 you can send SMS to any Russian phone numbers in 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, one sender's text name can correspond to one SMS notification channel.
Sender's text name is registered via support.
Note
Registering a sender's text name may take from 2 to 4 weeks.
The SMS notification channel with an individual sender is originally created in the sandbox.
SMS templates
SMS templates help you optimize costs by detecting the type of each SMS notification, which directly affects the cost 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 an SMS template in the management consoleRegistering status and submitted for registration with telecom providers. A supportActive status.
To delete a template with the Active status, you must first 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 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
An SMS template text may contain letters, digits, and special characters1. 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 elements1.
The template may include the following placeholder variables:
|
Variable |
Description |
|
|
Any continuous sequence of letters, digits, or special characters1. |
|
|
A limited sequence of one to
|
|
|
Any continuous sequence of digits or special characters1. |
|
|
A limited sequence of one to
|
|
|
A sequence of numbers (digits or special characters1), separated by one or more spaces. |
1 Sequences matching %d and %w may also include the following special characters: !, №, #, %, ., ,, :, ;, ?, \, /, (, ), +, -, “, ”, ―, _, ', ", `, &, ^, {, }, [, ], <, >, and .|, @, $, =, ~, and *.
Note
The %w+ variable is not allowed.
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.
Defining the SMS notification type from a template
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 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, 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.
Warning
Before sending, make sure your SMS text conforms to the intended template.
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
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.