# Phone Number Format Validation

{% hint style="info" %}
If you want to make sure the phone number is active/live then [use this endpoint](/validation/live-number-validation.md)&#x20;
{% endhint %}

### Endpoint

```http
[POST] https://usenotifier.com/api/validate
```

### Example Request

{% tabs %}
{% tab title="Laravel" %}

```php
$response = Http::withToken('YOUR_API_KEY')
               ->post('https://usenotifier.com/api/validate', [
                  "phoneNumber" => "07700900389",
                  "countryCode" => "GB"
                ]);
```

{% endtab %}

{% tab title="PHP Guzzle" %}

```php
$client = new Client();
$headers = [
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_API_KEY',
  'Content-Type' => 'application/x-www-form-urlencoded'
];
$options = [
'form_params' => [
  'phoneNumber' => '07700900389',
  'countryCode' => 'GB'
]];
$request = new Request('POST', 'https://usenotifier.com/api/validate', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
```

{% endtab %}

{% tab title="cURL" %}

```http
curl --location --request POST 'https://usenotifier.com/api/validate'
--header 'Accept: application/json'
--header 'Authorization: Bearer YOUR_API_KEY'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'phoneNumber=07700900389'
--data-urlencode 'countryCode=GB'
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new RestClient("https://usenotifier.com/api/validate");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer YOUR_API_KEY");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("phoneNumber", "07700900389");
request.AddParameter("countryCode", "Hello World!");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Read the [Authentication](/overview/authentication.md) docs to get your API KEY
{% endhint %}

**phoneNumber:&#x20;***<mark style="color:red;">**required**</mark>*

The phone number to validate. Don't worry about formatting, you can leave that to us!

**countryCode:&#x20;***<mark style="color:red;">**required**</mark>*

The 2 character ISO 3166 country code you want to validate the phone number against. [Get a list of valid codes.](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)&#x20;

### Example Response

```json
{
    "valid_format": true,
    "country" : "GB",
    "type" : "mobile"
}
```

The **type** of phone will be given, with the options being:

* FIXED\_LINE
* MOBILE
* FIXED\_LINE\_OR\_MOBILE
* TOLL\_FREE
* PREMIUM\_RATE
* SHARED\_COST
* VOIP
* PERSONAL\_NUMBER
* PAGER
* UAN
* UNKNOWN
* EMERGENCY
* VOICEMAIL
* SHORT\_CODE
* STANDARD\_RATE


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usenotifier.com/validation/phone-number-format-validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
