Skip to main content
POST
/
v1
/
api
/
email-validation
/
Validate Email Addresses
curl --request POST \
  --url https://base.sanitizeemail.com/v1/api/email-validation/ \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "emails": [
    "test@example.com",
    "user@domain.com"
  ],
  "file_id": 740,
  "options": {
    "validate_smtp": false,
    "validate_syntax": true,
    "check_dmarc": false,
    "validate_mx": false
  },
  "file_tag": "validate"
}'
{
  "results": [
    {
      "email": "<string>",
      "status": "valid",
      "reason": {
        "format": {
          "status": "pass",
          "reason": "<string>"
        },
        "dns": {
          "status": "pass",
          "reason": "<string>"
        },
        "mx": {
          "status": "pass",
          "reason": "<string>"
        },
        "smtp": {
          "status": "pass",
          "reason": "<string>"
        },
        "dmarc": {
          "status": "pass",
          "reason": "<string>"
        }
      },
      "normalized_email": "<string>",
      "is_disposable": true,
      "is_role_account": true,
      "mx_records": [
        "<string>"
      ]
    }
  ],
  "stats": {
    "total": 123,
    "valid": 123,
    "invalid": 123,
    "disposable": 123,
    "role_accounts": 123
  },
  "file_id": "<string>",
  "credits_used": 123,
  "remaining_processing": 123,
  "batch_size": 123
}
This endpoint validates email addresses using two different methods: direct email validation or file-based validation. You can either provide individual email addresses or reference a previously uploaded file.

Validation Methods

  • Direct Email Validation
  • File-Based Validation
Validate individual email addresses by providing them directly in the request.
{
  "emails": ["test@example.com", "user@domain.com"],
  "options": {
    "validate_smtp": true,
    "validate_syntax": true,
    "check_dmarc": true,
    "validate_mx": true
  }
}

How it Works

1

Choose Validation Method

Decide whether to validate individual emails directly or use a file-based approach
2

For File-Based: Upload File First (Optional)

If using file-based validation, first upload your CSV or XLSX file using the File Upload endpoint to obtain the file_id
3

Configure Validation Options

Set your desired validation options (syntax, DMARC, SMTP, MX records)
4

Submit Validation Request

Send either emails array OR file_id (not both)
5

Receive Results

Get validation results for the submitted emails

Request Parameters

Either/Or Requirement: You must provide either emails OR file_id, but not both in the same request.

Direct Email Validation

  • emails: Array of email addresses to validate
  • options: Validation options object

File-Based Validation

  • file_id: ID from a previously uploaded file
  • file_tag: Tag for categorizing the validation type
  • options: Validation options object

Validation Options

Configure which validation checks to perform:
  • validate_syntax: Checks email format and structure (default: true)
  • validate_smtp: Performs SMTP server validation (default: false)
  • check_dmarc: Validates DMARC policy records (default: false)
  • validate_mx: Checks MX record existence (default: false)

Example Workflows

Direct Email Validation

POST /v1/api/email-validation/
{
  "emails": ["john@example.com", "sarah@company.com"],
  "options": {
    "validate_syntax": true,
    "validate_smtp": true,
    "check_dmarc": false,
    "validate_mx": true
  }
}

File-Based Validation

// 1. First upload a file (if not already done)
POST /v1/api/filesupload/
// Response includes: { "id": 740, "file": "https://s3.../file.csv" }

// 2. Then validate the uploaded file
POST /v1/api/email-validation/
{
  "file_id": 740,
  "file_tag": "validate",
  "options": {
    "validate_smtp": true,
    "validate_syntax": true,
    "check_dmarc": true,
    "validate_mx": true
  }
}
Credits Consumption: Validation consumes credits based on the number of emails and validation options selected. More comprehensive validation uses more credits.
Bulk Processing: For validating large lists of emails, use the file-based approach with the File Upload endpoint for better performance and easier management.

Authorizations

X-API-KEY
string
header
required

API key for authentication

Body

application/json

Email validation request payload

emails
string<email>[]

Array of email addresses to validate (required for direct validation)

Example:
["test@example.com", "user@domain.com"]
file_id
integer

ID of the uploaded file (obtained from file upload response) - required for file-based validation

Example:

740

options
object

Validation options

file_tag
enum<string>

Tag for categorizing the file processing type (required when using file_id)

Available options:
clean,
validate,
analyze
Example:

"validate"

Response

Email validation results

results
object[]
stats
object
file_id
string | null

File ID for batch processing

credits_used
integer

Number of credits consumed

remaining_processing
integer

Remaining emails to process

batch_size
integer

Size of the current batch