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
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| value | String | Yes | Mobile number to validate. Minimum length 1, maximum length 64. |
| country | ENUM | No | Used 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.
| Parameter | Type | Description |
|---|---|---|
| data | Object | The validation result. |
| data.valid | Boolean | true if the value passes all checks for its format. |
| data.input | String | The value you sent. |
| data.problems | String Array | Problem codes when the value is not valid, e.g. checksum_failed, must_be_14_digits. Empty when valid. |
| data.country | String | Country of the number: EG, SA, AE, KW, QA, BH, OM or JO. |
| data.e164 | String | Number in international E.164 format, e.g. +966501234567. |
| data.national | String | Number in national format, e.g. 0501234567. |
| data.original_operator | String | Mobile operator that the number range was first given to, e.g. STC. null if unknown. |
| data.note | String | Reminder that the number may have been moved to another operator (ported). |
| meta | Object | Request details. |
| meta.request_id | String | Unique id of this request, useful for support. |
| meta.version | String | API version, e.g. v1. |