Number Lookup / HLR API
Preview
REST

Response Fields

Authoritative reference for every field returned by single and bulk number lookups. Use this page when mapping HLR results into your database, rules engine, or CRM.

Identity Fields

msisdn, e164, country, and countryCode for storage and display consistency.

Network Fields

carrier, networkType, mcc, and mnc for routing and analytics.

Status Fields

ported, roaming, reachable, and hlrStatus for operational decisions.

Billing Fields

cost.amount and cost.currency on every successful enrichment row.

Core fields

14+

including nested cost

networkType

4

mobile | fixed | voip | unknown

hlrStatus

5

ACTIVE … UNKNOWN

Applies to

Both

single & bulk APIs

Complete Result Object

Canonical shape of a successful enrichment. Nulls may appear for mcc / mnc when the network type is VoIP or the HLR cannot resolve codes.

JSON
{
"lookupId": "LKP-9f3a2c1b-4e8d-4a71-b2c0-1d9e8f7a6b5c",
"msisdn": "0244123456",
"e164": "233244123456",
"country": "Ghana",
"countryCode": "GH",
"carrier": "MTN",
"networkType": "mobile",
"ported": false,
"roaming": false,
"reachable": true,
"hlrStatus": "ACTIVE",
"mcc": "620",
"mnc": "01",
"cost": {
"amount": 0.008,
"currency": "USD"
},
"reference": "signup-user-42"
}

Identity & Geography

FieldTypeRequiredDescription
msisdnstring
required
The number exactly as submitted on the request (local, E.164 digits, or +prefixed). Use for debugging input; prefer e164 for storage.
e164string
required
Normalized international number: country code + national significant number, digits only, no leading +. Example: 233244123456.
countrystring
required
English country name derived from the resolved numbering plan (e.g. Ghana, Nigeria, Kenya).
countryCodestring
required
ISO 3166-1 alpha-2 country code (e.g. GH, NG, KE). Always uppercase in responses.

Carrier & Network

FieldTypeRequiredDescription
carrierstring
required
Human-readable current network/operator name (e.g. MTN, Telecel, AirtelTigo). For ported numbers this reflects the recipient network, not the original donor.
networkTypestring
required
Classification of the line: mobile | fixed | voip | unknown. See enum table below.
mccstring | nulloptionalMobile Country Code (ITU-T E.212), typically 3 digits as a string (e.g. "620"). Null when not applicable.
mncstring | nulloptionalMobile Network Code, 2–3 digits as a string (e.g. "01"). Combined with mcc uniquely identifies the PLMN.
networkType enum
ValueMeaningTypical use
mobileMobile / cellular subscriptionSMS, OTP, voice to handset
fixedLandline or fixed wirelessVoice only; skip SMS OTP
voipInternet telephony / virtual numberHigher fraud risk; optional block
unknownCould not classify the line typeConservative handling; optional re-lookup

Example MCC/MNC pairs (illustrative)

JSON
[
{ "carrier": "MTN Ghana", "mcc": "620", "mnc": "01" },
{ "carrier": "Telecel Ghana", "mcc": "620", "mnc": "02" },
{ "carrier": "AirtelTigo Ghana", "mcc": "620", "mnc": "03" }
]

Portability, Roaming & Reachability

FieldTypeRequiredDescription
portedboolean
required
true if number portability data indicates the subscriber has moved from the originally allocated network to another operator.
roamingboolean
required
true if the handset is registered on a visited network outside the home PLMN at query time.
reachableboolean
required
true when HLR/network signals indicate the subscriber can currently receive traffic. false does not always mean permanently invalid.
hlrStatusstring
required
Normalized HLR status: ACTIVE | ABSENT | INACTIVE | INVALID | UNKNOWN. See table below.
hlrStatus enum
ValueMeaningreachable?Suggested action
ACTIVEAllocated and known activeUsually trueAllow messaging / calls
ABSENTTemporarily unavailable (off / no coverage)Often falseRetry later; do not purge
INACTIVEDeactivated or not in servicefalseSuppress or re-collect number
INVALIDNot allocated / invalid at networkfalseRemove permanently
UNKNOWNNo definitive HLR answerMay be falseUse secondary signals; optional retry

Billing & Correlation

