OTP Message Templates

Pick a template, put in your app name, and copy a one-time code text that follows the practices that keep codes readable and safe. English and Hebrew, with the segment count as you edit.

Runs in your browser. Nothing you type is sent anywhere.

Template
Your details

Adds the line browsers read to offer the code on that site only.

The 11 characters SMS Retriever looks for. The whole message must then fit 140 bytes.

The message

GSM-7 · 1 part

482913 is your Acme login code. It expires in 10 minutes. Never share it with anyone.

85 of 160 units used. Fits in one part.

What every template here does

  • Code first. It is the first thing in the lock screen preview.
  • Expiry stated. People know when to ask for a new code.
  • No links. A code text never asks anyone to tap anything.
  • Your name in it. The person knows which service sent it.
  • Do not share. The login template warns against passing the code on.
  • One part where possible. Short enough to arrive as a single message.

Code texts are service messages, so they do not carry an opt-out line. Reminders and marketing do: the appointment reminder generator adds one by default.

Related guides

Useful? Share it with someone who texts customers WhatsApp LinkedIn X Email

Questions

Why should the code come first?

The notification preview on a locked phone shows the first words of a text, and many people copy the code from there without opening the message. Putting the code first means it is always in the preview, even on small screens and in languages written right to left.

How long should a one-time code be?

Six digits is the usual balance: a million combinations, which with a short expiry and a limit on attempts is enough for logins, and still easy to type. The SMSNET OTP endpoint sends six digits by default and does not accept fewer.

Why state the expiry in the message?

People put the phone down and come back later. If the text says the code lasts ten minutes, they know to ask for a new one instead of typing an expired code and assuming your app is broken. Keep the number in the text equal to the real expiry.

Why no links in a code message?

A login text with a link teaches people to tap links in texts that claim to be from you, which is exactly what phishing relies on. A code with no link can only be typed into the screen that asked for it. Send the link by another channel if you need one.

What is the autofill line at the end?

A last line in the form @yourdomain.com #123456 lets Safari on iPhone and Chrome on Android offer the code above the keyboard, and only on that website. It is optional, it costs a few characters, and the domain must be the one the user is signing in on.

What is the app hash for?

An Android app using SMS Retriever reads the code by itself, with no permission, if the text holds the app's 11-character hash and is at most 140 bytes. The hash goes on its own line above the autofill line, so one message can serve Android apps, Chrome and Safari at once.

Why does Hebrew fit so much less?

One Hebrew letter switches the whole message to an encoding that takes two bytes a character, so 140 bytes is about 70 characters instead of 160, and the hash and the domain line count too. The check on this page counts it the same way the server does.

How do I send this format through the API?

Pass the text as template with {code} in it, plus presets (sms_retriever, webotp, ios_domain), app_hash and domain, to POST /api/v1/otp/send. Over 140 bytes with sms_retriever is refused, so a code never goes out in a form the phone will not read.

Does this page send anything?

No. It only builds the text. To send it, call POST /api/v1/otp/send, which creates the code, sends it from your own phone and lets you check it with POST /api/v1/otp/verify, or render the text yourself and use the regular send endpoint.

More free SMS tools

Send codes from your own number: free plan

Includes the OTP send and verify endpoints. 1 line, 300 messages a month, no card required.

Start free