Skip to main content

Endpoint

POST https://api.bunny.build/api/v1/email-validation

Authentication

HeaderRequiredValue
X-API-KeyYesYour API key (bun_...)
Content-TypeYesapplication/json

Overview

Validate an email address across multiple layers: syntax format, DNS MX record existence, and role-based address detection. The response also includes a typo suggestion for common domain misspellings, allowing you to prompt users to correct obvious mistakes before they submit.

Use cases

  • Block invalid addresses at signup to reduce bounce rates
  • Scrub lead lists and newsletter databases before campaign sends
  • Enforce deliverable email requirements in CRM intake forms
  • Surface correction suggestions to users who mistype common domains

Request body

FieldTypeRequiredDescription
emailstringYesThe email address to validate

Example

{
  "email": "user@gmail.com"
}

Response

200 OK

FieldTypeDescription
emailstringThe email address that was evaluated
validbooleantrue when both format and MX checks pass
checksobjectIndividual check results: format (boolean), mx (boolean), role (boolean — true if role-based)
mx_recordsarrayList of MX records, each with priority (integer) and exchange (string)
suggestionstringCorrected email if a common typo was detected, otherwise null
Example
{
  "email": "user@gmail.com",
  "valid": true,
  "checks": {
    "format": true,
    "mx": true,
    "role": false
  },
  "mx_records": [
    { "priority": 5, "exchange": "gmail-smtp-in.l.google.com" }
  ],
  "suggestion": null
}
Example with typo suggestion
{
  "email": "user@gamil.com",
  "valid": false,
  "checks": {
    "format": true,
    "mx": false,
    "role": false
  },
  "mx_records": [],
  "suggestion": "user@gmail.com"
}

401 Unauthorized

{
  "detail": "Missing API key. Include X-API-Key header."
}

402 Payment Required

{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}

422 Unprocessable Entity

{
  "detail": "Field 'email' is required."
}

429 Too Many Requests

{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}

cURL example

curl -X POST https://api.bunny.build/api/v1/email-validation \
  -H "X-API-Key: bun_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"email": "user@gmail.com"}'