Skip to main content

Single Validation

Learn how to validate a single email address using the Mails API.

Endpoint

GET https://api.mails.so/v1/validate

Parameters

NameTypeDescription
emailstringThe email address to be validated

Request Example

Here's an example of how to make a request to validate a single email address:

curl \
-H "x-mails-api-key: YOUR_API_KEY_HERE" \
"https://api.mails.so/v1/[email protected]"

Replace YOUR_API_KEY_HERE with your actual Mails API key.

Response

The API can return two types of responses:

Successful Response (200 OK)

If the request is successful, you'll receive a JSON response with a data object containing the validation results:

{
"data": {
"id": "4c6b837a-1463-4f40-8d0b-b3afa31a4935",
"email": "[email protected]",
"username": null,
"domain": null,
"mx_record": "aspmx.l.google.com",
"score": 80,
"isv_format": true,
"isv_domain": true,
"isv_mx": true,
"isv_noblock": true,
"isv_nocatchall": false,
"isv_nogeneric": true,
"is_free": false,
"result": "risky",
"reason": "catch_all"
},
"error": null
}

Error Response (401 Unauthorized)

If the request fails due to authentication issues, you'll receive a JSON response with an error message:

{
"data": null,
"error": "Unauthorized"
}

Response Fields

FieldDescription
idUnique identifier for the validation request
emailThe email address that was validated
usernameThe part of the email address before the @ symbol
domainThe domain part of the email address
mx_recordThe MX record for the email domain
scoreValidation score (0-100)
isv_formatWhether the email format is valid
isv_domainWhether the domain is valid
isv_mxWhether the MX record is valid
isv_noblockWhether the email is not in block lists
isv_nocatchallWhether the domain doesn't have a catch-all policy
isv_nogenericWhether the email is not a generic address
is_freeWhether the email is from a free email provider
resultOverall validation result (e.g., "risky", "valid", "invalid")
reasonReason for the validation result

Error Handling

If you receive a 401 Unauthorized error, make sure you're using a valid API key in your request header. If the issue persists, contact Mails support for assistance.

Remember to handle potential network errors and timeout scenarios in your implementation.