Validar email
Validar email es una API que comprueba si una dirección de correo tiene formato correcto y, opcionalmente, si su dominio tiene registros para recibir correo (MX), justo antes de guardarla en tu base de datos o mandarle algo.
Cómo funciona
Le mandas el email y comprueba dos cosas: el formato (el mismo criterio que usan los navegadores en un campo de tipo email) y, si el formato es correcto, si el dominio tiene registros MX de verdad. No manda ningún correo ni comprueba que la cuenta en concreto exista, solo que el dominio esté preparado para recibir correo.
Que el email 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-email - 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 →
{ "email": "cliente@ejemplo.com" }
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 |
|---|---|---|
email | - | Obligatorio. El email a validar. |
check_mx | true | Pon false si solo quieres comprobar el formato, sin consultar el dominio (más rápido). |
Resumen de la API
- Endpoint:
POST https://api.cofferdock.com/validate-email - Auth: cabecera
x-api-key: TU_LLAVE. - Entrada: SOLO
application/json. - Formato: la regex del living standard WHATWG (la de
<input type="email">) más una comprobación extra de que la parte antes de la@no empiece/termine en punto ni tenga dos puntos seguidos. - MX:
dns.resolveMxnativo de Node con timeout propio de 5s. Nunca da 500 por un problema de DNS: si la consulta falla o tarda demasiado,mx_foundsalenull(no se sabe) en vez de forzar unfalse, yvalidno baja solo por eso. - Límites: 30 peticiones/min por IP. 1 llamada = 1 crédito, sea el email válido o no.
Opciones
| Opción | Por defecto | Descripción |
|---|---|---|
email | - | Obligatorio. String no vacío, hasta 254 caracteres. |
check_mx | true | Boolean. Si es false, no se consulta el DNS del dominio. |
Posibles valores de reason
| Valor | Significa |
|---|---|
invalid_format | El formato del email no es válido. |
no_mx_records | El dominio no tiene registros MX (o no existe). |
null_mx | El dominio publica explícitamente que no recibe correo (RFC 7505). |
mx_lookup_timeout | La consulta DNS tardó más de 5s. mx_found queda en null. |
mx_lookup_failed | Error de red al consultar el DNS. mx_found queda en null. |
Ejemplos
curl:
curl -X POST "https://api.cofferdock.com/validate-email" \
-H "x-api-key: TU_LLAVE" \
-H "Content-Type: application/json" \
-d '{"email":"cliente@ejemplo.com"}'
JavaScript (Node 18+):
const r = await fetch('https://api.cofferdock.com/validate-email', {
method: 'POST',
headers: { 'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/json' },
body: JSON.stringify({ email: 'cliente@ejemplo.com' }),
});
const { valid, mx_found } = await r.json();
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/validate-email',
headers={'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/json'},
json={'email': 'cliente@ejemplo.com'},
)
print(r.json())
Respuesta
{ "success": true, "valid": true, "format_valid": true, "mx_found": true, "domain": "ejemplo.com",
"meta": { "used": 12, "remaining": 488 } }
Lo que recibes
valid resume el resultado; format_valid y mx_found te dicen por separado qué falló si valid es falso, y reason lo explica en una palabra.
Validate email
Validate email is an API that checks whether an email address has a correct format and, optionally, whether its domain has records set up to receive mail (MX), right before you save it to your database or send it something.
How it works
You send the email and it checks two things: the format (the same criteria browsers use for an email-type field) and, if the format is correct, whether the domain actually has MX records. It doesn't send any email or check that the specific account exists, only that the domain is set up to receive mail.
An invalid email 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-email - Send Headers: on → add two:
x-api-key= your key, andContent-Type=application/json - Send Body: on → Body Content Type: JSON →
{ "email": "customer@example.com" }
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 |
|---|---|---|
email | - | Required. The email to validate. |
check_mx | true | Set to false if you only want the format checked, without querying the domain (faster). |
API overview
- Endpoint:
POST https://api.cofferdock.com/validate-email - Auth: header
x-api-key: YOUR_KEY. - Input:
application/jsonONLY. - Format: the WHATWG living standard regex (the one behind
<input type="email">) plus an extra check that the part before@doesn't start/end with a dot or contain two dots in a row. - MX: Node's native
dns.resolveMxwith its own 5s timeout. Never returns a 500 for a DNS problem: if the lookup fails or times out,mx_foundcomes backnull(unknown) instead of forcing afalse, andvaliddoesn't drop just because of that. - Limits: 30 requests/min per IP. 1 call = 1 credit, whether the email is valid or not.
Options
| Option | Default | Description |
|---|---|---|
email | - | Required. Non-empty string, up to 254 characters. |
check_mx | true | Boolean. If false, the domain's DNS isn't queried. |
Possible reason values
| Value | Means |
|---|---|
invalid_format | The email's format isn't valid. |
no_mx_records | The domain has no MX records (or doesn't exist). |
null_mx | The domain explicitly publishes that it doesn't receive mail (RFC 7505). |
mx_lookup_timeout | The DNS lookup took longer than 5s. mx_found stays null. |
mx_lookup_failed | Network error while querying DNS. mx_found stays null. |
Examples
curl:
curl -X POST "https://api.cofferdock.com/validate-email" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"email":"customer@example.com"}'
JavaScript (Node 18+):
const r = await fetch('https://api.cofferdock.com/validate-email', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ email: 'customer@example.com' }),
});
const { valid, mx_found } = await r.json();
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/validate-email',
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json'},
json={'email': 'customer@example.com'},
)
print(r.json())
Response
{ "success": true, "valid": true, "format_valid": true, "mx_found": true, "domain": "example.com",
"meta": { "used": 12, "remaining": 488 } }
What you get back
valid is the overall verdict; format_valid and mx_found tell you separately what failed if valid is false, and reason explains it in one word.