Skip to main content

Get Your API Key

Before you can start validating emails, you’ll need to get your API key from the Sanitize-Email dashboard.
1

Visit the Dashboard

Go to https://app.sanitizeemail.com/api-key to access your API key.
2

Copy Your API Key

Copy the API key from your dashboard - you’ll need this for authentication.
3

Choose Your Plan

Select from subscription plans or use pay-as-you-go credits based on your needs.

Make Your First Request

Once you have your API key, you can start validating emails immediately. Here’s how to validate a single email address:
curl -X POST https://base.sanitizeemail.com/v1/api/email-validation/ \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -d '{
    "emails": ["user@example.com"],
    "options": {
      "validate_smtp": true
    },
    "file_tag": "quickstart-test"
  }'

Understanding the Response

The API will return detailed validation results for each email:
{
  "results": [
    {
      "email": "user@example.com",
      "status": "valid",
      "normalized_email": "user@example.com",
      "is_disposable": false,
      "is_role_account": false,
      "reason": {
        "format": {
          "status": "pass",
          "reason": "Valid email format"
        },
        "dns": {
          "status": "pass",
          "reason": "Domain exists"
        },
        "mx": {
          "status": "pass",
          "reason": "MX records found"
        },
        "smtp": {
          "status": "pass",
          "reason": "SMTP server responds"
        }
      },
      "mx_records": ["mx1.example.com", "mx2.example.com"]
    }
  ],
  "stats": {
    "total": 1,
    "valid": 1,
    "invalid": 0,
    "disposable": 0,
    "role_accounts": 0
  },
  "credits_used": 1,
  "remaining_processing": 0,
  "batch_size": 1
}

Bulk Email Validation

You can validate multiple emails in a single request for efficient bulk processing:
{
  "emails": ["user1@example.com", "user2@domain.com", "test@company.org"],
  "options": {
    "validate_smtp": true
  },
  "file_tag": "bulk-validation"
}

Validation Options

Set validate_smtp: true to perform real-time SMTP checks. This provides the most accurate validation but takes longer.
Use file_tag to organize and identify your validation batches for easier tracking.
The API has rate limits to ensure optimal performance. Check the response headers for rate limit information.

Error Handling

Always check for errors in your API responses:
  • 400: Bad request - Invalid payload format
  • 401: Unauthorized - Missing or invalid API key
  • 403: Forbidden - API key is inactive
  • 429: Rate limit exceeded
Keep your API key secure and never expose it in client-side code. Store it as an environment variable or in a secure configuration file.

Next Steps

Need Help?

Contact Support

Visit Our Website