Fraud Prevention
How to detect a SIM swap before sending an SMS OTP
To detect a SIM swap before sending an SMS OTP, check the user's phone number with a SIM swap API at the moment they request a code, then act on the answer: send the code on NO_SWAP, block it and switch channel on SWAPPED, and treat UNKNOWN as no answer rather than a pass. The check has to run before the OTP goes out, because after a swap the attacker, not your user, receives the code. Telebase offers a SIM swap detection API for this use case; see also account takeover prevention and how to read swap age. Sandbox access is self-serve.
How SIM swap fraud works
An attacker obtains enough personal information to convince a mobile operator, or a rogue employee at one, to transfer the victim's number to a new SIM. The transfer takes effect quickly. From that point, the attacker receives all SMS messages and calls destined for that number, including OTPs sent by banks, exchanges and payment apps.
The victim typically does not notice immediately. Their phone loses signal, which they may attribute to a network issue. By the time they report it, the attacker has already passed SMS 2FA and accessed the account.
SIM swap fraud is particularly common in account takeover attempts against fintech and crypto platforms, where the payout from a single successful attack is high relative to the effort required.
Why checking at the point of OTP dispatch matters
The OTP itself is the vulnerability. Sending it to a swapped number hands the attacker the credential they need. The check therefore needs to happen before the OTP is sent, not as a post-incident forensic step. A SIM swap signal, queried at the moment the user requests a code, gives you the information at the point where it is still actionable.
If a recent swap is detected, the right response is to block the OTP and route the user through a different verification channel, such as a video call or document re-submission, rather than proceeding as normal.
What signals to check
Alongside SIM swap detection, several signals from a single carrier lookup reduce risk at authentication:
- Carrier: a sudden carrier change on an existing account is consistent with a port-out, which precedes some SIM swap patterns
- Country: a number now registering in a different country from the account's last known location is an anomaly signal
These signals are returned by the Telebase API at €0.20 per SIM swap answer, carrier data included, no annual commitment.
What a lookup returns
A single call returns every signal above in one response.
{
"phoneNumber": "+447700900002",
"active": true,
"carrier": "Telebase Test Carrier",
"country": "GB",
"numberType": "mobile",
"simSwap": "NO_SWAP",
"simSwapAt": "2026-09-22T09:16:03.003Z",
"simSwapPeriod": "PT240H",
"_meta": { "environment": "test", "activeSource": "SYNTHETIC" },
"chargedCents": 0,
"currency": "EUR"
}
How to detect a SIM swap before the OTP is sent
Call the Telebase lookup endpoint with the user's phone number at the moment they request a code. Read the simSwap field in the response: NO_SWAP means no recent swap was detected and the OTP can proceed. SWAPPED means a recent swap was detected and the OTP should be blocked, routing the user to an alternative verification channel instead. If simSwap is UNKNOWN, no answer was available. It is not charged and does not mean there was no swap, so fall back to the other signals in the same response.
Even without a SIM swap result, the other fields in the same call help reduce risk at the point of OTP dispatch. A carrier or country change since the last known state is consistent with a port-out. These signals come with every lookup and run in a single call.
What to do with each result
- NO_SWAP: no swap was detected in the 10-day window. Send the OTP as normal.
- SWAPPED: a swap was detected in the window. Do not send the OTP. Route the user to another verification channel, and use
simSwapAtwhen it is present to judge how recent the swap was (see how to read swap age). - UNKNOWN: the provider had no answer. It is free and does not mean no swap. Fall back to your other signals rather than sending the code on trust.
curl -s 'https://app.telebase.io/v1/lookup?phone=%2B447700900001' \ -H 'Authorization: Bearer tb_test_xxxxxxxxxxxxxxxxxxxxxxxx'
In the sandbox, +447700900001 returns SWAPPED, +447700900002 returns NO_SWAP and +447700900003 returns UNKNOWN. Sandbox lookups are free and use simulated data.
SIM swap detection
Telebase detects recent SIM swaps with a single API call. It returns SWAPPED or NO_SWAP for a fixed 10-day window, with the time of the swap where the provider supplies it.
If you want to implement SIM swap checking before an OTP is sent, read what SIM swap detection is and how to choose a SIM swap API while you evaluate data sources, then create a sandbox account.
Get sandbox access