Validate phone
Validate phone is an API that checks whether a phone number is valid, for any country, and gives it back to you properly formatted (international format, ready to store or dial).
How it works
You send the number (with an international prefix, or without one plus the country) and it checks whether it's a real number under that country's numbering rules. It also tells you the type (mobile, landline…) when that can be determined.
An invalid phone number isn't a request error: the response is 200 with "valid": false, same as when it's valid.
All you need
- Your API key. Create it in your dashboard with "+ Create key". It's shown only once, so copy and save it.
- In your automation platform, an "HTTP Request" step (n8n, Make, Zapier, Pipedream… all have one).
How to use it in n8n (step by step)
In the HTTP Request node:
- Method:
POST - URL:
https://api.cofferdock.com/validate-phone - Send Headers: on → add two:
x-api-key= your key, andContent-Type=application/json - Send Body: on → Body Content Type: JSON →
{ "phone": "612345678", "country": "ES" }
If the number already has an international prefix (+34...), you don't need to send country.
In Make (HTTP → Make a request module): same method and URL, Body type: Raw, Content type: JSON, with the same body.
Options (inside the JSON)
| Option | Default | What it does |
|---|---|---|
phone | - | Required. The number to validate, with or without an international prefix. |
country | - | 2-letter country code (e.g. ES), to interpret numbers without a + prefix. |
API overview
- Endpoint:
POST https://api.cofferdock.com/validate-phone - Auth: header
x-api-key: YOUR_KEY. - Input:
application/jsonONLY. - Engine: libphonenumber-js (the same library behind most phone validators out there, pure JS with no dependencies).
- Text that isn't phone-shaped: treated the same as an invalid number (
valid:false), never returns a 500. - Limits: 30 requests/min per IP. 1 call = 1 credit, whether the phone is valid or not.
Options
| Option | Default | Description |
|---|---|---|
phone | - | Required. Non-empty string, up to 40 characters. |
country | - | 2-letter ISO 3166-1 alpha-2 code (400 if it doesn't match that format). Only used if phone doesn't already have a + prefix. |
Examples
curl:
curl -X POST "https://api.cofferdock.com/validate-phone" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"phone":"612345678","country":"ES"}'
JavaScript (Node 18+):
const r = await fetch('https://api.cofferdock.com/validate-phone', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ phone: '612345678', country: 'ES' }),
});
const { valid, formatted_e164 } = await r.json();
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/validate-phone',
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json'},
json={'phone': '612345678', 'country': 'ES'},
)
print(r.json())
Response
{ "success": true, "valid": true, "country": "ES", "type": "MOBILE",
"formatted_e164": "+34612345678", "formatted_international": "+34 612 34 56 78",
"meta": { "used": 12, "remaining": 488 } }
What you get back
valid, the detected country and type, and the number already formatted two standard ways: formatted_e164 (for storing or dialing via API) and formatted_international (for showing to a person).