A domain-bound one-time code is a normal code text with one extra last line: @example.com #123456. That line names the website the code is for and repeats the code, so the phone offers to autofill it only on the matching site. It's a form of origin-bound code, and it makes a stolen or phished code much less useful.

This post shows how to format the body, what the text costs in segments and how to send it with POST /v1/messages from a login and verification campaign. Platform behavior changes, so wherever we're not certain we say so and point you to Apple's and Google's current documentation.

What "domain-bound" means

A regular code text, like "Your code is 482913," can be autofilled anywhere the phone thinks a code is expected. That includes a lookalike site that asks for your code.

A domain-bound text adds the origin. The phone reads the last line, sees @acme.example, and offers the code only when the user is on that site. A code that arrives for a phishing page won't match, so autofill stays quiet and the user has a reason to stop.

It doesn't replace good security. It's one more check that costs you a line of text.

The format

The pattern has two parts:

  • A human-readable line, with the code and a short note about expiry.
  • A last line that starts with @, then your domain, then a space, then # and the code.

For a site at acme.example, the body looks like this:

Your Acme code is 482913. It expires in 10 minutes.

@acme.example #482913

A few rules keep it working:

  • Put the domain line last. Phones look for it at the end of the message.
  • Use the exact domain the user types into their browser, with no https:// and no path.
  • Repeat the same code after the #, with no spaces inside it.
  • Keep a blank line between the readable text and the bound line.

For the exact rules each platform follows, check Apple's and Google's current docs. Support differs by operating system version and by browser, and we won't promise more than they do. Our post on OTP autofill formats for Android and iOS covers the Android app-hash side.

Segment math

The example body above is 74 characters. A segment holds 160 GSM-7 characters, so this is one segment, and it costs $0.0075 plus the $0.0045 carrier fee: one segment × ($0.0075 + $0.0045) = $0.012, not counting screening.

Ready's all-in prices per segment include the carrier fee but not screening: Scrub lists and Number validation, the two switches in Settings under Compliance, each add $0.003 per segment when switched on, shown as screening on your bill, and both are off by default. Unless you turn the opt-out footer off, the first text to each contact, and one again from time to time, also gets "Reply STOP to opt out" and your business name if the message does not already have them, so a text close to the segment limit can bill one more segment.

Accounts opened before 17:55 UTC on November 12, 2026 keep their signup prices, shown under Billing, and so do the sub-accounts they open.

Keep it plain, because a few things push a code text into a second segment:

  • An emoji or other non-GSM character. The limit drops from 160 characters to 70, and from 153 to 67 once a message runs long. A friendly emoji in a code text can double the bill. Ready swaps curly quotes, long dashes and ellipses for plain ones, so those won't change the count.
  • A long brand line. A 100-character sentence plus a 25-character domain line is fine. A 150-character sentence isn't.
  • The opt-out footer. Unless the account turns it off, Ready adds "Reply STOP to opt out" and the business name to the first text to each contact, and again from time to time. That text counts toward the segment, so a code text near the limit can bill one more segment on that first send.

Segments are what count, not messages. For a verification flow with 10,000 logins a month, a 1-segment text costs 10,000 × ($0.0075 + $0.0045), and a 2-segment text costs twice that. Trimming the readable line is the cheapest optimization you have.

Set up the campaign first

Code texts need the right registration. Once your brand is approved, add a campaign from Registration, then Add campaign, and pick "Login and verification codes." Over the API, the campaign's use_case is TWO_FACTOR_AUTH. The registration endpoints are described in the registration docs.

A campaign with the right use case matters because carriers compare your traffic to what you told them. A login code sent from a marketing campaign is the kind of mismatch that gets filtered.

Registration costs $25 a month for the brand and its first campaign, plus $20 a month for each extra campaign and $2 a month per number. Most approvals take 1 to 14 days. Our guide to OTP and verification through an SMS API covers the wider flow.

Send it with POST /v1/messages

Send the body as an ordinary text. The domain-bound line is just the last line of body.

POST https://api.tryready.com/v1/messages
X-API-Key: <your key>
Idempotency-Key: <one new UUID per code>
Content-Type: application/json

{
  "to": "+12125550199",
  "body": "Your Acme code is 482913. It expires in 10 minutes.\n\n@acme.example #482913",
  "consent_attested": true
}

Four details worth keeping:

  1. Generate the code on your server, store only a hash of it and check it on your server. The text is a delivery method, not the security model.
  2. Use a new Idempotency-Key for each code. Reuse a key only to retry a request that got no answer, such as a timeout. If you reuse it to send a fresh code, the API replays the first answer and sends nothing.
  3. Set consent_attested to true only when the user agreed to receive texts, which a login form can capture at sign-up.
  4. Don't retry a refusal in a loop. An opted-out number is refused and not charged.

Leave from out and Ready picks the number: the one this contact already texts with, or your primary number. For a user's first code, that's your primary number.

Test before you ship

  • Send a code to an iPhone and open your site in Safari. Check that the code is offered.
  • Send one to an Android phone and open your site in Chrome. Check Google's current documentation for what to expect.
  • Open a different site, or a lookalike, and confirm no autofill is offered.
  • Count the characters of your longest real message, including the domain.

Frequently asked questions

What is the domain-bound OTP format?

It's a normal code text with a last line that reads @yourdomain.com #123456. The @ names the site, and the # repeats the code, so the phone offers autofill only on that site.

Does domain-bound autofill work on every phone?

Not everywhere in the same way. iOS and Chrome support it, but behavior changes by version, so check Apple's and Google's current docs and test on real devices.

How many segments is a domain-bound OTP?

Usually one. A message under 160 GSM-7 characters is one segment, and the bound line adds only about 20 characters. An emoji drops the limit to 70, so avoid them.

Do I need a special campaign to send codes?

Yes. Add a Login and verification codes campaign after your brand is approved, or file it over the API with the TWO_FACTOR_AUTH use case. It keeps your traffic matched to what carriers expect.

The takeaway

One extra line makes your code safer on the right site and useless on the wrong one. Keep the text short, bind it to your domain and send it from a campaign built for codes. When you're ready to try it, sign up, register your brand and add a verification campaign.