Skip to content

Use cases

Account takeover signals from IP, phone and email

Use IP risk flags, line type, porting status and email checks to decide when a login or a contact change needs extra proof, without locking out users.

Updated 2026-11-23

Account takeover happens when someone other than the owner gets into an account, usually with a stolen password, then locks the owner out by changing the email or the phone number. Most of the defense belongs to your own authentication and monitoring. Validation signals help in one specific place: deciding when an event is unusual enough to ask for more proof.

The problem

Attackers rarely stop at login. The pattern that does damage is a login followed by changes:

  • The login arrives from a hosting network, a Tor exit or an address with a risk level the account has never shown.
  • The email on the account is replaced with a disposable inbox the attacker controls.
  • The phone number is replaced with an internet-telephony number, so the one-time codes now go to the attacker.
  • A payout, address or recovery option is changed shortly after.

Each step has a validation signal. None of them is proof, which is why they feed a step-up rule rather than a block.

The flow

  1. At login. Look up the IP address with the IP endpoint. Compare country.code and asn.type with what you remember for the account. A new country on a hosting network is worth a second factor. Results are cached for 7 days, so frequent users do not cost extra.
  2. At a contact change. When a user replaces the email or the phone number, validate the new value before saving it, with the email and phone endpoints.
  3. Confirm the new contact. Send a link or a code to the new value, and notify the old one. Validation checks the data; confirmation proves control.
  4. At recovery. Before sending a reset code to a phone, use a live lookup to read line_type and ported, and decide whether the number is fit for account recovery.
  5. Hold sensitive actions. After a contact change, delay payouts, address changes or API key creation for a period of your choosing, and log the signals you used.
  6. Keep the evidence. Store the signals with the event so a support agent or an analyst can review it later.

Decision table

Signal Field Action
Login from a Tor exit node flags.tor: true Step up: require a second factor
Login from a hosting network flags.datacenter: true or asn.type: hosting Step up
Known VPN or proxy network flags.vpn or flags.proxy: true Step up if another signal is present, otherwise allow
High IP risk risk.level: high Step up, hold sensitive actions
Country differs from the account's usual one country.code Step up
New email is disposable checks.disposable: true Block the change, or review
New email cannot receive mail status: undeliverable Block the change
New phone is internet telephony line_type: voip Step up: require another channel to confirm
New phone is premium rate or invalid line_type: premium_rate, status: invalid Block the change
Recovery number was ported ported: true (live level) Step up, as one signal among others
Several of the above at once Combination Review, and hold sensitive actions

A false flag means "not detected". Residential proxies are generally not detectable, so a clean IP result never replaces your own checks.

Example

A user has just asked to replace the recovery phone number. Before sending a code to the new number, the server checks it at the live level:

bash
curl https://api.qelka.com/v1/phone \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone": "+14155550123", "level": "live"}'

The part of the response that drives the decision:

json
{
  "object": "phone",
  "status": "valid",
  "e164": "+14155550123",
  "line_type": "voip",
  "carrier": { "name": "Example Telecom", "source": "live" },
  "ported": true
}

Values are illustrative. The number is real, but it is internet telephony and was ported. Neither fact is damning. Together with a login from a new country five minutes earlier, they are enough for the server to require confirmation from the old email address, notify the owner and delay payouts.

The IP check for that login comes from the same API:

bash
curl https://api.qelka.com/v1/ip \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ip": "8.8.8.8"}'
json
{
  "object": "ip",
  "country": { "code": "US", "name": "United States" },
  "asn": { "number": 15169, "org": "Google LLC", "type": "hosting" },
  "flags": { "tor": false, "vpn": false, "proxy": false, "datacenter": true },
  "risk": { "score": 35, "level": "medium" }
}

What it costs

An IP lookup costs 1 credit, a basic phone check 1, a live phone lookup 3 and an email check 1. Errors are not billed, and neither is the 422 returned for private addresses, which is common in local development. Run the live lookup only on the events where the carrier matters, such as recovery and contact changes. Full prices are on the pricing page; the free plan includes 100 credits a month.

Frequently asked questions

Can an API detect account takeover on its own?
No. Account takeover shows up in behavior: a login from a new place, a password reset followed by a contact change, a burst of failed attempts. Network, phone and email checks add context to those events, such as whether the login comes from a hosting network or the new number is internet telephony. They support your rules; they do not replace multi-factor authentication or your own anomaly detection.
Does a VPN flag mean the login is an attack?
No. Many legitimate users sit behind VPNs, corporate proxies and mobile carrier networks. Treat the flag as a reason to ask for one more proof, such as a code, when it appears together with another signal like a new device or a changed phone number. Blocking on the flag alone locks out real customers and teaches attackers to use residential proxies, which the flags do not detect.
What does the ported field tell me?
At the live level, ported: true means the number has been moved away from the carrier its range was first assigned to. It says nothing about when, or why, and most porting is ordinary. It is not a SIM-swap detector. Use it as one signal next to others, for example before trusting a freshly changed number for account recovery.
How much do these checks cost per login?
An IP lookup costs 1 credit and results are cached for 7 days, so repeat logins from the same address are served from the cache. A phone check costs 1 at the basic level or 3 at the live level, and an email check 1. Run the paid checks on risky events such as contact changes, not on every login.

Put this check in your product

Get an API key in under a minute. 100 free credits every month, no card required.

  • 100 free credits a month
  • No card
  • Test keys spend nothing
  • Cancel any time