All use casesUse case

Two-factor SMS: one-time codes that arrive

You have a login form and need a second factor your users can manage. Everyone can use SMS. Here is the flow, what telkit does in it, and why SMS should not stand alone.

Last reviewed 14 October 2026

The problem

The code must arrive within seconds or the user gives up. And a code you cannot confirm was delivered is a support ticket waiting to happen.

With telkit

telkit neither makes the code nor checks it. Your backend does, where the secret belongs. telkit sends the message from your name and tells you whether it was delivered or failed.

The flow

Example flows

  1. 1The backend makes six digits from a cryptographically random source and stores a hash of the code with an expiry and an attempt counter.
  2. 2The backend sends the code through telkit, with the login attempt's id as the Idempotency-Key.
  3. 3The user types the code. The backend compares, counts the attempt and deletes the code after the first correct use.

The services that do the job

Everything below is part of the SMS service.

  • Sender nameThe code comes from the name of your service, 3 to 11 characters. We approve each name before it is used.SMS
  • Status per messagesms.status says whether the code was sent, delivered or failed, with the operator's reason when it failed.SMS
  • Limits against abuseSet a monthly limit in kroner. The company also has a limit on SMS units per day, and the send answers limit_reached when a limit is hit.SMS
  • Test keyWith a test key you test the login from end to end, for free. Send the code to your own mobile number and it arrives on your phone.SMS

API

What the request looks like

POST /v2/smsbash
curl https://api.telkit.no/v2/sms \  -H "Authorization: Bearer $TELKIT_API_KEY" \  -H "Idempotency-Key: otp-login-8f3a2c" \  -H "Content-Type: application/json" \  -d '{    "from": "Minside",    "to": "+4791234567",    "text": "123456 er koden din til Minside. Den gjelder i 5 minutter.",    "reference": "innlogging-8841"  }'

Prices

What it costs

A code message is short and uses one SMS unit.

Work out your price
SMS sent, per unit
NOK 0.69

10,000 code logins a month cost NOK 6,900 excl. VAT.

All prices exclude VAT.See the full price list

What to watch out for

  • Never put a link in a code message. A user who is used to tapping links in such messages is halfway fooled the next time someone sends a fake.
  • SMS is the weakest of the common second factors. A SIM swap moves the number to the attacker, and a fake login page can ask for the code and use it at once. Passkeys and authenticator apps do not have that problem.
  • If you handle money or sensitive personal data, make SMS the fallback rather than the main route.
  • Set a limit per number and per IP address. Without it you pay for every code an attacker requests.
  • Name your service in the message, and keep the code short-lived, for example five minutes.

Questions about two-factor SMS

  • Does telkit make the code for me?
    No. Your backend makes and checks the code. telkit sends the message and tells you whether it was delivered.
  • Is SMS safe enough as a second factor?
    It is better than a password alone, but weaker than passkeys and authenticator apps. Use SMS for the users who cannot get on with the others.
  • How long should the code be valid?
    Five minutes is common. The code should stop working after its first correct use, and after three wrong attempts.
  • Can I send the code to a number outside Norway?
    Yes, on request. We can send to 31 countries besides Norway, and open a country for your company when you ask for it in the dashboard. The prices per country are on the pricing page.
  • What do I do about users who never get the code?
    Look at sms.status for the message. If it failed, offer a new code or another method. If it arrived, the fault is elsewhere, for example a wrong number.

Send your first code

Register your company, apply for your sender name and test the whole login with a test key.