Menu

Expand
Rate this page:

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

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required

Request Body

object
file_type
string

The format of the file you wish to upload.

Allowed Values: csv, zip
required
{
  "file_type": "csv"
}

Responses

object
job_id
string

The unique ID of the Bulk Email Address Validation Job.

upload_uri
string

The URI to use for the request to upload your list of email addresses.

upload_headers
array[object]

Array containing headers and header values

header
string

The name of the header that must be included in the upload request.

value
string

The value of the header that must be included in the upload request.

object
errors
array[object]
message
string

the error message

required
field
string or null

the field that generated the error

help
object

helper text or docs for troubleshooting

id
string
{
  "errors": [
    {
      "field": "field_name",
      "message": "error message"
    }
  ]
}
object
errors
array[object]
message
string

the error message

required
field
string or null

the field that generated the error

help
object

helper text or docs for troubleshooting

id
string
{
  "errors": [
    {
      "field": "field_name",
      "message": "error message"
    }
  ]
}
Loading Code Sample...
        
        

        Request a presigned URL and headers to upload a CSV file

        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

        Authorization
        string
        default: Bearer <<YOUR_API_KEY_HERE>>
        required

        Responses

        object
        result
        array[object]
        id
        string

        The unique ID of the Bulk Email Address Validation Job.

        status
        string

        The status of the Bulk Email Address Validation Job.

        Allowed Values: Initiated, Queued, Ready, Processing, Done, Error
        started_at
        number

        The ISO8601 timestamp when the Job was created. This is the time at which the upload request was sent to the upload_uri.

        finished_at
        number

        The ISO8601 timestamp when the Job was finished.

        object
        errors
        array[object]
        message
        string

        the error message

        required
        field
        string or null

        the field that generated the error

        help
        object

        helper text or docs for troubleshooting

        id
        string
        {
          "errors": [
            {
              "field": "field_name",
              "message": "error message"
            }
          ]
        }
        object
        errors
        array[object]
        message
        string

        the error message

        required
        field
        string or null

        the field that generated the error

        help
        object

        helper text or docs for troubleshooting

        id
        string
        {
          "errors": [
            {
              "field": "field_name",
              "message": "error message"
            }
          ]
        }
        Loading Code Sample...
              
              

              List all Bulk Email Address Validation Jobs

              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

              Authorization
              string
              default: Bearer <<YOUR_API_KEY_HERE>>
              required

              Path Parameters

              job_id
              string

              The ID of the Bulk Email Address Validation Job you wish to retrieve.

              default: None
              required

              Responses

              object
              result
              object
              id
              string

              The unique ID of the Bulk Email Address Validation Job.

              status
              string

              The status of the Bulk Email Address Validation Job.

              Allowed Values: Initiated, Queued, Ready, Processing, Done, Error
              segments
              number

              The 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.

              segments_processed
              number

              The number of segments processed at the time of the request. 100 segments process in parallel at a time.

              is_download_available
              boolean

              Boolean indicating whether the results CSV file is available for download.

              started_at
              number

              The ISO8601 timestamp when the Job was created. This is the time at which the upload request was sent to the upload_uri.

              finished_at
              number

              The ISO8601 timestamp when the Job was finished.

              errors
              array[object]

              Array containing error messages related to the Bulk Email Address Validation Job. Array is empty if no errors ocurred.

              message
              string

              Description of the error encountered during execution of the Bulk Email Address Validation Job.

              object
              errors
              array[object]
              message
              string

              the error message

              required
              field
              string or null

              the field that generated the error

              help
              object

              helper text or docs for troubleshooting

              id
              string
              {
                "errors": [
                  {
                    "field": "field_name",
                    "message": "error message"
                  }
                ]
              }
              object
              errors
              array[object]
              message
              string

              the error message

              required
              field
              string or null

              the field that generated the error

              help
              object

              helper text or docs for troubleshooting

              id
              string
              {
                "errors": [
                  {
                    "field": "field_name",
                    "message": "error message"
                  }
                ]
              }
              Loading Code Sample...
                    
                    

                    Get a specific Bulk Email Address Validation Job

                    Rate this page:

                    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.

                    Loading Code Sample...
                          
                          
                          

                          Thank you for your feedback!

                          Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                          Sending your feedback...
                          🎉 Thank you for your feedback!
                          Something went wrong. Please try again.

                          Thanks for your feedback!

                          thanks-feedback-gif