Email Address Validation
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.
Bulk Email Address Validation - API Reference
The Bulk Email Address Validation API facilitates the asynchronous validation of up to one million email addresses.
With the Bulk Email Address Validation API, you can:
- Request an upload URL for the email list you wish to verify.
- Get all Bulk Email Address Validation Jobs
- Get a specific Bulk Email Address Validation Job
This API reference page should be used in conjunction with the Email Address Validation Overview page and the Bulk Email Validation Integration Guide.
PUT /v3/validations/email/jobs
Base url: https://api.sendgrid.com
This endpoint returns a presigned URL and request headers. You use this information to upload a list of email addresses for verification.
Authentication
- API Key
Headers
Request Body
The format of the file you wish to upload.
Allowed Values: csv, zip{
"file_type": "csv"
}
Responses
The unique ID of the Bulk Email Address Validation Job.
The URI to use for the request to upload your list of email addresses.
Array containing headers and header values
The name of the header that must be included in the upload request.
The value of the header that must be included in the upload request.
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
An example response to this request is shown in JSON format below:
{
"job_id":"01H793APATD899ESMY25ZNPNCF",
"upload_uri":"https://evbulkupload-prod-us-east-2-emails-csv.s3.us-east-2.amazonaws.com/7715623_01H793APATD899ESMY25ZNPNCF?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAS4765TJFOIIMQRXK%...",
"upload_headers": [
{
"header":"x-amz-server-side-encryption",
"value":"aws:kms"
},
{
"header":"content-type",
"value":"text/csv"
}
]
}
Note that the content-type
header value matches the provided file_type
parameter in the PUT
request
Once you have an upload_uri
and the upload_headers
, you're ready to upload your email address list for verification. For the expected format of the email address list and a sample upload request, see the Bulk Email Address Validation Overview page.
GET /v3/validations/email/jobs
Base url: https://api.sendgrid.com
This endpoint returns a list of all of your Bulk Email Validation Jobs.
Authentication
- API Key
Headers
Responses
The unique ID of the Bulk Email Address Validation Job.
The status of the Bulk Email Address Validation Job.
Allowed Values: Initiated, Queued, Ready, Processing, Done, ErrorThe ISO8601 timestamp when the Job was created. This is the time at which the upload request was sent to the upload_uri
.
The ISO8601 timestamp when the Job was finished.
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
GET /v3/validations/email/jobs/{job_id}
Base url: https://api.sendgrid.com
This endpoint returns a specific Bulk Email Validation Job. You can use this endpoint to check on the progress of a Job.
Authentication
- API Key
Headers
Path Parameters
The ID of the Bulk Email Address Validation Job you wish to retrieve.
default: NoneResponses
The unique ID of the Bulk Email Address Validation Job.
The status of the Bulk Email Address Validation Job.
Allowed Values: Initiated, Queued, Ready, Processing, Done, ErrorThe total number of segments in the Bulk Email Address Validation Job. There are 1,500 email addresses per segment. The value is 0
until the Job status
is Processing
.
The number of segments processed at the time of the request. 100 segments process in parallel at a time.
Boolean indicating whether the results CSV file is available for download.
The ISO8601 timestamp when the Job was created. This is the time at which the upload request was sent to the upload_uri
.
The ISO8601 timestamp when the Job was finished.
Array containing error messages related to the Bulk Email Address Validation Job. Array is empty if no errors ocurred.
Description of the error encountered during execution of the Bulk Email Address Validation Job.
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
Need some help?
We all do sometimes. Get help now from the Twilio SendGrid Support Team.
Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.