Detect if a SIM Card Was Recently Swapped

Overview

SIM Swap Detection is used to confirm if a wireless carrier has recently (within 7 days) issued a new SIM to an existing account. This check is important as a legitimate user's account might be hijacked by an attacker and used for fraudulent activities.

Before you get started, sign up for a Vonage API account, if you haven't already.

Detecting SIM Swap Status

curl -X 'POST' \ 'https://api.nexmo.com/v2/ni' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Basic <token>' \ -d '{ "type": "phone", "phone": "447009000000", "insights": [ "sim_swap" ]}'

Be sure to replace the placeholder <token> in the snippet above with your Base64 encoded API key and secret, joined with a colon.

The SIM Swap request is a POST request with the insight type passed in as the request body.

You may check for the SIM Swap status as shown above or for a Fraud Score by specifying the fraud_score keyword in the insights request body array.

Do note that you can also check both the SIM Swap and Fraud Score status all in one request by passing both insight keywords into the request body i.e: sim_swap and fraud_score. See the API reference to learn more.

Response interpretation

{
  "request_id": "3f92ed75-e624-4503-abbd-a93d6b442571",
  "type": "phone",
  "phone": {
    "phone": "16197363066",
    "carrier": "Google (Grand Central) - SVR",
    "type": "VOIP"
  },
  "sim_swap": {
    "status": "completed",
    "swapped": false
  }
}
  • Swapped: This returns true (Boolean) if the phone number in question has been swapped within the last 7 days.
  • Status: This reflects the current state of the request, with complete signifying the completion of the request.

Reference

Visit the API Reference to get a detailed understanding of the request above.

What next?

You can get a Fraud Score check to determine how likely a number is to be involved in fraudulent activities.