apyhub
Back
▣ VERIFICATION KIT

Validate MENA Mobile Number API

What it does

The mobile number validation API checks mobile numbers from eight Middle East and North Africa countries. They are Saudi Arabia, the UAE, Egypt, Kuwait, Qatar, Bahrain, Oman and Jordan. Send the number in value and get back valid, the E.164 format and the national format.

Numbers can be written the way people type them. Brackets, spaces, dashes, a leading 00 or + and Arabic-Indic digits are all cleaned up. If the number has no country code, set country, such as SA, AE or EG.

A valid number also returns original_operator, the network that first issued its prefix, such as STC, Etisalat or Vodafone. The number may since have moved to another network. Landlines and wrong lengths return valid: false with codes such as not_a_mobile_number_for_country.

Teams use the mobile number validation API on sign-up and checkout forms, before sending SMS or WhatsApp messages and to clean contact lists.

This is a format check. It does not confirm that the number is active.

To check many numbers at once, use the Batch Validate MENA IDs API.

POST
Mobile Number
https://api.eu.apyhub.com/odelyo/validate-mena-mobile-number/mobiles

QUICKSTART

GUIDE

Quickstart

Validate a phone number by sending its value in a simple JSON request.

curl -X POST "https://api.eu.apyhub.com/odelyo/validate-mena-mobile-number/mobiles" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value":"+966501234567","country":"SA"}'

What you'll get back

Returns a JSON object with data (the validation result) and meta (request id and version). Below is the real response for the request above.

{
  "data": {
    "valid": true,
    "input": "+966501234567",
    "problems": [],
    "country": "SA",
    "e164": "+966501234567",
    "national": "0501234567",
    "original_operator": "STC",
    "note": "Operator is the original one for the prefix; the number may have been ported."
  },
  "meta": {
    "request_id": "req_6712417fd6dfcc05",
    "version": "v1"
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Validates a mobile number string, with an optional country hint used when the number does not include a country code. The response returns a JSON object containing data and meta.

Request Body

ParameterTypeMandatoryDescription
valueStringYesMobile number to validate. Minimum length 1, maximum length 64.
countryENUMNoUsed when the number has no country code. Allowed values: EG, SA, AE, KW, QA, BH, OM, JO.

Response

Returns a JSON object with a data object holding the validation result and a meta object with the request_id and API version. Invalid values still return 200 with valid: false and the reasons in problems. Requests with a missing or wrong-type field return 422 with an error object.

ParameterTypeDescription
dataObjectThe validation result.
data.validBooleantrue if the value passes all checks for its format.
data.inputStringThe value you sent.
data.problemsString ArrayProblem codes when the value is not valid, e.g. checksum_failed, must_be_14_digits. Empty when valid.
data.countryStringCountry of the number: EG, SA, AE, KW, QA, BH, OM or JO.
data.e164StringNumber in international E.164 format, e.g. +966501234567.
data.nationalStringNumber in national format, e.g. 0501234567.
data.original_operatorStringMobile operator that the number range was first given to, e.g. STC. null if unknown.
data.noteStringReminder that the number may have been moved to another operator (ported).
metaObjectRequest details.
meta.request_idStringUnique id of this request, useful for support.
meta.versionStringAPI version, e.g. v1.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.