Skip to contentSkip to navigationSkip to topbar
On this page

Real Time Email Address Validation - API Reference



API Overview

api-overview page anchor

Email Address Validation is available to Email API Pro and Premier level accounts only. An Email Validation API key is required. See the Email Address Validation overview page for more information.

The Email Address Validation API provides detailed information about the validity of email addresses, which helps you create and maintain contact lists and reduce bounce rates.

This API provides two options:

  • Real Time Email Address Validation: real time, detailed information on the validity of a single email address.

    • Use this option to prompt users that they've provided an invalid email, prevent invalid emails from entering your database.
  • Bulk Email Address Validation: Asynchronous, bulk validation of up to one million email addresses.

    • Use this option to help you remove invalid emails from your existing lists.

POST/v3/validations/email

Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)

This endpoint allows you to validate an email address.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Encoding type:application/json
SchemaExample
Property nameTypeRequiredDescriptionChild properties
emailstringrequired

The email address that you want to validate.


sourcestringOptional

A one-word classifier for where this validation originated.

200
SchemaExample
Property nameTypeRequiredDescriptionChild properties
resultobject
Validate an emailLink to code sample: Validate an email
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const data = {
5
source: "Newsletter",
6
email: "example@example.com",
7
};
8
9
const request = {
10
url: `/v3/validations/email`,
11
method: "POST",
12
body: data,
13
};
14
15
client
16
.request(request)
17
.then(([response, body]) => {
18
console.log(response.statusCode);
19
console.log(response.body);
20
})
21
.catch((error) => {
22
console.error(error);
23
});

The optional source parameter can be used identify the source of the email address. if you choose to integrate with multiple email address captures and want to be able to compare their results.

The source must be a string, only using alphanumeric characters and spaces. For example:

1
{
2
"email": "email@example.com",
3
"source": "Newsletter Signup"
4
}

There is a limit of 50 sources. Sources are automatically deleted once the last validation to use that source falls off the 30 day window. You can continue to make validations without a source if you've hit the limit.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.