Skip to content

SMS ​

Send an SMS with "channel": "sms" in POST /v1/messages, either with an SMS template or with an own text.

json
{
  "channel": "sms",
  "to": "+5511912345678",
  "template": "deposit_reminder",
  "language": "en",
  "variables": { "name": "Ann", "amount": "$50.00" }
}
json
{
  "channel": "sms",
  "to": "+5511912345678",
  "text": "Your ACE SEND code is 482913. It expires in 10 minutes.",
  "reference": "otp-7781"
}

Own text ​

An own text (one-time codes, transactional notices) needs the permission of your account — ask your manager. Without it the request gets 403 free_text_not_allowed. Send either template or text, never both: text takes no language or variables.

Segments and encoding ​

A long SMS is sent and priced in parts — segments. The encoding depends on the characters:

EncodingWhenOne SMSEach part of a longer one
gsm7only characters of the GSM 03.38 alphabet (Latin letters, digits, common punctuation)160 characters153
ucs2any other character: Cyrillic, emoji, ã, ç…70 characters67
  • In gsm7 the characters ^ { } [ ] ~ \ | € and the form feed count as two.
  • In ucs2 an emoji counts as two.
  • A line break is one character (\n); \r\n is two.

The message tells you what it took: segments and encoding. The price of an SMS is the price of one segment times segments. A text over 6 segments is refused with 422 message_too_long; the problem carries segments and max_segments.

Keeping a text in gsm7 keeps it cheaper: one ç turns a 160-character SMS into three segments.

Sender name ​

The SMS goes out from a sender name of your account (from in the message). You do not pass it: ACE SEND takes the name registered for the country of the number — your own name if your account has one there, otherwise the shared ACE SEND name. Sender names are ordered and managed in the console. If no name is available for the country, the request gets 422 destination_unavailable.

Test messages have from: null.

Statuses ​

SMS go through queued, submitted, sent and delivered, or fail with rejected, failed or expired. Networks do not report reads: an SMS is never read and never sends message.read. A wrong sender name fails with the code sender_rejected.

ACE SEND API v1