SMS OTP
The channel is built, but no SMS goes out yet. It will come with the paid plans, from Starter, and each message will be paid from prepaid balance.
How it works
An OTP code confirms that whoever signs in has the person's phone. With Tellwing the split is clear: your system generates and checks the code, and Tellwing delivers it by SMS.
- 1
You generate the code
Your system creates the one-time code, stores it with its expiry and decides how many attempts to allow. Tellwing doesn't generate or check codes.
- 2
You send it through the API
One request to
POST /v1/smswith the number, the text and theotptype. - 3
Tellwing delivers it
The message goes to the carrier and the response brings the send's id, the segments charged and the encoding.
- 4
The person types it
Your system compares what they type with what it stored. If it expired or they got it wrong too many times, you generate a new one.
The request
With an API key: tw_live_… live, or tw_test_… to test without sending anything.
The response comes back with status 202:
Always send Idempotency-Key: if your system retries the request, Tellwing replays the same response and doesn't send two codes. With the send's id, GET /v1/sms tells you whether the message was sent, delivered or failed. The full reference is in the API documentation.
Limits and rules
- Colombia only, for now. A number from another country returns a 400 error and nothing is sent.
- Per-number limit. With the
otptype, the limit of messages per hour to the same number is stricter than for a notice, to stop anyone requesting codes nonstop. - Up to 10 segments. A code fits in one; the text accepts up to 1,600 characters.
- Not advertising. A code needs no SMS permission from the contact, and neither the advertising hours of Colombia's Law 2300 nor the CRC's excluded-numbers registry apply. The Terms prohibit using this send for promotions.
- Privacy. Tellwing doesn't store the number or the text of the message.
- Key permission. The key needs the
sms:sendpermission.
Best practices
How many digits to use, how long the code should last, how many attempts to allow and what to say in the message are in the guide to SMS verification codes.
For the text, keep it to the essentials: your brand, the code and the expiry. For example: “Your Tienda Andina code is 482913. It expires in 10 minutes.” Without emojis or accents it fits in one segment of up to 160 characters.
What each code costs
A code is charged like any SMS: $0.08 per segment to Colombia. It almost always fits in one:
| Message | Encoding | Segments | Cost |
|---|---|---|---|
| «Your Tienda Andina code is 482913. It expires in 10 minutes.» | GSM-7 | 1 | $0.08 |
| «Your Tienda Andina code is 482913 🔒» | UCS-2 | 1 | $0.08 |
| «482913 is your Tienda Andina code. Don't share it with anyone: no one from Tienda Andina will ever ask for it. It expires in 10 minutes. 🔒» | UCS-2 | 3 | $0.24 |
The price per country and how you pay are on SMS pricing.
Frequently asked questions
Does Tellwing generate and check the code?
No. Your system generates the code, stores it and checks it; Tellwing only delivers the SMS.
How much does it cost to send an OTP code by SMS?
$0.08 per segment to Colombia. A short code takes one segment: up to 160 characters without accents or emojis, or 70 with any.
Which countries can I send codes to?
For now, only Colombia. A number from another country returns an error and nothing is sent.
When can I start sending codes?
Soon: the channel is built, but no SMS goes out yet.
Does Law 2300 apply to verification codes?
No. A verification code is not advertising, so neither the advertising hours of Law 2300 nor the CRC's excluded-numbers registry apply.