Validate an address
POST/v1/email-validations
Check one address before you send to it: syntax, the domain and its mail servers, throw-away and role addresses, typos, your suppression list and earlier hard bounces.
Any API key; test keys too (nothing is sent or changed).
result: deliverable (every check passed), risky (it may arrive, but sending to it can hurt your reputation), undeliverable (it will bounce) or unknown (the domain's DNS did not answer: try again later).
reason is the most serious of reasons: invalid_syntax, reserved_domain, domain_not_found, no_mail_server, mailbox_not_found, previously_bounced (hard bounced on ZapSMTP in the last 180 days), dns_error, suppressed (on your suppression list), disposable, accept_all, role_address; ok when there is none.
checks.mailbox is exists, not_found, unknown or not_checked. Nothing is ever sent to the address. did_you_mean suggests a likely intended address when the domain looks like a typo.
Each address counts against your plan's monthly validations (Free 100, Pro 5,000, Scale 25,000); over it: 429 monthly_quota_exceeded. Results are not stored.
Body parameters
emailstringrequired- The address to check.
Errors
missing_required_fieldHTTP 422- email is required
monthly_quota_exceededHTTP 429- this month's validations of the plan are used up
rate_limit_exceededHTTP 429- email validation is limited to 120 requests per minute
curl -X POST 'https://api.zapsmtp.com/v1/email-validations' \
-H "Authorization: Bearer $ZAP_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"email": "ann@example.com"
}'const res = await fetch('https://api.zapsmtp.com/v1/email-validations', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ZAP_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"email": "ann@example.com"
}),
});
// 204 No Content (e.g. a delete) has no body
const data = res.status === 204 ? null : await res.json();
if (!res.ok) throw new Error(`${data.name}: ${data.message}`);
console.log(data);import os
import requests
res = requests.post(
"https://api.zapsmtp.com/v1/email-validations",
headers={"Authorization": f"Bearer {os.environ['ZAP_API_KEY']}"},
json={
"email": "ann@example.com",
},
timeout=30,
)
res.raise_for_status()
print(res.json() if res.status_code != 204 else "deleted")<?php
$ch = curl_init('https://api.zapsmtp.com/v1/email-validations');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ZAP_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'email' => 'ann@example.com',
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException($data['message']);
}
print_r($data);package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"email": "ann@example.com"
}`)
req, err := http.NewRequest(
"POST",
"https://api.zapsmtp.com/v1/email-validations",
body,
)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ZAP_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}require 'net/http'
require 'json'
uri = URI('https://api.zapsmtp.com/v1/email-validations')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV.fetch('ZAP_API_KEY')}"
req['Content-Type'] = 'application/json'
req.body = {
email: "ann@example.com"
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, (JSON.parse(res.body) unless res.body.to_s.empty?)import java.net.URI;
import java.net.http.*;
public class ZapRequest {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder(URI.create("https://api.zapsmtp.com/v1/email-validations"))
.header("Authorization", "Bearer " + System.getenv("ZAP_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"email": "ann@example.com"
}"""))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var http = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.zapsmtp.com/v1/email-validations");
request.Headers.Authorization = new AuthenticationHeaderValue(
"Bearer", Environment.GetEnvironmentVariable("ZAP_API_KEY"));
request.Content = new StringContent("""
{
"email": "ann@example.com"
}
""", Encoding.UTF8, "application/json");
var response = await http.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");ZAP_API_KEY in your environment.Response 200 OK
{
"object": "email_validation",
"email": "ann@example.com",
"normalized": "ann@example.com",
"result": "deliverable",
"reason": "ok",
"reasons": [],
"score": 0.9,
"did_you_mean": null,
"checks": {
"syntax": true,
"domain": "example.com",
"mx": [
"mx1.example.com",
"mx2.example.com"
],
"disposable": false,
"role": false,
"free": false,
"mailbox": "not_checked",
"accept_all": null,
"suppressed": false,
"previously_bounced": false
}
}