Provero Logo

Phone - Format

Phone - Format provides a lightweight phone validation check without requiring an HLR lookup. It returns number validity, country details, standard number formats, and assigned network data when available from number range metadata.

Endpoint

POST
https://api.provero.io/api/validate/phone-basic

Headers

Authorization: Bearer REPLACE_WITH_API_TOKEN
Content-Type: application/json
Accept: application/json


Request Body

Field Type Required Description
phone string Yes The phone number to validate. International format with country code is recommended.
Request Body example (JSON)
{
    "phone": "+447700900123"
}

Code Examples

import requests

userPhone = "REPLACE_WITH_PHONE"

url = "https://api.provero.io/api/validate/phone-basic"
payload = {"phone": userPhone}

headers = {
    "Authorization": "Bearer REPLACE_WITH_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json"
}

response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.text)
<?php
$userPhone = "REPLACE_WITH_PHONE";

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.provero.io/api/validate/phone-basic",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode(["phone" => $userPhone]),
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer REPLACE_WITH_API_TOKEN",
        "Content-Type: application/json",
        "Accept: application/json"
    ],
]);

$response = curl_exec($curl);
if (curl_errno($curl)) {
    echo 'Error:' . curl_error($curl);
}
curl_close($curl);
echo $response;
const userPhone = "REPLACE_WITH_PHONE";

fetch("https://api.provero.io/api/validate/phone-basic", {
    method: "POST",
    headers: {
        "Authorization": "Bearer REPLACE_WITH_API_TOKEN",
        "Content-Type": "application/json",
        "Accept": "application/json"
    },
    body: JSON.stringify({ phone: userPhone })
})
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.error("Error:", error));
userPhone="REPLACE_WITH_PHONE"

curl -X POST https://api.provero.io/api/validate/phone-basic \
  -H "Authorization: Bearer REPLACE_WITH_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d "{\"phone\": \"$userPhone\"}"

Response Examples

Success
{
    "input": "+447700900123",
    "valid": true,
    "country": {
        "code": "GB",
        "name": "United Kingdom of Great Britain and Northern Ireland",
        "callingCode": "44"
    },
    "format": {
        "e164": "+447700900123",
        "international": "+44 7700 900123",
        "national": "07700 900123",
        "rfc3966": "tel:+44-7700-900123"
    },
    "assignedNetwork": "Vodafone UK"
}
Validation Error - Phone Not Provided
{
    "message": "The phone field is required.",
    "errors": {
        "phone": [
            "The phone field is required."
        ]
    }
}
Validation Error - Invalid Phone
{
    "message": "The phone provided is invalid.",
    "errors": {
        "phone": [
            "The phone provided is invalid."
        ]
    }
}
Payment Required - Insufficient Balance
{
    "message": "Insufficient balance for validation request.",
    "service": "basic_phone",
    "required_amount": "0.0060000000",
    "current_balance": "0.0000000000"
}

Response Body

Success structure

Field Name Type Example Always Present Description
input string +447700900123 Yes The raw phone number submitted by the client.
valid boolean 1 Yes Whether the number is considered valid by the phone verification service.
country object {"code":"GB","name":"United Kingdom of Great Britain and Northern Ireland","callingCode":"44"} Yes Resolved country details for the phone number when available.
country.code string GB No ISO 3166-1 alpha-2 country code.
country.name string United Kingdom of Great Britain and Northern Ireland No Resolved country name.
country.callingCode string 44 No International calling code for the resolved country.
format object {"e164":"+447700900123","international":"+44 7700 900123","national":"07700 900123","rfc3966":"tel:+44-7700-900123"} Yes Common formatted versions of the submitted number.
format.e164 string +447700900123 No Canonical E.164 representation.
format.international string +44 7700 900123 No Human-readable international format.
format.national string 07700 900123 No National display format.
format.rfc3966 string tel:+44-7700-900123 No RFC3966 telephone URI representation.
assignedNetwork string Vodafone UK No Carrier/network label from libphonenumber range data when available.

Error structure

Field Name Type Example Always Present Description
message string The phone field is required. No Top-level error message returned on validation failure or insufficient balance.
errors object {"phone":["The phone field is required."]} No Object of per-field validation errors.
service string basic_phone No Service alias returned with a 402 insufficient-balance response.
required_amount string 0.0060000000 No Credit amount required to process the validation request.
current_balance string 0.0000000000 No Current available balance at the time the request was rejected.