Number Portability Check
curl --request POST \
--url https://platform.otpless.app/v1/telecom/portability \
--header 'Content-Type: application/json' \
--header 'clientId: <api-key>' \
--header 'clientSecret: <api-key>' \
--data '
{
"phoneNumber": "917020141726"
}
'import requests
url = "https://platform.otpless.app/v1/telecom/portability"
payload = { "phoneNumber": "917020141726" }
headers = {
"clientId": "<api-key>",
"clientSecret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
clientId: '<api-key>',
clientSecret: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({phoneNumber: '917020141726'})
};
fetch('https://platform.otpless.app/v1/telecom/portability', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.otpless.app/v1/telecom/portability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '917020141726'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"clientId: <api-key>",
"clientSecret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.otpless.app/v1/telecom/portability"
payload := strings.NewReader("{\n \"phoneNumber\": \"917020141726\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("clientId", "<api-key>")
req.Header.Add("clientSecret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://platform.otpless.app/v1/telecom/portability")
.header("clientId", "<api-key>")
.header("clientSecret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"917020141726\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.otpless.app/v1/telecom/portability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["clientId"] = '<api-key>'
request["clientSecret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"917020141726\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"phoneDetail": {
"operator": "JIO",
"countryCode": "91",
"country": "IN",
"type": "MOBILE",
"homeOperator": "AIRTEL",
"isPorted": true,
"location": "India",
"timeZones": [
"Asia/Kolkata"
]
}
}Telecom
Number Portability Check
Check whether a phone number has been ported (MNP). Use as a pre-authentication risk signal for fraud prevention.
POST
/
v1
/
telecom
/
portability
Number Portability Check
curl --request POST \
--url https://platform.otpless.app/v1/telecom/portability \
--header 'Content-Type: application/json' \
--header 'clientId: <api-key>' \
--header 'clientSecret: <api-key>' \
--data '
{
"phoneNumber": "917020141726"
}
'import requests
url = "https://platform.otpless.app/v1/telecom/portability"
payload = { "phoneNumber": "917020141726" }
headers = {
"clientId": "<api-key>",
"clientSecret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
clientId: '<api-key>',
clientSecret: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({phoneNumber: '917020141726'})
};
fetch('https://platform.otpless.app/v1/telecom/portability', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.otpless.app/v1/telecom/portability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '917020141726'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"clientId: <api-key>",
"clientSecret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.otpless.app/v1/telecom/portability"
payload := strings.NewReader("{\n \"phoneNumber\": \"917020141726\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("clientId", "<api-key>")
req.Header.Add("clientSecret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://platform.otpless.app/v1/telecom/portability")
.header("clientId", "<api-key>")
.header("clientSecret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"917020141726\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.otpless.app/v1/telecom/portability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["clientId"] = '<api-key>'
request["clientSecret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"917020141726\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"phoneDetail": {
"operator": "JIO",
"countryCode": "91",
"country": "IN",
"type": "MOBILE",
"homeOperator": "AIRTEL",
"isPorted": true,
"location": "India",
"timeZones": [
"Asia/Kolkata"
]
}
}Why check number portability?
Why check number portability?
Mobile Number Portability (MNP) lets a subscriber keep their number while switching network operators. A number whose current
operator differs from its homeOperator has been ported.A recent or unexpected port can be a fraud signal — porting is a known vector for account takeover (an attacker ports a victim’s number to a SIM they control). Use this check as a pre-authentication risk layer for sensitive flows.How to interpret the response
How to interpret the response
| Field | Value | Meaning |
|---|---|---|
success | true | Check completed. Use phoneDetail.isPorted for the result. |
success | false | Check could not be completed (e.g. telecom lookup failed). Inspect the error object. |
phoneDetail.isPorted | true | The number has been ported — operator differs from homeOperator. Treat as a risk signal. |
phoneDetail.isPorted | false | The number is on its original operator (not ported). |
phoneDetail.isPorted; there is no separate top-level result field. When success is false, phoneDetail may be omitted.What is phoneDetail?
What is phoneDetail?
phoneDetail contains enriched metadata about the phone number — including operator, country, line type, and time zones. All fields are omitted when not available for the given number or operator.| Field | Type | Description |
|---|---|---|
operator | string | Current network operator (e.g. JIO, AIRTEL, VI) |
countryCode | string | Numeric country code (e.g. 91) |
country | string | ISO 3166-1 alpha-2 country code (e.g. IN) |
type | string | Phone line type (e.g. MOBILE) |
homeOperator | string | Registered (original) operator — differs from operator when the number is ported |
isPorted | boolean | true if the number has been ported away from its home operator |
location | string | Location string for the number’s registered area |
timeZones | string[] | IANA time zones for the number’s registered location |
Authorizations
OTPless API Client ID
OTPless API Client Secret
Body
application/json
Phone number including country code, without plus sign. Example: 917020141726 for +91 70201 41726.
Example:
"917020141726"
Response
HTTP 200 — Request accepted. Inspect success in the body:
success: true— Check completed. UsephoneDetail.isPortedto determine the result.success: false— Check could not be completed. Inspecterrorfor details.
true if the check completed successfully. false if the check could not be completed — inspect the error object for details.
Enriched phone metadata. Fields are omitted when not available for the given number or operator.
Show child attributes
Show child attributes
Error object returned inside a 200 response when success is false.
Show child attributes
Show child attributes