FieldTypeRequiredDescription
costobject
required
Billing object for the successful lookup row. Absent on pure validation error rows in bulk errors[].
cost.amountnumber
required
Decimal cost charged for this lookup (e.g. 0.008). Sum for bulk is data.totalCost.amount.
cost.currencystring
required
ISO 4217 currency code (typically USD for API pricing).
lookupIdstringoptionalPresent on single-lookup success (LKP-…). Bulk rows may omit this; use bulkId + index instead.
referencestring | nulloptionalEcho of your request reference when provided; null otherwise.

Response Envelope

Every API response is wrapped in a standard Sendexa envelope. Business data lives under data.

FieldTypeRequiredDescription
successboolean
required
true when the request was accepted and processed (bulk may still include row errors).
codestring
required
Machine-readable status (LOOKUP_OK, BULK_LOOKUP_OK, BULK_LOOKUP_PARTIAL, INVALID_MSISDN, …).
messagestring
required
Human-readable summary of the outcome.
requestIdstring
required
Platform request ID (REQ-…). Include in support tickets.
timestampstring
required
ISO 8601 UTC timestamp of the response.
dataobjectoptionalPayload for successful or partial responses. Omitted or null on hard failures.
errorsarrayoptionalValidation or row-level error objects (field/index, message, code).

Bulk-only Fields

Returned only by POST /v1/lookup/bulk.

FieldTypeRequiredDescription
bulkIdstring
required
Identifier for the bulk operation (BLK-…).
totalnumber
required
Numbers submitted in the request.
succeedednumber
required
Rows with a successful HLR enrichment.
failednumber
required
Rows that failed validation or HLR.
summaryobject
required
Aggregates across successful rows (reachable, ported, byNetworkType, byHlrStatus).
totalCostobject
required
Sum of row costs { amount, currency }.
results[].indexnumber
required
Zero-based index of the input numbers[] entry.
results[].successboolean
required
Whether that row completed successfully.
errors[].indexnumber
required
Index of the failed input row.
errors[].codestring
required
Row error code (INVALID_MSISDN, LOOKUP_FAILED, …).
JSON
{
"summary": {
"reachable": 820,
"unreachable": 120,
"ported": 45,
"roaming": 12,
"byNetworkType": {
"mobile": 900,
"fixed": 20,
"voip": 15,
"unknown": 5
},
"byHlrStatus": {
"ACTIVE": 850,
"ABSENT": 40,
"INACTIVE": 30,
"INVALID": 20,
"UNKNOWN": 0
}
}
}

TypeScript Types

TypeScript
interface LookupCost {
amount: number;
currency: string;
}
type NetworkType = "mobile" | "fixed" | "voip" | "unknown";
type HlrStatus =
| "ACTIVE"
| "ABSENT"
| "INACTIVE"
| "INVALID"
| "UNKNOWN";
interface LookupResult {
lookupId?: string;
msisdn: string;
e164: string;
country: string;
countryCode: string;
carrier: string;
networkType: NetworkType;
ported: boolean;
roaming: boolean;
reachable: boolean;
hlrStatus: HlrStatus;
mcc: string | null;
mnc: string | null;
cost: LookupCost;
reference?: string | null;
}

Decision Mapping Examples

Allow OTP / SMS
JavaScript
reachable === true
&& hlrStatus === 'ACTIVE'
&& networkType === 'mobile'
Step-up fraud review
JavaScript
networkType === 'voip'
|| hlrStatus === 'UNKNOWN'
|| (ported === true && roaming === true)
Route by PLMN
JavaScript
// Prefer mcc+mnc over prefix tables
const plmn = `${mcc}${mnc}`;
routeSms(e164, plmn, carrier);
Suppress permanently
JavaScript
hlrStatus === 'INVALID'
|| (hlrStatus === 'INACTIVE'
&& reachable === false)

Nullability & Edge Cases

SituationField impact
VoIP or non-cellular linenetworkType may be voip; mcc/mnc often null; carrier may be generic
Temporary network outage on handsethlrStatus ABSENT; reachable false; still billable success
Number never allocatedhlrStatus INVALID; reachable false; do not message
Ported mobile numberported true; carrier/mcc/mnc reflect recipient network
International roamingroaming true; home carrier still returned when available
Bulk validation error rowRow appears only in errors[]; no cost; no HLR fields