Skip to main content

Number Check

The number check endpoint validates and enriches a phone number with formatting, network, and operator data. The connectionType provided in the request determines what type of data to be retrieved.

  • hlr: A Home Location Register lookup. Returns real-time network status, including whether the number is active and whether the subscriber is currently roaming, along with static data derived from the phone number.
  • mnp: A Mobile Number Portability lookup. Returns ported status including data about the ported-to operator, along with static data derived from the phone number.
  • static: No lookup conducted. Returns static data derived from the phone number itself. This is the default.

Request​

Request
POST https://api.cm.com/number-validation/v1/number/check
Request headers
Content-Type: application/json
Authorization: Bearer GENERATED_TOKEN_HERE
Request body
{
"phoneNumber": "+31612345678",
"connectionType": "hlr"
}

Parameters​

PropertyTypeRequiredDescription
phoneNumberstringYesThe phone number to check. Must start with a +.
connectionTypestringNoThe type of connection to use when retrieving the data. Possible values are static, hlr, and mnp. Defaults to static.

Response​

Depending on the connectionType provided in the request, some fields may be null if unknown.

Response body
{
"format": {
"e164": "+31612345678",
"international": "+31 6 12345678",
"national": "06 12345678",
"rfc3966": "tel:+31-6-12345678"
},
"type": "mobile",
"country": "Netherlands",
"callingCode": 31,
"regionCode": "nl",
"operator": "Vodafone",
"mcc": "204",
"mnc": "04",
"source": "hlr",
"roaming": null,
"isValid": true,
"isActive": true,
"isPorted": null
}

Parameters​

PropertyExampleDescription
format{ "e164": "+31612345678", ... }The phone number in various formats, including e164, international, national, and rfc3966.
typemobileThe type of phone number. Possible values: mobile, fixed_line, fixed_line_or_mobile, toll_free, premium_rate, shared_cost, voip, personal_number, pager, uan, voicemail, unknown.
countryNetherlandsThe country associated with the phone number.
callingCode31The international calling code of the country.
regionCodenlThe ISO 3166-1 alpha-2 code.
operatorVodafoneThe name of the network operator.
mcc204The Mobile Country Code of the operator.
mnc04The Mobile Network Code of the operator.
sourcehlrThe source of the returned data. Possible values: hlr, mnp, prefix, external, mnp_database, static.
roaming{ "country": "Germany", ... }Roaming details. Only present when the subscriber is currently roaming (HLR only). null if not roaming. See Roaming for the object structure.
isValidtrueWhether the phone number is a valid number.
isActivetrueWhether the number is currently active on the network. Only available for hlr.
isPortedfalseWhether the number has been ported to another operator. Only available for mnp.

Roaming​

When the subscriber is currently roaming and connectionType was hlr, the roaming field contains details about the visited network:

Response body
{
"roaming": {
"country": "Germany",
"callingCode": 49,
"regionCode": "de",
"operator": "T-Mobile DE",
"mcc": "262",
"mnc": "01"
}
}
PropertyExampleDescription
countryGermanyThe country the subscriber is currently roaming in.
callingCode49The international calling code of the roaming country.
regionCodedeThe ISO 3166-1 alpha-2 code of the roaming country.
operatorT-Mobile DEThe name of the roaming network operator.
mcc262The Mobile Country Code of the roaming operator.
mnc01The Mobile Network Code of the roaming operator.