Validar teléfono
Validar teléfono es una API que comprueba si un número de teléfono es válido, sea cual sea el país, y te lo devuelve bien formateado (formato internacional, listo para guardar o marcar).
Cómo funciona
Le mandas el número (con el prefijo internacional, o sin él indicando el país) y comprueba si es un número real según las reglas de numeración de ese país. También te dice el tipo (móvil, fijo…) cuando se puede determinar.
Que el teléfono no sea válido no es un error de la petición: la respuesta es 200 con "valid": false, igual que cuando sí lo es.
Lo único que necesitas
- Tu API key. La creas en tu panel con "+ Crear llave". Se muestra una sola vez, así que cópiala y guárdala.
- En tu plataforma de automatización, un paso de tipo "HTTP Request" / "Hacer una petición HTTP" (lo tienen n8n, Make, Zapier, Pipedream…).
Cómo usarlo en n8n (paso a paso)
En el nodo HTTP Request:
- Method:
POST - URL:
https://api.cofferdock.com/validate-phone - Send Headers: actívalo y añade dos:
x-api-key= tu llave, yContent-Type=application/json - Send Body: actívalo → Body Content Type: JSON →
{ "phone": "612345678", "country": "ES" }
Si el número ya viene con el prefijo internacional (+34...), no hace falta mandar country.
En Make (módulo HTTP → Make a request): mismo método y URL, Body type: Raw, Content type: JSON, con el mismo cuerpo.
Opciones (dentro del JSON)
| Opción | Por defecto | Para qué sirve |
|---|---|---|
phone | - | Obligatorio. El número a validar, con o sin prefijo internacional. |
country | - | Código de país de 2 letras (ej. ES), para interpretar números sin prefijo +. |
Resumen de la API
- Endpoint:
POST https://api.cofferdock.com/validate-phone - Auth: cabecera
x-api-key: TU_LLAVE. - Entrada: SOLO
application/json. - Motor: libphonenumber-js (misma librería en la que se basan la mayoría de validadores de teléfono, JS puro sin dependencias).
- Texto no reconocible como teléfono: se trata igual que un número inválido (
valid:false), nunca da 500. - Límites: 30 peticiones/min por IP. 1 llamada = 1 crédito, sea el teléfono válido o no.
Opciones
| Opción | Por defecto | Descripción |
|---|---|---|
phone | - | Obligatorio. String no vacío, hasta 40 caracteres. |
country | - | Código ISO 3166-1 alpha-2 de 2 letras (400 si no cumple ese formato). Solo se usa si phone no lleva ya un prefijo +. |
Ejemplos
curl:
curl -X POST "https://api.cofferdock.com/validate-phone" \
-H "x-api-key: TU_LLAVE" \
-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': 'TU_LLAVE', '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': 'TU_LLAVE', 'Content-Type': 'application/json'},
json={'phone': '612345678', 'country': 'ES'},
)
print(r.json())
Respuesta
{ "success": true, "valid": true, "country": "ES", "type": "MOBILE",
"formatted_e164": "+34612345678", "formatted_international": "+34 612 34 56 78",
"meta": { "used": 12, "remaining": 488 } }
Lo que recibes
valid, el country y type detectados, y el número ya formateado en dos formatos estándar: formatted_e164 (para guardar o marcar por API) y formatted_international (para mostrar a una persona).
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).